mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00: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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user