Fix T50003, Bevel makes non-manifold mesh.
Problem was setting prev/next faces for edges around a vertex on valence-2 vertices.
This commit is contained in:
@@ -3557,7 +3557,7 @@ static void find_bevel_edge_order(BMesh *bm, BevVert *bv, BMEdge *first_bme)
|
|||||||
{
|
{
|
||||||
BMEdge *bme, *bme2;
|
BMEdge *bme, *bme2;
|
||||||
BMIter iter;
|
BMIter iter;
|
||||||
BMFace *f;
|
BMFace *f, *bestf;
|
||||||
EdgeHalf *e;
|
EdgeHalf *e;
|
||||||
EdgeHalf *e2;
|
EdgeHalf *e2;
|
||||||
BMLoop *l;
|
BMLoop *l;
|
||||||
@@ -3595,10 +3595,21 @@ static void find_bevel_edge_order(BMesh *bm, BevVert *bv, BMEdge *first_bme)
|
|||||||
bme = e->e;
|
bme = e->e;
|
||||||
bme2 = e2->e;
|
bme2 = e2->e;
|
||||||
BLI_assert(bme != NULL);
|
BLI_assert(bme != NULL);
|
||||||
|
if (e->fnext != NULL || e2->fprev != NULL)
|
||||||
|
continue;
|
||||||
|
/* Which faces have successive loops that are for bme and bme2?
|
||||||
|
* There could be more than one. E.g., in manifold ntot==2 case.
|
||||||
|
* Prefer one that has loop in same direction as e. */
|
||||||
|
bestf = NULL;
|
||||||
BM_ITER_ELEM(l, &iter, bme, BM_LOOPS_OF_EDGE) {
|
BM_ITER_ELEM(l, &iter, bme, BM_LOOPS_OF_EDGE) {
|
||||||
f = l->f;
|
f = l->f;
|
||||||
if ((l->prev->e == bme2 || l->next->e == bme2) && !e->fnext && !e2->fprev)
|
if ((l->prev->e == bme2 || l->next->e == bme2)) {
|
||||||
e->fnext = e2->fprev = f;
|
if (!bestf || l->v == bv->v)
|
||||||
|
bestf = f;
|
||||||
|
}
|
||||||
|
if (bestf) {
|
||||||
|
e->fnext = e2->fprev = bestf;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user