Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Trickey <howard.trickey@gmail.com>2013-07-11 17:29:52 +0400
committerHoward Trickey <howard.trickey@gmail.com>2013-07-11 17:29:52 +0400
commitb2a02555390ece7167523412262e417d70cdec3c (patch)
tree5e39265b3bbd3c46af18e40d535c2843786b756d /source/blender/bmesh
parent48c8d99cd9eac0935ff73af21d3c33d1ec59f7ad (diff)
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).
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index e0c11414e38..6431b6b7cf5 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -1941,26 +1941,35 @@ static void bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v)
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 */