algorithmic modeling for Rhino
Tags:
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)]
© 2019 Created by Scott Davidson. Powered by