Fix T92355: Quadriflow crashes with zero length edges

Add a check for zero length edges to the manifold check as quadriflow
doesn't handle meshes with these.
This commit is contained in:
Sebastian Parborg 2021-10-21 15:13:55 +02:00 committed by Philipp Oeser
parent 28d581af92
commit 77104bf318
Notes: blender-bot 2023-02-14 06:17:14 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #92355, Remesh-bug.crash
1 changed files with 8 additions and 1 deletions

View File

@ -699,12 +699,19 @@ static bool mesh_is_manifold_consistent(Mesh *mesh)
}
if (is_manifold_consistent) {
/* check for wire edges */
for (uint i = 0; i < mesh->totedge; i++) {
/* Check for wire edges. */
if (edge_faces[i] == 0) {
is_manifold_consistent = false;
break;
}
/* Check for zero length edges */
MVert *v1 = &mesh->mvert[mesh->medge[i].v1];
MVert *v2 = &mesh->mvert[mesh->medge[i].v2];
if (compare_v3v3(v1->co, v2->co, 1e-4f)) {
is_manifold_consistent = false;
break;
}
}
}