[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55563] trunk/blender/source/blender/bmesh /operators/bmo_triangulate.c: beautify fill: skip testing invalid cases ( 2 triangles that _don't_ have 4 unique verts between them).

Campbell Barton ideasman42 at gmail.com
Mon Mar 25 05:48:31 CET 2013


Revision: 55563
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55563
Author:   campbellbarton
Date:     2013-03-25 04:48:30 +0000 (Mon, 25 Mar 2013)
Log Message:
-----------
beautify fill: skip testing invalid cases (2 triangles that _don't_ have 4 unique verts between them).

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c

Modified: trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c
===================================================================
--- trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c	2013-03-25 02:41:30 UTC (rev 55562)
+++ trunk/blender/source/blender/bmesh/operators/bmo_triangulate.c	2013-03-25 04:48:30 UTC (rev 55563)
@@ -87,11 +87,22 @@
 				continue;
 			}
 
-			v1 = e->l->prev->v;
-			v2 = e->l->v;
-			v3 = e->l->radial_next->prev->v;
-			v4 = e->l->next->v;
+			v1 = e->l->prev->v;               /* first face vert not attached to 'e' */
+			v2 = e->l->v;                     /* e->v1 or e->v2*/
+			v3 = e->l->radial_next->prev->v;  /* second face vert not attached to 'e' */
+			v4 = e->l->next->v;               /* e->v1 or e->v2*/
 
+			if (UNLIKELY(v1 == v3)) {
+				// printf("This should never happen, but does sometimes!\n");
+				continue;
+			}
+
+			// printf("%p %p %p %p - %p %p\n", v1, v2, v3, v4, e->l->f, e->l->radial_next->f);
+			BLI_assert((ELEM3(v1, v2, v3, v4) == false) &&
+			           (ELEM3(v2, v1, v3, v4) == false) &&
+			           (ELEM3(v3, v1, v2, v4) == false) &&
+			           (ELEM3(v4, v1, v2, v3) == false));
+
 			if (is_quad_convex_v3(v1->co, v2->co, v3->co, v4->co)) {
 				float len1, len2, len3, len4, len5, len6, opp1, opp2, fac1, fac2;
 				/* testing rule:




More information about the Bf-blender-cvs mailing list