[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45747] trunk/blender/source/blender/ blenlib/intern/scanfill.c: fix for eternal loop in scanfill,

Campbell Barton ideasman42 at gmail.com
Wed Apr 18 16:07:00 CEST 2012


Revision: 45747
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45747
Author:   campbellbarton
Date:     2012-04-18 14:06:59 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/scanfill.c

Modified: trunk/blender/source/blender/blenlib/intern/scanfill.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/scanfill.c	2012-04-18 13:13:54 UTC (rev 45746)
+++ trunk/blender/source/blender/blenlib/intern/scanfill.c	2012-04-18 14:06:59 UTC (rev 45747)
@@ -581,12 +581,12 @@
 		 * 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 @@
 			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;
 			}
 		}
 




More information about the Bf-blender-cvs mailing list