diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-24 16:45:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-24 16:45:14 +0400 |
commit | 05c53918aa25c699f24665a0ac1865f5736b27f2 (patch) | |
tree | 123b4886583eccfd2bb312f988a4593cdcc7d607 /source/blender/bmesh/intern/bmesh_polygon.c | |
parent | fa16aeed2dc1636fb81229041ffd233c0abbf624 (diff) |
bmesh triangulate: skip intersection checks for degenerate geometry and just triangulate on a fixed loop.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_polygon.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index dbfb08454e4..2492dce05c7 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -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]; |