Fix 30562: bevel was infinite looping when adjacent faces had incompatible normals
The fix is to check for cases where BME_Bevel_Dissolve_Disk was trying to join faces with opposite normals and reverse one. This isn't a great fix, and the example blend has strange corners at the top after beveling, but at least it stops the infinite loops.
This commit is contained in:
@@ -166,7 +166,18 @@ static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
|
|||||||
e = v->e;
|
e = v->e;
|
||||||
l1 = e->l;
|
l1 = e->l;
|
||||||
l2 = l1->radial_next;
|
l2 = l1->radial_next;
|
||||||
bmesh_jfke(bm, l1->f, l2->f, e);
|
if (l1->v == l2->v) {
|
||||||
|
/* faces have incompatible directions; need to reverse one */
|
||||||
|
if (!bmesh_loop_reverse(bm, l2->f)) {
|
||||||
|
BLI_assert(!"bevel dissolve disk cannot reverse loop");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
l2 = l1->radial_next;
|
||||||
|
}
|
||||||
|
if (!bmesh_jfke(bm, l1->f, l2->f, e)) {
|
||||||
|
BLI_assert(!"bevel dissolve disk cannot join faces");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e = v->e;
|
e = v->e;
|
||||||
@@ -178,6 +189,14 @@ static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
|
|||||||
|
|
||||||
l1 = elast->l;
|
l1 = elast->l;
|
||||||
l2 = l1->radial_next;
|
l2 = l1->radial_next;
|
||||||
|
if (l1->v == l2->v) {
|
||||||
|
/* faces have incompatible directions */
|
||||||
|
if (!bmesh_loop_reverse(bm, l2->f)) {
|
||||||
|
BLI_assert(!"bevel dissolve disk cannot reverse loop");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
l2 = l1->radial_next;
|
||||||
|
}
|
||||||
bmesh_jfke(bm, l1->f, l2->f, elast);
|
bmesh_jfke(bm, l1->f, l2->f, elast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user