How could I select edges between selected points in VEX?

   1847   4   0
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hi;

In VEX, I want to select boundary edges loop, based on a points group.
Here is my point wrangle codes:
int Array[];
if(inpointgroup(0,"PointsGroup",@ptnum)==1)
{
    append(Array,@ptnum);
    foreach(int ix; Array)
    {
        int ShEdges = pointhedge(0,ix);
        if (hedge_isprimary(0,ShEdges)==1)
        {        
            setedgegroup(0,"SelEdgesGroup",hedge_srcpoint(0,ShEdges), hedge_dstpoint(0,ShEdges),1);
        }
    }
}

The problem is, it selects only some edges like image bellow.

Any ideas would be appreciated.
Thanks
Edited by Masoud - Oct. 18, 2018 05:00:26

Attachments:
BoundryEdges_01.hip (94.1 KB)
Capture.JPG (90.9 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Any helps?
Masoud Saadatmand (MSDVFX)
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Working with edges in VEX is not that easy, right?
Masoud Saadatmand (MSDVFX)
User Avatar
Member
22 posts
Joined:
Offline
this seems to work:

int o,d;
int npts=len(primpoints(0,@primnum));
int numeq, en=primhedge(0,@primnum);
numeq = hedge_equivcount(0,en);
int hedg;
int i=0;
while(i<npts){
int neq=hedge_equivcount(0,en);
if(neq<2){
o=hedge_srcpoint(0,en);
d=hedge_dstpoint(0,en);
i@b=1;
setedgegroup(0,'boundary',o,d,1);
}
append(hedg,en);en=hedge_next(0,en);
i++;
}
User Avatar
Member
477 posts
Joined: July 2005
Offline
You can also loop over all neighbours of a point and check if both points are in the selection.

Attachments:
BoundryEdges_01_mod.hipnc (99.2 KB)

  • Quick Links