diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-18 18:06:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-18 18:06:59 +0400 |
commit | ca913254aa0706956980ec9dcaef79277a49ef3d (patch) | |
tree | 6d676cc49df1a69d608f624a84af3f863e8b6dfe | |
parent | 580f19d949cbe9302d0b50691d2d8950c93d150b (diff) |
fix for eternal loop in scanfill,
The cause for this is bmesh faces which have zero area have their normals set to a fake value (Z-Up), this would break scanfill, possible fixes are to calculate the faces normal each time or tag as invalid but its easiest to avoid the eternal loop with an extra test.
-rw-r--r-- | source/blender/blenlib/intern/scanfill.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index a57c2eb1ad3..6d7c3b0a19c 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -581,12 +581,12 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf) * fix to #4544. */ if (eed->v1->f == 255) { v1 = eed->v1; - while ((eed->v1->f == 255) && (eed->v1->tmp.v != v1)) + while ((eed->v1->f == 255) && (eed->v1->tmp.v != v1) && (eed->v1 != eed->v1->tmp.v)) eed->v1 = eed->v1->tmp.v; } if (eed->v2->f == 255) { v2 = eed->v2; - while ((eed->v2->f == 255) && (eed->v2->tmp.v != v2)) + while ((eed->v2->f == 255) && (eed->v2->tmp.v != v2) && (eed->v2 != eed->v2->tmp.v)) eed->v2 = eed->v2->tmp.v; } if (eed->v1 != eed->v2) addedgetoscanlist(sf_ctx, eed, verts); @@ -876,8 +876,8 @@ int BLI_edgefill_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedup, co for (eve = sf_ctx->fillvertbase.first; eve; eve = eve->next) { if (LIKELY(!compare_v3v3(v_prev, eve->co, COMPLIMIT))) { add_newell_cross_v3_v3v3(n, v_prev, eve->co); + v_prev = eve->co; } - v_prev = eve->co; } } |