algorithmic modeling for Rhino
Hi all,
I am wondering if anyone has any advice on the problem of finding pairs of closest points in a collection of points.
By this I mean, different from what Proximity2D does, for example, if there is a cloud of 100 points, there will be 50 pairs of points, with 50 lines that are not connected to one another; or in other words, each point is only "used" once.
Thanks a lot!
Tags:
Take one point.
Using Rhino.Collections.Point3dList find the prox point (closest) and store both in a DataTree<Point3d> branch.
remove both points from the list and continue.
For instance
Hi Peter,
Thanks a lot!
I'll have to take some time to take a look into the code thoroughly, but it's looking great.
And the trad update that does ... er ... hmm ... "better" things (plus a Ducati promo: makes all the difference).
Thanks a lot, Peter, this is great!
Would you have any suggestion to do the closest pairs between the two lists? instead of only one single closest pair (for example, finding next closest pair until the smaller of the lists exhaust)?
Thanks again!
That's simply a case of a "bigger" loop that repeats (each previous one removes the point found per List) until the smaller List has no cookies to offer (for instance: if (!ListSmaller.Any()) break; or using a crude try{} catch{} combo or ... counting the beans etc etc).
Try it and if you hit the wall drop a word.
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