Hi,
You can also select edges using the angle between the faces sharing it:
float getAngleBetweenVectors ( vector v0; vector v1 )
{
vector v0n = normalize ( v0 );
vector v1n = normalize ( v1 );
return atan2 ( length ( cross ( v0n, v1n ) ), dot ( v0n, v1n ) );
}
int pts [ ] = neighbours ( 0, @ptnum );
foreach ( int pt; pts )
{
if ( @ptnum < pt )
continue;
int prs [ ] = { };
int firsthedge = pointhedge ( 0, @ptnum, pt );
int count = hedge_equivcount ( 0, firsthedge );
if ( count == 2 )
{
int hedge = firsthedge;
do
{
int pr = hedge_prim ( 0, hedge );
if ( pr != -1 && find ( prs, pr ) < 0 )
append ( prs, pr );
hedge = hedge_nextequiv ( 0, hedge );
}
while ( hedge != firsthedge );
vector n0 = primuv ( 0, "N", prs [ 0 ], 0.5 );
vector n1 = primuv ( 0, "N", prs [ 1 ], 0.5 );
float angle = getAngleBetweenVectors ( n0, n1 );
if ( angle >= radians ( ch("minangle") ) )
setedgegroup ( 0, chs("vex_selectiongroup"), @ptnum, pt, 1 );
}
}