Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2019-10-07 19:09:38 +0300
committerSebastian Parborg <darkdefende@gmail.com>2019-10-07 19:14:30 +0300
commitfc9e921495312ace23af11a69e738a8a7adbaeed (patch)
tree72b90a1d29a72844460aa2f9d34b09bbbda94e72 /source/blender/editors/object/object_remesh.c
parent0c0d2f3581de6e4d153250933e2aa6b552d8c36b (diff)
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.
Diffstat (limited to 'source/blender/editors/object/object_remesh.c')
-rw-r--r--source/blender/editors/object/object_remesh.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c
index 86d41056634..a395a7013fe 100644
--- a/source/blender/editors/object/object_remesh.c
+++ b/source/blender/editors/object/object_remesh.c
@@ -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,25 +227,21 @@ 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];
- edge_faces[loop->e] += 1;
- if (edge_faces[loop->e] > 2) {
- is_manifold_consistent = false;
- break;
- }
+ 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;
+ break;
+ }
- if (edge_vert[loop->e] == -1) {
- edge_vert[loop->e] = loop->v;
- }
- else if (edge_vert[loop->e] == loop->v) {
- /* Mesh has flips in the surface so it is non consistent */
- is_manifold_consistent = false;
- break;
- }
+ if (edge_vert[loop->e] == -1) {
+ edge_vert[loop->e] = loop->v;
+ }
+ else if (edge_vert[loop->e] == loop->v) {
+ /* Mesh has flips in the surface so it is non consistent */
+ is_manifold_consistent = false;
+ break;
}
}