Jump to content

Sort Points In Order They Appear In Edge Group?

Recommended Posts

Hi All,

I have a curve shape with edge groups. The edge groups flow in various direction, sometimes along the XY plane and sometimes along the XZ plane.

I need to have the resulting point group have the points sorted in the order that they appear in the edge group. So two groups are involved, an edge group, which is the source and the point group which is the result. The resulting point group is detected by remeshing the original shape into a higher triangle/quad representation of the shape. The original edge group is resampled and compared against the remesh version to determine final point group candidates.

The image shows the problem.

When I inspect the resulting point group with a python node I can see the order is wrong. Point #6 is listed first and point #16 is listed second but they are very far apart circled in RED.

Python order (6, 16, 23, 25, 140, 149, 156)

Required order (6, 25, 7, 140, 23, 149, 21, 156, 16, 14)

I tried using the sort node, expecting Point Sort By Vertex Order to work, but it does not. I tried all the other sort options as well.



Edited by Atom

Share this post

Link to post
Share on other sites

So here is the original edge group from the shape.



Here is that same edge resampled to add more points.



A grid based version of the original shape (via divide) is overlayed near the sample points.



Points from the overlayed grid are selected based upon proximity to the resample points. This is called the result set.



So how do I order or sort the result set? (yes I tried turning on the Create Ordered check box.)


When the points are in the wrong order, the clothstitchconstraint node does not work. Cross stitching errors out the node.


Edited by Atom

Share this post

Link to post
Share on other sites

Thanks, that looks promising!


Share this post

Link to post
Share on other sites

I was able to integrate your solution into my cloth stitching. Now I have a working sleeve!


  • Like 3

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now