mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
FIX: mesh boolean may take forever with CGAL
Only use MCut to do boolean, with a little modification to allow input mesh to have multiple components. Jira: STUDIO-3167 Change-Id: I4f53010f76fbcacfe966c2ef48e465f97d6516fe (cherry picked from commit 92d0eb11744820466ee2f67c02d4764e496b7e60)
This commit is contained in:
parent
fe7a96ef15
commit
fcda0e5f2c
3 changed files with 117 additions and 11 deletions
|
@ -9988,14 +9988,11 @@ TriangleMesh Plater::combine_mesh_fff(const ModelObject& mo, int instance_id, st
|
|||
|
||||
if (csg::check_csgmesh_booleans(Range{ std::begin(csgmesh), std::end(csgmesh) }) == csgmesh.end()) {
|
||||
try {
|
||||
// mcut can't handle splitable positive volumes
|
||||
if (!has_splitable_volume) {
|
||||
MeshBoolean::mcut::McutMeshPtr meshPtr = csg::perform_csgmesh_booleans_mcut(Range{ std::begin(csgmesh), std::end(csgmesh) });
|
||||
mesh = MeshBoolean::mcut::mcut_to_triangle_mesh(*meshPtr);
|
||||
}
|
||||
MeshBoolean::mcut::McutMeshPtr meshPtr = csg::perform_csgmesh_booleans_mcut(Range{ std::begin(csgmesh), std::end(csgmesh) });
|
||||
mesh = MeshBoolean::mcut::mcut_to_triangle_mesh(*meshPtr);
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
#if 0
|
||||
// if mcut fails, try again with CGAL
|
||||
if (mesh.empty()) {
|
||||
try {
|
||||
|
@ -10004,6 +10001,7 @@ TriangleMesh Plater::combine_mesh_fff(const ModelObject& mo, int instance_id, st
|
|||
}
|
||||
catch (...) {}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (mesh.empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue