add asserts when scanfilling or triangulating with zero length normal.

This commit is contained in:
2013-06-02 22:54:00 +00:00
parent ad0305281b
commit 99b55ef6eb
2 changed files with 4 additions and 0 deletions

View File

@@ -869,6 +869,8 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float no
int totfaces = 0; /* total faces added */
float mat_2d[3][3];
BLI_assert(!nor_proj || len_squared_v3(nor_proj) > FLT_EPSILON);
/* reset variables */
eve = sf_ctx->fillvertbase.first;
a = 0;

View File

@@ -831,6 +831,8 @@ 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);
if (f->len == 4) {
BMLoop *larr[4];
int i = 0, i4;