[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45733] trunk/blender/source/blender/bmesh : fix error in last commit.

Campbell Barton ideasman42 at gmail.com
Wed Apr 18 08:36:47 CEST 2012


Revision: 45733
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45733
Author:   campbellbarton
Date:     2012-04-18 06:36:47 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
fix error in last commit. Misunderstood BM_vert_is_manifold(), added some comments.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/intern/bmesh_queries.c
    trunk/blender/source/blender/bmesh/tools/BME_bevel.c

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_queries.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_queries.c	2012-04-18 06:14:51 UTC (rev 45732)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_queries.c	2012-04-18 06:36:47 UTC (rev 45733)
@@ -470,10 +470,10 @@
 
 /**
  * A vertex is non-manifold if it meets the following conditions:
- * 1: Loose - (has no edges/faces incident upon it)
- * 2: Joins two distinct regions - (two pyramids joined at the tip)
- * 3: Is part of a non-manifold edge (edge with more than 2 faces)
- * 4: Is part of a wire edge
+ * 1: Loose - (has no edges/faces incident upon it).
+ * 2: Joins two distinct regions - (two pyramids joined at the tip).
+ * 3: Is part of a an edge with more than 2 faces.
+ * 4: Is part of a wire edge.
  */
 int BM_vert_is_manifold(BMVert *v)
 {
@@ -487,19 +487,18 @@
 	}
 
 	/* count edges while looking for non-manifold edges */
-	oe = v->e;
-	for (len = 0, e = v->e; e != oe || (e == oe && len == 0); len++, e = bmesh_disk_edge_next(e, v)) {
-		if (e->l == NULL) {
-			/* loose edge */
+	len = 0;
+	oe = e = v->e;
+	do {
+		/* loose edge or edge shared by more than two faces,
+		 * edges with 1 face user are OK, otherwise we could
+		 * use BM_edge_is_manifold() here */
+		if (e->l == NULL || bmesh_radial_length(e->l) > 2) {
 			return FALSE;
 		}
+		len++;
+	} while((e = bmesh_disk_edge_next(e, v)) != oe);
 
-		if (bmesh_radial_length(e->l) > 2) {
-			/* edge shared by more than two faces */
-			return FALSE;
-		}
-	}
-
 	count = 1;
 	flag = 1;
 	e = NULL;

Modified: trunk/blender/source/blender/bmesh/tools/BME_bevel.c
===================================================================
--- trunk/blender/source/blender/bmesh/tools/BME_bevel.c	2012-04-18 06:14:51 UTC (rev 45732)
+++ trunk/blender/source/blender/bmesh/tools/BME_bevel.c	2012-04-18 06:36:47 UTC (rev 45733)
@@ -148,6 +148,7 @@
  * The drawback, though, is that this code doesn't merge customdata. */
 static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
 {
+	BMIter iter;
 	BMEdge *e, *elast;
 	BMLoop *l1, *l2;
 
@@ -155,6 +156,13 @@
 		return 0;
 	}
 
+	/* hrmf, we could have a version of BM_vert_is_manifold() which checks for this case */
+	BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) {
+		if (BM_edge_face_count(e) != 2) {
+			return 0;
+		}
+	}
+
 	if (BM_vert_edge_count(v) > 2) {
 		while (BM_vert_edge_count(v) > 2) {
 			e = v->e;




More information about the Bf-blender-cvs mailing list