[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58176] trunk/blender/source/blender/bmesh /tools/bmesh_bevel.c: Fix bevel when there is a gap in faces around vertex.

Howard Trickey howard.trickey at gmail.com
Thu Jul 11 15:29:53 CEST 2013


Revision: 58176
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58176
Author:   howardt
Date:     2013-07-11 13:29:52 +0000 (Thu, 11 Jul 2013)
Log Message:
-----------
Fix bevel when there is a gap in faces around vertex.
Fixes bug #35927 (Vertex Bevel bug) but even edge
bevel didn't work on the example there. Problem
was with forming the proper ccw ordering of edges
around the bevel.
Also appears to fix bug #35582 (Bevel, weird results).

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c

Modified: trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c
===================================================================
--- trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c	2013-07-11 12:43:34 UTC (rev 58175)
+++ trunk/blender/source/blender/bmesh/tools/bmesh_bevel.c	2013-07-11 13:29:52 UTC (rev 58176)
@@ -1941,26 +1941,35 @@
 	int i, found_shared_face, ccw_test_sum;
 	int nsel = 0;
 	int ntot = 0;
+	int fcnt;
 
 	/* Gather input selected edges.
 	 * Only bevel selected edges that have exactly two incident faces.
+	 * Want edges to be ordered so that they share faces.
+	 * There may be one or more chains of shared faces broken by
+	 * gaps where there are no faces.
+	 * TODO: make following work when more than one gap.
 	 */
 
-	if (bp->vertex_only)
-		first_bme = v->e;
-	else
-		first_bme = NULL;
+	first_bme = NULL;
 	BM_ITER_ELEM (bme, &iter, v, BM_EDGES_OF_VERT) {
+		fcnt = BM_edge_face_count(bme);
 		if (BM_elem_flag_test(bme, BM_ELEM_TAG) && !bp->vertex_only) {
-			BLI_assert(BM_edge_is_manifold(bme));
+			BLI_assert(fcnt == 2);
 			nsel++;
 			if (!first_bme)
 				first_bme = bme;
 		}
+		if (fcnt == 1) {
+			/* good to start face chain from this edge */
+			first_bme = bme;
+		}
 		ntot++;
 
 		BM_BEVEL_EDGE_TAG_DISABLE(bme);
 	}
+	if (!first_bme)
+		first_bme = v->e;
 
 	if ((nsel == 0 && !bp->vertex_only) || (ntot < 3 && bp->vertex_only)) {
 		/* signal this vert isn't being beveled */




More information about the Bf-blender-cvs mailing list