algorithmic modeling for Rhino
How might I sort random points in a plane by their angle from the plane's U vector in a clockwise (or counter clockwise) direction?
Or more precisely, sorting the angle between the vectors created by each of these random points from the plane's origin and the U vector.
Tags:
You need to compute the vector angle between the plane X-axis and the plane origin -> point vector. Furthermore you need to compute this angle in 2D, as that's the only way you'll get a full circle angle (in 3D, only half circle angles are possible).
Then you can sort the angles while sorting the point in parallel. See attached.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
That is exactly what I did, expecting that the Vector Angle component would product a full circle angle given a plane. I must have fed the wrong string because all I was getting were half circle angles.
Thanks for bringing me back to that component. It performs well if it's fed well.
Also have a look at this method: http://www.grasshopper3d.com/forum/topics/perimeter-sort
You could also put a circle on the centroid of the bounding box and use that as the boundary curve for the linked method.
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