Jump to content

Edge Reduction


galagast

Recommended Posts

Hi, is there a built-in way to reduce points on edges via an angle threshold?

 

post-3610-0-08252300-1456292589_thumb.jp

 

I was able to resolve this using a Point Wrangle:

int id_next = @ptnum+1 > @numpt-1 ? 0 : @ptnum+1;
vector p_next = point(0, "P", id_next);
vector p_last = point(0, "P", @ptnum-1);

vector v1 = normalize(p_last - @P);
vector v2 = normalize(p_next - @P);

float rad = dot(v1, v2);
f@ang = degrees(acos(rad));

int val = @ang > ch("thresh");
setpointgroup(0, "flat", @ptnum, val, "set");

It creates a "flat" group that I would then blast. Although this would only work on very specific cases. >_<

 

I was just curious if there's another method to do this natively?

 

Link to comment
Share on other sites

these do work great, but unfortunately neither of those allow you set anchor points (points it will never remove)

for very small tolerances these methods work great though.

 

If anyone knows an easy way to set anchor points as well, I would be interested in that.

Its possible to just write a custom version of the node in a attrib wrangle,

but if there was an easier way by say passing point groups into the facet node that would have been great.

Link to comment
Share on other sites

but if there was an easier way by say passing point groups into the facet node that would have been great.

 

The Facet SOP does have a Group parameter that allows point groups.. unless I misunderstood something from your query. :lol:

post-3610-0-86163200-1456305940_thumb.jp

Edited by galagast
Link to comment
Share on other sites

well yeah it does accept them, but it doesn't do anything with them in relation to "Remove Inline Points" as far as I know (at least in H14) :P

 

if I say, put: "!pointgroupSomething" in the groupfield, it can still remove those points with the "Remove Inline Points", correct me if Im wrong

Link to comment
Share on other sites

Initial solution naturally works for group selection. Alternative version:

int nbs[] = neighbours(0, @ptnum);

if (len(nbs) == 2)
{
    vector a = normalize(point(0, "P", nbs[0]) - @P);
    vector b = normalize(point(0, "P", nbs[1]) - @P);
    float inlinity = fit11(dot(a, , 1, 0);

    if (inlinity > ch("max_inlinity"))
    {
        removepoint(0, @ptnum);
    }
}

remove_inline.hipnc

Edited by f1480187
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...