Jump to content

Correcting Polyline point order help


Recommended Posts

Hi. I've got a bunch of polylines generated from intersecting spheres using the intersectionanaylsis SOP. They're ellipses but the point order is bad. How can I sort the points in order around each ellipse?

I tried fuse, add, join, resample, connectadjacentpieces, find shortest path, even asked chatGPT, but nothing seems to work (delete prims, fuse, connect adjacent, find shortest path gets the best result but only for half the curve and only by manual start/end selection).

 

Its seems you should be able to walk arround the path using point proximity as a guide somehow, but I don't know how to do it in vex. Any ideas?

Screenshot 2024-06-30 112707.png

Polyline sorting.hiplc

Edited by RT_SD
Added HIP file
Link to comment
Share on other sites

Posted (edited)

Cconceptually would this work? :

Start at point 0.
Findt the nearest point (except itself), and create a polyline between it and the nearest one, add theses two points to an array.
Repeat starting from the last added point to the array, and excluding all other points in it.
Set ptnum to the array order.

Edited by RT_SD
Link to comment
Share on other sites

You can use the PolyPath SOP to make a single open polygon with the correct vertex order out of the Intersection Analysis output, because Intersection Analysis doesn't output a single continuous polyline. After that you can use a Sort SOP set to "Point Sort: By Vertex Order" to transfer the correct order to the points.

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

2 hours ago, dleonhardt said:

You can use the PolyPath SOP to make a single open polygon with the correct vertex order out of the Intersection Analysis output, because Intersection Analysis doesn't output a single continuous polyline. After that you can use a Sort SOP set to "Point Sort: By Vertex Order" to transfer the correct order to the points.

Yep that did it, cheers!

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...