Simplify the quadriflow manifold mesh function for loops

No need to iterate over all polygons if we just want to iterate over all
face loops anyways.
This commit is contained in:
Sebastian Parborg
2019-10-07 18:09:38 +02:00
parent 0c0d2f3581
commit fc9e921495

View File

@@ -219,7 +219,6 @@ static bool mesh_is_manifold_consistent(Mesh *mesh)
bool is_manifold_consistent = true;
const MLoop *mloop = mesh->mloop;
const MPoly *mpoly = mesh->mpoly;
char *edge_faces = (char *)MEM_callocN(mesh->totedge * sizeof(char), "remesh_manifold_check");
int *edge_vert = (int *)MEM_malloc_arrayN(
mesh->totedge, sizeof(unsigned int), "remesh_consistent_check");
@@ -228,11 +227,8 @@ static bool mesh_is_manifold_consistent(Mesh *mesh)
edge_vert[i] = -1;
}
for (unsigned int poly_index = 0; poly_index < mesh->totpoly && is_manifold_consistent;
poly_index++) {
const MPoly *poly = &mpoly[poly_index];
for (unsigned int corner = 0; corner < poly->totloop; corner++) {
const MLoop *loop = &mloop[poly->loopstart + corner];
for (unsigned int loop_idx = 0; loop_idx < mesh->totloop; loop_idx++) {
const MLoop *loop = &mloop[loop_idx];
edge_faces[loop->e] += 1;
if (edge_faces[loop->e] > 2) {
is_manifold_consistent = false;
@@ -248,7 +244,6 @@ static bool mesh_is_manifold_consistent(Mesh *mesh)
break;
}
}
}
if (is_manifold_consistent) {
/* check for wire edges */