diff options
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_polygon.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index f7dc143104c..62bd2649cd4 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -883,7 +883,13 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3], const s while (!done && f->len > 3) { done = true; l_iter = find_ear(f, projectverts, use_beauty, abscoss); - if (l_iter) { + + /* force triangulation - if we can't find an ear the face is degenerate */ + if (l_iter == NULL) { + l_iter = BM_FACE_FIRST_LOOP(f); + } + + { done = false; /* printf("Subdividing face...\n");*/ f = BM_face_split(bm, l_iter->f, l_iter->prev->v, l_iter->next->v, &newl, NULL, true); @@ -914,6 +920,8 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3], const s } } + BLI_assert(f->len == 3); + #if 0 /* XXX find_ear should now always return a corner, so no more need for this piece of code... */ if (f->len > 3) { l_iter = BM_FACE_FIRST_LOOP(f); |