fixed triangulator.

This commit is contained in:
Joseph Eagar
2009-03-09 13:24:37 +00:00
parent 714a9303d8
commit 15979466dc
3 changed files with 27 additions and 9 deletions

View File

@@ -126,7 +126,7 @@ int BMO_InitOpf(BMesh *bm, BMOperator *op, char *fmt, ...);
/*va_list version, used to implement the above two functions,
plus EDBM_CallOpf in bmeshutils.c.*/
int BMO_VInitOpf(BMesh *bm, BMOperator *op, char *fmt, va_list vlist);
/*------end of formatted op system -------*/
BMOpSlot *BMO_GetSlot(struct BMOperator *op, int slotcode);
void BMO_CopySlot(struct BMOperator *source_op, struct BMOperator *dest_op, int src, int dst);

View File

@@ -19,11 +19,25 @@ typedef struct BMWalker {
GHash *visithash;
} BMWalker;
void BMW_Init(struct BMWalker *walker,BMesh *bm,int type, int searchmask);
void BMW_Init(struct BMWalker *walker, BMesh *bm,int type, int searchmask);
void *BMW_Begin(BMWalker *walker, void *start);
void *BMW_Step(struct BMWalker *walker);
void BMW_End(struct BMWalker *walker);
/*
example of usage, walking over an island of tool flagged faces:
BMWalker walker;
BMFace *f;
BMW_Init(&walker, bm, BMW_ISLAND, SOME_OP_FLAG);
f = BMW_Begin(&walker, some_start_face);
for (; f; f=BMW_Step(&walker)) {
//do something with f
}
BMW_End(&walker);
*/
#define BMW_SHELL 0
/*#define BMW_LOOP 1
#define BMW_RING 2

View File

@@ -395,14 +395,18 @@ int goodline(float (*projectverts)[3], BMFace *f, int v1i,
if (testedgeside(v1, v2, v3)) return 0;
do {
VECCOPY(pv1, projectverts[l->v->head.eflag2]);
VECCOPY(pv2, projectverts[((BMLoop*)l->head.next)->v->head.eflag2]);
for (i=0; i<nvert; i++) {
if (i == v1i || i == v2i || i == v3i) continue;
VECCOPY(pv1, projectverts[i]); //l->v->head.eflag2]);
VECCOPY(pv2, projectverts[(i+1) % nvert]); //((BMLoop*)l->head.next)->v->head.eflag2]);
//if (linecrosses(pv1, pv2, v1, v3)) return 0;
if (point_in_triangle(v1, v2, v3, pv1)) return 0;
if (point_in_triangle(v3, v2, v1, pv1)) return 0;
if (linecrosses(pv1, pv2, v1, v3)) return 0;
l = l->head.next;
} while (l != f->loopbase);
//l = l->head.next;
} //while (l != f->loopbase);
return 1;
}
/*