Jump to content
Atom

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.

Untitled-1.jpg

ap_sort_points_along_edge_group.hiplc

Edited by Atom

Share this post


Link to post
Share on other sites

So here is the original edge group from the shape.

Untitled-1.jpg.699d8a6b85aef98c9973f402195e52dd.jpg

 

Here is that same edge resampled to add more points.

Untitled-1.jpg.2dbacb0481a77d85f9292376cd4a2955.jpg

 

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

Untitled-1.jpg.202983afda985c62b398a8f6dced5d79.jpg

 

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

Untitled-1.jpg.5d79290eaff5db4f705532c753d62500.jpg

 

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.

Untitled-1.jpg.d7286b0a4c302cd96fd379c239b5cac4.jpg

Edited by Atom

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!

deforming_cloth_issue.gif

  • 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

×