algorithmic modeling for Rhino
Hi friends,
I have a list of points. I am trying to have contours, so as you see in the attached image, point#9 has to connect #0, and this has to continue each row. Since I don't have sublists, they connect like a spiral line rather than contours. That is, as you see in the panel, I have just one line rather than having a list of closed curves. If I split the imported list to sub-lists of 10 members, I can get the conturs, but the problem is that the main list that I have has different number of points on each contour line. For example, line 0 has 10 points, line 1 has 15 points, line 2 has 13 points. How can I get contour lines out of a list which is not following any rules to be divided? I appreciate your time and help.
Tags:
 contour lines.gh, 9 KB
 contour lines.gh, 9 KB                             contour.JPG, 377 KB
 contour.JPG, 377 KB                             contourlines_re.gh, 11 KB
 contourlines_re.gh, 11 KB                             Sort_points_on_contours_V1.gh, 122 KB
 Sort_points_on_contours_V1.gh, 122 KB                            you ARE the Lord!! It's amazing! Peter, Do you know what is the problem with the last layer of points? as shown in the image they are like Zigzag!
Yes that's exactly why I've captured that "layer".
In order to sort points for doing some polyline the classic approach (used "internally" in the C#) is:
1. Find a plane that "best" fits (available as native component).
2. Find a sphere that "best" fits (ditto).
3. Intersect and get a curve.
4. Sort the points "along" that curve.
But this works in some situations where the topology is "suitable" (or "cooperative" so to speak)... whilst in some others doesn't (try for instance points distributed along a  banana like skin). That said. there's other ways to attempt do that (one of them is a concave [not convex] hull).
 
For Plan B (out of many) see attached.
 sort_points_clockwise_V1.gh, 128 KB
 sort_points_clockwise_V1.gh, 128 KB                             Pts_in_horizontal_polylines_V1.gh, 125 KB
 Pts_in_horizontal_polylines_V1.gh, 125 KB                             Pts_in_LOL_order_V2.gh, 137 KB
 Pts_in_LOL_order_V2.gh, 137 KB                             Pts_in_order_demo_23B.gh, 130 KB
 Pts_in_order_demo_23B.gh, 130 KB                             Pts_in_order_V2.gh, 146 KB
 Pts_in_order_V2.gh, 146 KB                             Sort_points_on_contours_V1A.gh, 132 KB
 Sort_points_on_contours_V1A.gh, 132 KB                            Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
    © 2025               Created by Scott Davidson.             
    Powered by
    