How to match the closest points of 3D grids more efficiently?



I just learned how to match the closest points in a 2-dimensional list from these two post,
[Closets points to a point collection?]
[Find index of matching value in sublist]

then I created two nodes, one can get matching indices from selected objects for reordering the original list,

the other one can match the points and create a connected line from the points in the whole node.


That just work perfectly well in 2-dimensional list,

but when I’m working on a 3-dimensional grids,

I have to flatten the points lists first, or those two methods won’t function well.


Is there a way for those two nodes to only match the specific data from each sublists,

or any other way to make the computation more cost efficiency?

the .dyn and .dyf file links are as below: [Dropbox share]


Either nodes solution or scripts are okay for me.



Sorry I can only paste two link in the post.
the .dyn and .dyf file are as below:

FindClosetPointTest20160531.dyn (2.6 KB)

1 Like


This is awesome!!!

This code makes the nodes running faster than I imagined!!!

Thank you so much!

now I can finished the custom nodes to link the text labels and the objects data from DWG,

I’ll definitely make mention of your help once I published these nodes!!

Thanks again!!