diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index 650dfe2e7..df9990822 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -1466,7 +1466,7 @@ public: m_cfg.head_back_radius_mm, w); - if(t <= w || (hp(Z) + nn(Z) * w) < m_result.ground_level) { + if(t <= w) { // Let's try to optimize this angle, there might be a // viable normal that doesn't collide with the model @@ -1509,7 +1509,7 @@ public: // save the verified and corrected normal m_support_nmls.row(fidx) = nn; - if(t > w && (hp(Z) + nn(Z) * w) > m_result.ground_level) { + if(t > w) { // mark the point for needing a head. m_iheads.emplace_back(fidx); } else if( polar >= 3*PI/4 ) { diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 0e8e717cc..83fa61fdd 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -571,7 +571,24 @@ void swapXY(ExPolygon& expoly) { for(auto& p : expoly.contour.points) std::swap(p(X), p(Y)); for(auto& h : expoly.holes) for(auto& p : h.points) std::swap(p(X), p(Y)); } +} +std::string SLAPrint::validate() const +{ + for(SLAPrintObject * po : m_objects) { + sla::SupportConfig cfg = make_support_cfg(po->config()); + + double pinhead_width = + 2 * cfg.head_front_radius_mm + + cfg.head_width_mm + + 2 * cfg.head_back_radius_mm - + cfg.head_penetration_mm; + + if(pinhead_width > cfg.object_elevation_mm) + return L("Elevetion is too low for object."); + } + + return ""; } std::vector SLAPrint::calculate_heights(const BoundingBoxf3& bb3d, diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index eb927c769..c06e2fc77 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -240,6 +240,8 @@ public: const SLAPrintStatistics& print_statistics() const { return m_print_statistics; } + std::string validate() const override; + private: using SLAPrinter = FilePrinter; using SLAPrinterPtr = std::unique_ptr;