69 int __gl_meshTessellateMonoRegion(
GLUface *face )
79 assert( up->Lnext != up && up->Lnext->Lnext != up );
81 for( ; VertLeq( up->Dst, up->Org ); up = up->Lprev )
83 for( ; VertLeq( up->Org, up->Dst ); up = up->Lnext )
87 while( up->Lnext != lo ) {
88 if( VertLeq( up->Dst, lo->Org )) {
93 while( lo->Lnext != up && (EdgeGoesLeft( lo->Lnext )
94 || EdgeSign( lo->Org, lo->Dst, lo->Lnext->Dst ) <= 0 )) {
95 GLUhalfEdge *tempHalfEdge= __gl_meshConnect( lo->Lnext, lo );
96 if (tempHalfEdge == NULL)
return 0;
97 lo = tempHalfEdge->Sym;
102 while( lo->Lnext != up && (EdgeGoesRight( up->Lprev )
103 || EdgeSign( up->Dst, up->Org, up->Lprev->Org ) >= 0 )) {
104 GLUhalfEdge *tempHalfEdge= __gl_meshConnect( up, up->Lprev );
105 if (tempHalfEdge == NULL)
return 0;
106 up = tempHalfEdge->Sym;
115 assert( lo->Lnext != up );
116 while( lo->Lnext->Lnext != up ) {
117 GLUhalfEdge *tempHalfEdge= __gl_meshConnect( lo->Lnext, lo );
118 if (tempHalfEdge == NULL)
return 0;
119 lo = tempHalfEdge->Sym;
130 int __gl_meshTessellateInterior(
GLUmesh *mesh )
135 for( f = mesh->fHead.next; f != &mesh->fHead; f = next ) {
139 if ( !__gl_meshTessellateMonoRegion( f ) )
return 0;
152 void __gl_meshDiscardExterior(
GLUmesh *mesh )
157 for( f = mesh->fHead.next; f != &mesh->fHead; f = next ) {
161 __gl_meshZapFace( f );
174 int __gl_meshSetWindingNumber(
GLUmesh *mesh,
int value,
175 GLboolean keepOnlyBoundary )
179 for( e = mesh->eHead.next; e != &mesh->eHead; e = eNext ) {
181 if( e->Rface->inside != e->Lface->inside ) {
184 e->winding = (e->Lface->inside) ? value : -value;
188 if( ! keepOnlyBoundary ) {
191 if ( !__gl_meshDelete( e ) )
return 0;