Grasshopper

algorithmic modeling for Rhino

Hey guys ,

I stuck on an easy to tell but somehow difficult to solve
problem.

I basically have two random pointsets with same amount of points
and try to find all the closest conections . (finding smallest distance between all
the points , connect two points with smallest distance ,cull used items start again )

i did for a few points by copying the compound next to each other
but i guess i will have to write a loop.
but is there any other way to do it because i have to connect something like 5000 points with 5000 points and this might take ages ....


thanks for any help

Views: 4097

Replies to This Discussion

Hi Chris,

have a look at the Vector->Point->Closest Point component. It finds the closest point in a collection of points.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
thanks for your quick response
but i am still curious how to move on after the closest point was found
since i need to cull this one out when i go into the next round

currently as on the attached image the all connected by list index but i need to find the closest way
Attachments:
Ah, I didn't realise you wanted to remove the points from earlier answers. That indeed makes it much harder, in fact I suspect you'll need a script for this.

When you do this though, the order in which you perform the search becomes very important. Are you sure you're happy with just a simple iteration?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
hey david ,

thanks again for your quick answer. for now the simpler to write for me
the better so the iteration would do .

i have only made some very simple vb scribts before .
so just basic questions -

once i got the two arrays in :

1* is there a similar command like the closest point compound
2* how can i cull a number out of an array

do i have to do it like ?

looping through all points
finding closest point
make create vector between them
get the information out of the loop
cull the 2 points from the arrays
start loop again
l


thx for your help

chris
I attached a file with a VB script that finds and subtracts closest points. It also shows very clearly why the order is important and what kind of problems you can get with this approach.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Attachments:
thanks david was perfectly what i was looking for

i was presorting the points by distance and get a quiet the result i was hopping for.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service