Every time I go to extract the border from a mesh I always end up using some strange combo of Group unshared edges, delete and dissolve, I came across a good way of getting unshared edges that I haven't thought of before, and now it seems really obvious ... using the polycap node to trace the border and then deleting all of the source prims, works like a charm!
get the hip file here!
I have also usually had trouble with splitting up a line into multiple primitives, here is a way to create a primitive per edge. This example only works if every point has 2 neighbours but could easily be modified with a copy SOP to allow a dynamic amount of neighbours. (instead of 2 vopsops and a merge to duplicate the points).
It works like this:
- The point number is stored in an attribute to create a unique number for each point
- The whole mesh goes into 2 streams to duplicate every point.
- For the first set of points, each point gets the point number of the first neighbour and applies a cantor function to create a unique number for each edge. (just think of the point numbers as X and Y on a table and the returned number is the index number of the location in the table)
- The second set of points does the same for the second neighbor.
- The add SOP creates polylines between points with the same value ....
One thing to note is that the vop sop does a min and max to sort the point numbers going into the function, that way the points on either side of the edge return the same value and get connected.
get the hip file here!
still works! Thx
ReplyDelete