diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2020-11-16 04:26:14 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2020-11-16 04:26:14 +0300 |
commit | 52a189936b697164db7349fdc1de017108f0a9eb (patch) | |
tree | e643d5bcdae50c84fb7eb7d6c38ace3153d42808 /source/blender/blenlib/intern/mesh_boolean.cc | |
parent | 194a57fd631f755a1a443ff0ccd7c7d9c066d394 (diff) | |
parent | fbffff26e437ad87b644762b340dcddc7ddf16ab (diff) |
Merge branch 'blender-v2.91-release'
Bring in exact boolean fix.
Diffstat (limited to 'source/blender/blenlib/intern/mesh_boolean.cc')
-rw-r--r-- | source/blender/blenlib/intern/mesh_boolean.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/mesh_boolean.cc b/source/blender/blenlib/intern/mesh_boolean.cc index 4ff5afdb05f..bac1b0665c8 100644 --- a/source/blender/blenlib/intern/mesh_boolean.cc +++ b/source/blender/blenlib/intern/mesh_boolean.cc @@ -751,7 +751,7 @@ static PatchesInfo find_patches(const IMesh &tm, const TriMeshTopology &tmtopo) if (dbg_level > 1) { std::cout << "\ntriangle map\n"; for (int t : tm.face_index_range()) { - std::cout << t << ": patch " << pinfo.tri_patch(t) << "\n"; + std::cout << t << ": " << tm.face(t) << " patch " << pinfo.tri_patch(t) << "\n"; } } std::cout << "\npatch-patch incidences\n"; @@ -3135,6 +3135,7 @@ static void dissolve_verts(IMesh *imesh, const Array<bool> dissolve, IMeshArena { constexpr int inline_face_size = 100; Vector<bool, inline_face_size> face_pos_erase; + bool any_faces_erased = false; for (int f : imesh->face_index_range()) { const Face &face = *imesh->face(f); face_pos_erase.clear(); @@ -3151,10 +3152,13 @@ static void dissolve_verts(IMesh *imesh, const Array<bool> dissolve, IMeshArena } } if (num_erase > 0) { - imesh->erase_face_positions(f, face_pos_erase, arena); + any_faces_erased |= imesh->erase_face_positions(f, face_pos_erase, arena); } } imesh->set_dirty_verts(); + if (any_faces_erased) { + imesh->remove_null_faces(); + } } /** @@ -3376,6 +3380,10 @@ IMesh boolean_mesh(IMesh &imesh, IMesh ans = polymesh_from_trimesh_with_dissolve(tm_out, imesh, arena); if (dbg_level > 0) { std::cout << "boolean_mesh output:\n" << ans; + if (dbg_level > 2) { + ans.populate_vert(); + dump_test_spec(ans); + } } return ans; } |