How to draw the axis from a point cloud

Hi everyone

Now I have a point cloud and it’s exactly comes from an object one circle sweep along an axis.I want to draw the axis from that point cloud, and I choosed K-Means Clustering to try accessing, but the resuilt is not satisfating.

Is it possible to find the axis? Thanks in advance.axis generator.gh (62.5 KB)

somewhere similiar to this topic

This is different from the prior approaches but seems to work in your case.

Edit; I made a little change because I saw that fiddling with the distance input on Point Groups still gave 3 that didn’t have 32 points in each, so I culled those before creating the axis.

axis generator-b.gh (61.5 KB)

Thank you, Ethan!

I knew the point groups component, and I had used it to solve other question, but I haven’t realized it could be used that way:laughing:

How does that component work? Actually the distance from circle to circle is quite small than the radii of circle itself. I’m quite confused.

I assume it looks for all points that are contiguous to each other within the stated input range. Looking at your image, it appeared that I could use it because most points were nicely aligned along circles to begin with and the distance between circles was greater, in most cases, than the distances within each circle.

You can see here the 3 regions where the circles bunch up.