Jump to content

Connected neighbours for points in group


JDee

Recommended Posts

Hi

What I need is to find connected neighbors of every point of specific group.
I guess that I need one loop inside of other loop in VOP, is it right way at all? so the firs one is for all the points I have in the group and then second one for all the neighbors for them? I feel like it's not so easy, with my knowledge of VEX.
Is there more simple way, and how to specify group point numbers properly from outside VOP, so I don't need to set them manually in VOP every time ?
Much appreciated any help.

NFG.hipnc

Link to comment
Share on other sites

a VEX solution

int ls [] = array();

if (inpointgroup(0, "in", @ptnum)) {
    ls = neighbours(0, @ptnum);
    for (int i=0; i<len(ls); i++) {
        setpointgroup(0, "neighbours", ls[i], 1);
        setpointattrib(0, "Cd", ls[i], {1,0,0});
    }
}

 

  • Like 1
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...