Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2019-03-18 17:31:47 +0300
committertamasmeszaros <meszaros.q@gmail.com>2019-03-18 17:31:47 +0300
commitcd2cccec5f2ff20fa06b8f66472656671032c616 (patch)
treecbe570de5e23a5b28a7c470d0e695c273e6aa267 /src
parentf249155340c0ca8ecc923527142f57049e2b9d46 (diff)
Adding validation code for support parameters (elevation)
Diffstat (limited to 'src')
-rw-r--r--src/libslic3r/SLA/SLASupportTree.cpp4
-rw-r--r--src/libslic3r/SLAPrint.cpp17
-rw-r--r--src/libslic3r/SLAPrint.hpp2
3 files changed, 21 insertions, 2 deletions
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<float> 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<FilePrinterFormat::SLA_PNGZIP>;
using SLAPrinterPtr = std::unique_ptr<SLAPrinter>;