bmesh triangulate: skip intersection checks for degenerate geometry and just triangul...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 24 Sep 2013 12:45:14 +0000 (12:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 24 Sep 2013 12:45:14 +0000 (12:45 +0000)
source/blender/bmesh/intern/bmesh_polygon.c

index dbfb08454e4f65814cd826a1eb8d8642b0895359..2492dce05c7b76e30a91fc7adeb4f41d62b3f526 100644 (file)
@@ -865,7 +865,11 @@ static BMLoop *poly_find_ear(BMFace *f, float (*projectverts)[2], const bool use
        const float cos_threshold = 0.9f;
        const float bias = 1.0f + 1e-6f;
 
-       BLI_assert(len_squared_v3(f->no) > FLT_EPSILON);
+       BLI_assert(BM_face_is_normal_valid(f));
+       /* just triangulate degenerate faces */
+       if (UNLIKELY(is_zero_v3(f->no))) {
+               return BM_FACE_FIRST_LOOP(f);
+       }
 
        if (f->len == 4) {
                BMLoop *larr[4];