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).
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user