Handle CGAL exceptions and add tests for mesh boolean operations

Add conversion to exact predicates exact construction kernel format for consecutive booleans (experiments)
This commit is contained in:
tamasmeszaros 2020-02-05 17:39:56 +01:00
parent 6f777264a1
commit bd76c345f2
6 changed files with 231 additions and 128 deletions

View file

@ -143,11 +143,13 @@ void SLAPrint::Steps::drill_holes(SLAPrintObject &po)
holes_mesh.merge(sla::to_triangle_mesh(holept.to_mesh()));
holes_mesh.require_shared_vertices();
MeshBoolean::self_union(holes_mesh);
if (!holes_mesh.is_manifold() || MeshBoolean::cgal::does_self_intersect(holes_mesh)) {
MeshBoolean::self_union(holes_mesh);
}
try {
MeshBoolean::cgal::minus(hollowed_mesh, holes_mesh);
} catch (const std::runtime_error&) {
} catch (const std::runtime_error &) {
throw std::runtime_error(L(
"Drilling holes into the mesh failed. "
"This is usually caused by broken model. Try to fix it first."));