Triangle trimming should handle drilled meshes separately

This commit is contained in:
tamasmeszaros 2021-03-02 18:25:24 +01:00
parent 1ec154012e
commit 4374716bfb

View file

@ -169,10 +169,10 @@ void SLAPrint::Steps::drill_holes(SLAPrintObject &po)
sla::hollow_mesh(hollowed_mesh, *po.m_hollowing_data->interior); sla::hollow_mesh(hollowed_mesh, *po.m_hollowing_data->interior);
TriangleMesh &mesh_view = po.m_hollowing_data->hollow_mesh_with_holes_trimmed; TriangleMesh &mesh_view = po.m_hollowing_data->hollow_mesh_with_holes_trimmed;
mesh_view = po.transformed_mesh();
sla::hollow_mesh(mesh_view, *po.m_hollowing_data->interior, sla::hfRemoveInsideTriangles);
if (! needs_drilling) { if (! needs_drilling) {
mesh_view = po.transformed_mesh();
sla::hollow_mesh(mesh_view, *po.m_hollowing_data->interior, sla::hfRemoveInsideTriangles);
BOOST_LOG_TRIVIAL(info) << "Drilling skipped (no holes)."; BOOST_LOG_TRIVIAL(info) << "Drilling skipped (no holes).";
return; return;
} }
@ -200,6 +200,9 @@ void SLAPrint::Steps::drill_holes(SLAPrintObject &po)
try { try {
MeshBoolean::cgal::minus(*hollowed_mesh_cgal, *holes_mesh_cgal); MeshBoolean::cgal::minus(*hollowed_mesh_cgal, *holes_mesh_cgal);
hollowed_mesh = MeshBoolean::cgal::cgal_to_triangle_mesh(*hollowed_mesh_cgal); hollowed_mesh = MeshBoolean::cgal::cgal_to_triangle_mesh(*hollowed_mesh_cgal);
mesh_view = hollowed_mesh;
sla::remove_inside_triangles(mesh_view, *po.m_hollowing_data->interior);
} catch (const std::runtime_error &) { } catch (const std::runtime_error &) {
throw Slic3r::SlicingError(L( throw Slic3r::SlicingError(L(
"Drilling holes into the mesh failed. " "Drilling holes into the mesh failed. "