[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51361] trunk/blender/source/blender/bmesh /intern/bmesh_mods.c: fix for 2 cases BM_disk_dissolve() could fail/assert.

Campbell Barton ideasman42 at gmail.com
Tue Oct 16 11:11:10 CEST 2012


Revision: 51361
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51361
Author:   campbellbarton
Date:     2012-10-16 09:11:07 +0000 (Tue, 16 Oct 2012)
Log Message:
-----------
fix for 2 cases BM_disk_dissolve() could fail/assert.
- when there was a vertex with 2 boundary edges and one manifold edge (vert at the boundary between 2 quads) it could assert.
- when there is a vertex with 2 boundary verts connected that both use the same face, it would do nothing.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/intern/bmesh_mods.c

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_mods.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_mods.c	2012-10-16 07:53:10 UTC (rev 51360)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_mods.c	2012-10-16 09:11:07 UTC (rev 51361)
@@ -130,6 +130,7 @@
 	/* this code for handling 2 and 3-valence verts
 	 * may be totally bad */
 	if (keepedge == NULL && len == 3) {
+#if 0
 		/* handle specific case for three-valence.  solve it by
 		 * increasing valence to four.  this may be hackish. .  */
 		BMLoop *loop = e->l;
@@ -140,6 +141,13 @@
 		if (!BM_disk_dissolve(bm, v)) {
 			return FALSE;
 		}
+#else
+		BM_faces_join_pair(bm, e->l->f, e->l->radial_next->f, e, TRUE);
+
+		if (!BM_vert_collapse_faces(bm, v->e, v, 1.0, FALSE, TRUE)) {
+			return FALSE;
+		}
+#endif
 		return TRUE;
 	}
 	else if (keepedge == NULL && len == 2) {
@@ -188,8 +196,9 @@
 			} while (e != v->e);
 		}
 
-		/* collapse the verte */
-		e = BM_vert_collapse_faces(bm, baseedge, v, 1.0, TRUE, TRUE);
+		/* collapse the vertex */
+		/* note, the baseedge can be a boundary of manifold, use this as join_faces arg */
+		e = BM_vert_collapse_faces(bm, baseedge, v, 1.0, !BM_edge_is_boundary(baseedge), TRUE);
 
 		if (!e) {
 			return FALSE;




More information about the Bf-blender-cvs mailing list