How could I select edges between selected points in VEX?
1847
4
0
Masoud
Member
407 posts
Joined: Aug. 2015
Offline
Oct. 11, 2018 2:28 a.m.
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)
Masoud
Member
407 posts
Joined: Aug. 2015
Offline
Oct. 17, 2018 3:49 a.m.
Any helps?
Masoud Saadatmand (MSDVFX)
Masoud
Member
407 posts
Joined: Aug. 2015
Offline
Oct. 18, 2018 4:44 a.m.
Working with edges in VEX is not that easy, right?
Masoud Saadatmand (MSDVFX)
eseral
Member
22 posts
Joined:
Offline
Sept. 14, 2023 6:46 p.m.
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++; }
Aizatulin
Member
477 posts
Joined: July 2005
Offline
Sept. 15, 2023 4:51 a.m.
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)