Grasshopper

algorithmic modeling for Rhino

Does anyone know how to sort a list of points to find the closest neighbors to each point?
I looked at Scott Davidson's post of sort and sub list (attached below), but I could not adapt it to sort the list of just group of points only. His file finds the n-closest points to a point on a curve, but I want to find the n-closest points for each point in the group. I would use the Proximity3d component but it will only take points from the rhino model, baked and brought in, not points from grasshopper algorithm.

I started a VB node to try and do this but I am not getting very far. I can find the closest pt, but not the 4, 5, or 6 closest points with my method.
I am using version 0.6.0043.

thanks,
Guy

any help? any ideas?

Views: 4278

Attachments:

Replies to This Discussion

Hi, I made this some time ago that maybe can help you:


For every point a made a "branch" with all the points (i use two duplicate components) and then i sort the points by distance on every sub-group. Then I select the points by distance or by n elements and finally I made a line between each point and his neighbors.
Attachments:
ah.. in my definition one point can be a neighbor of multiples points.. if you want "uniques" neightbors, I think that will require a vbnet component.
Manuel,

Thank you! Works wonderfully. Its ok that the curves aren't unique. I tried a similar approach, but didn't get it quite right. I appreciate you sharing.

Happy Holidays,

Guy

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service