algorithmic modeling for Rhino
Hi!
I've been struggling with trying to find a solution for this and I thought I could write the community and ask for help!
I'm trying to split a list of triangles into 4 lists based on their distance with a point. The list has 800 elements, and there is one point, I want the 200 closest triangles to the point to be in the first list, and so on until the furthest are in the 4th list.
Any recommendations?
The overall purpose is to create something like the attached image of the nendo door.
And what i have so far is in the screenshots.
Thank you so much!
Tags:
hello Andrea
you can use sort list component and sort the distance values, and synchronously sort the triangles list. then youn can partition this list into four lists using partition list component with size the initials list length divided by four.
cheers
alex
Hi Alex!
Thanks for replying. I have one sorted list with all the distances from the point to the center of the triangles. Then I have a list with all the triangles in it and I don't know how to actually sort the triangles in 4 lists because the sort component gives me numeric values and not polylines.
you need to input the triangles list to the input a of the sort list component, to get them listed synchronously. then the a output can be inputted to partition list component so that the list is partitioned into 4 lists. use list length in the a output of sort list, then provide this output to s input of partition list component. right click on the s input and select expression x/4 to have 4 lists as an output.
cheers
alex
ps uploading a definition makes things a lot easier
Alex!
It worked!! Thank you sooo much!
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