sorting random (noisy) points that clearly make a shape

   3782   4   1
User Avatar
Member
65 posts
Joined: Feb. 2017
Offline
I have a bunch of randomized points, and in this example they form a circular shape, although they could easily be a noisy line. Even though I can clearly see the shape in the noise, I haven't figured out how to order the points so I can add a line across them.

My attempt was to split the circle into 2 halves, and then sort along the z-axis. Although it mostly works, it can still run into problems as shown in the image.

Attachments:
random_points_in_a_circle.png (54.0 KB)
noisey_line.png (59.2 KB)
attempt_1.png (62.2 KB)
random_point_sort.hipnc (86.2 KB)

User Avatar
Member
65 posts
Joined: Feb. 2017
Offline
K, I have a working solution. Still interested in what solutions other people have.

Attachments:
random_working.png (149.2 KB)
random_point_sort_2.hipnc (71.1 KB)

User Avatar
Member
686 posts
Joined: Sept. 2013
Offline
Uvtexture node set to cylindrical Y and then sort node set to attribute $MAPU .

A point VOP containing frompolar node.

An attribwrangle converting cartesian to polar coordinates using sin() and cos() .
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
8045 posts
Joined: Sept. 2011
Offline
Konstantin Magnus
Uvtexture node set to cylindrical Y and then sort node set to attribute $MAPU .

A point VOP containing frompolar node.

An attribwrangle converting cartesian to polar coordinates using sin() and cos() .

or:
(atan2(y,x)+PI)/(2.0*PI)
User Avatar
Member
495 posts
Joined: July 2005
Offline
Hi,
If you have knowledge of the spline, which the points are following you can create an attribute (with xyzdist()) to get the u-value for each point to sort them with it . This works quite ok even for roughly approached splines. But if you have no information to create one, I think some heuristic solutions for the “travelling salesman problem” should work aswell but I don't have much experience in this area.

Attachments:
random_point_sort_Curve.hipnc (93.3 KB)

  • Quick Links