Building
Your Own Subdivision Surfaces
Listing
1. Locating White Triangle
Edge
PointLocation( V, M ) {
e = randomEdge( M );
if RightOf( V, e )
e = e.Sym; /* e.Sym
is the reverse of e */
while (1) {
if (V == e.v1 || V ==
e.v2 )
return
e;
else
whichop
= 0;
if
!RightOf(V, e.Onext)
whichop
+= 1;
if
!RightOf(V, e.Dprev)
whichop
+= 2;
switch
(whichop) {
case
0:
return
e;
break;
case
1:
e
= e.Onext;
break;
case
2:
e
= e.Dprev;
break;
case
3:
if
(dist(e.Onext, V) < dist(e.Dprev, V))
e
= e.Onext;
else
e
= e.Dprev;
break;
};
};
};
________________________________________________________
Back
to Article