galagast Posted February 24, 2016 Share Posted February 24, 2016 Hi, is there a built-in way to reduce points on edges via an angle threshold? 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? Quote Link to comment Share on other sites More sharing options...
anim Posted February 24, 2016 Share Posted February 24, 2016 Facet SOP / Remove Inline Points or Refine SOP / Unrefine 1 Quote Link to comment Share on other sites More sharing options...
galagast Posted February 24, 2016 Author Share Posted February 24, 2016 Awesome! Thank you Tomas for the quick reply. Both works great! Quote Link to comment Share on other sites More sharing options...
acey195 Posted February 24, 2016 Share Posted February 24, 2016 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. Quote Link to comment Share on other sites More sharing options...
galagast Posted February 24, 2016 Author Share Posted February 24, 2016 (edited) 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. Edited February 24, 2016 by galagast Quote Link to comment Share on other sites More sharing options...
acey195 Posted February 24, 2016 Share Posted February 24, 2016 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) if I say, put: "!pointgroupSomething" in the groupfield, it can still remove those points with the "Remove Inline Points", correct me if Im wrong Quote Link to comment Share on other sites More sharing options...
galagast Posted February 24, 2016 Author Share Posted February 24, 2016 (edited) Indeed, I just tested it out in H15, it doesn't seem to be taking into consideration the point groups (and edge groups). It seems to only work on prim groups. Facet_Point_Group.rar Edited February 24, 2016 by galagast Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 24, 2016 Share Posted February 24, 2016 (edited) 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 February 24, 2016 by f1480187 1 Quote Link to comment Share on other sites More sharing options...
acey195 Posted February 25, 2016 Share Posted February 25, 2016 yeah its basically something like that I've used on my end except its done per primitive, so can be looped a couple of times, so indirect inline points are removed as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.