diff --git a/src/libslic3r/SLAPrintSteps.cpp b/src/libslic3r/SLAPrintSteps.cpp index f781814ae..44ef5fe45 100644 --- a/src/libslic3r/SLAPrintSteps.cpp +++ b/src/libslic3r/SLAPrintSteps.cpp @@ -80,6 +80,13 @@ SLAPrint::Steps::Steps(SLAPrint *print) void SLAPrint::Steps::hollow_model(SLAPrintObject &po) { po.m_hollowing_data.reset(); + bool drilling_needed = ! po.m_model_object->sla_drain_holes.empty(); + + // If the mesh is broken, stop immediately, even before hollowing. + if (drilling_needed && po.transformed_mesh().needed_repair()) + throw std::runtime_error(L("The mesh appears to be too broken " + "to drill holes into it reliably.")); + if (! po.m_config.hollowing_enable.getBool()) BOOST_LOG_TRIVIAL(info) << "Skipping hollowing step!"; else { @@ -104,7 +111,7 @@ void SLAPrint::Steps::hollow_model(SLAPrintObject &po) } // Drill holes into the hollowed/original mesh. - if (po.m_model_object->sla_drain_holes.empty()) + if (! drilling_needed) BOOST_LOG_TRIVIAL(info) << "Drilling skipped (no holes)."; else { BOOST_LOG_TRIVIAL(info) << "Drilling drainage holes."; @@ -116,7 +123,7 @@ void SLAPrint::Steps::hollow_model(SLAPrintObject &po) holes_mesh.merge(sla::to_triangle_mesh(holept.to_mesh())); holes_mesh.require_shared_vertices(); - MeshBoolean::self_union(holes_mesh); //FIXME-fix and use the cgal version + MeshBoolean::self_union(holes_mesh); // If there is no hollowed mesh yet, copy the original mesh. if (! po.m_hollowing_data) { diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index 80695b468..078eda493 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -794,7 +794,7 @@ RENDER_AGAIN: // m_imgui->text(" "); // vertical gap ImGui::Separator(); - float diameter_upper_cap = 5.f; + float diameter_upper_cap = 15.; if (m_new_hole_radius > diameter_upper_cap) m_new_hole_radius = diameter_upper_cap; m_imgui->text(m_desc.at("hole_diameter")); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.hpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.hpp index 617d0b2e6..5745b9393 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.hpp @@ -58,7 +58,7 @@ private: bool m_show_supports = true; float m_new_hole_radius = 2.f; // Size of a new hole. - float m_new_hole_height = 5.f; + float m_new_hole_height = 6.f; mutable std::vector m_selected; // which holes are currently selected bool m_enable_hollowing = true;