algorithmic modeling for Rhino
Just came across this closest point sorting solution. Brilliant Vicente! Thanks.
Here's a python version that sorts the input points based on their distance from a single point and the returns the first 'n' of these. The entire script is
def sortfunc(a,b):
....return cmp( a.DistanceTo(the_point), b.DistanceTo(the_point) )
a = sorted(points, sortfunc)
a = a[0:int(closest_count)]
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