Jump to content

Nearest Neighbour Point


sadhu

Recommended Posts

Hello friends,

1) I have scattered points on the grid.

2) Select any random point (startpt group) to begin with, rest of the points will be in availablepts group .

3) Find startpt's nearest neighbour and connect them using add sop.

4) Select this point (nearest neighbour)and find it's nearest neighbour

out of (availablepts - startpt ) group.

and so on till you connect all the points to from a curve.

Please refer the attached file. I think the problem lies in the delet nodes in the foreach sop and availablepts.

Can someone please tell what is the problem with this setup?

Thanks a lot for your time

:)

sop_nearest_neighbour_connect.hipnc

Edited by sorry
Link to comment
Share on other sites

Hi Mike. Thanks a lot for your help. :)

It took me a long time to figure out where I was going wrong. The main part was reusing the available points. Without your help it would have been very difficult for me to figure out the solution.

Attached is the file with the necessary changes in the first post.

sop_nearest_neighbour_connect_done.hipnc

Edited by sorry
Link to comment
Share on other sites

My pleasure :P

Hi Mike. Thanks a lot for your help. :)

It took me a long time to figure out where I was going wrong. The main part was reusing the available points. Without your help it would have been very difficult for me to figure out the solution.

Attached is the file with the necessary changes in the first post.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...