algorithmic modeling for Rhino
I'm looking for a way to sort a list points, built up from series of x and y values, by the y-values first and then, by x-values:
Current List: Output from Point XYZ Component
(0.0, 0.0, 0.0)
(1.0, 0.0, 0.0)
(2.0, 0.0, 0.0)
(3.0, 0.0, 0.0)
(0.0, 1.0, 0.0)
(1.0, 1.0, 0.0)
(2.0, 1.0, 0.0)
(3.0, 1.0, 0.0)
(0.0, 2.0, 0.0)
(1.0, 2.0, 0.0)
(2.0, 2.0, 0.0)
(3.0, 2.0, 0.0)
Desired List:
(0.0, 0.0, 0.0)
(0.0, 1.0, 0.0)
(0.0, 2.0, 0.0)
(0.0, 3.0, 0.0)
(1.0, 0.0, 0.0)
(1.0, 1.0, 0.0)
(1.0, 2.0, 0.0)
(1.0, 3.0, 0.0)
(2.0, 0.0, 0.0)
(2.0, 1.0, 0.0)
(2.0, 2.0, 0.0)
(2.0, 3.0, 0.0)
I was unable to make the Sort List Component work successfully:
Thanks,
Amanda
Tags:
David,
Thank you
This is great! Thank you!
Could you please repost the image? I'm able to see a portion of it?
Where the sort component sorts in the xyz.
I need to be able to sort in the yxz.
Thanks
Hi David,
All different with what I wanna do.
pls check below:
listPts = rs.coercePoints3d(input)
#is it possible use sorted() function like:
sorted(listPts, key = listPts.x)
#the syntax is bad but for address the idea that: I want use sort() or sorted() function to sort a point3d list by its x or y value.
This is just genious, neat and simple
Thank you
Thanks for this.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by