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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2018-12-22 12:55:15 +0300
committerbubnikv <bubnikv@gmail.com>2018-12-22 12:55:15 +0300
commit18beb10ae0b7040b4c97b003674f465dadffda4d (patch)
tree15638d1e93833f466dfbca8541e741ed1cc795ca
parent126035f6f8f2a95784dfeac4afd339ea07e9f4f9 (diff)
Automatic SLA support points: Disable debug outputs by default.
-rw-r--r--src/libslic3r/SLA/SLAAutoSupports.cpp9
-rw-r--r--src/libslic3r/SLA/SLAAutoSupports.hpp4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/libslic3r/SLA/SLAAutoSupports.cpp b/src/libslic3r/SLA/SLAAutoSupports.cpp
index 5011c485b..8f8d5673a 100644
--- a/src/libslic3r/SLA/SLAAutoSupports.cpp
+++ b/src/libslic3r/SLA/SLAAutoSupports.cpp
@@ -171,7 +171,7 @@ float SLAAutoSupports::distance_limit(float angle) const
return 1./(2.4*get_required_density(angle));
}
-
+#ifdef SLA_AUTOSUPPORTS_DEBUG
void SLAAutoSupports::output_expolygons(const ExPolygons& expolys, std::string filename) const
{
BoundingBox bb(Point(-30000000, -30000000), Point(30000000, 30000000));
@@ -188,6 +188,7 @@ void SLAAutoSupports::output_expolygons(const ExPolygons& expolys, std::string f
svg_cummulative.draw_outline(expolys[i].holes, "blue", scale_(0.05));
}
}
+#endif /* SLA_AUTOSUPPORTS_DEBUG */
std::vector<std::pair<ExPolygon, coord_t>> SLAAutoSupports::find_islands(const std::vector<ExPolygons>& slices, const std::vector<float>& heights) const
{
@@ -203,10 +204,14 @@ std::vector<std::pair<ExPolygon, coord_t>> SLAAutoSupports::find_islands(const s
const ExPolygons& expolys_bottom = (i == 0 ? ExPolygons() : slices[i-1]);
std::string layer_num_str = std::string((i<10 ? "0" : "")) + std::string((i<100 ? "0" : "")) + std::to_string(i);
+#ifdef SLA_AUTOSUPPORTS_DEBUG
output_expolygons(expolys_top, "top" + layer_num_str + ".svg");
+#endif /* SLA_AUTOSUPPORTS_DEBUG */
ExPolygons diff = diff_ex(expolys_top, expolys_bottom);
+#ifdef SLA_AUTOSUPPORTS_DEBUG
output_expolygons(diff, "diff" + layer_num_str + ".svg");
+#endif /* SLA_AUTOSUPPORTS_DEBUG */
ClosestPointLookupType cpl(SCALED_EPSILON);
for (const ExPolygon& expol : expolys_top) {
@@ -240,8 +245,10 @@ std::vector<std::pair<ExPolygon, coord_t>> SLAAutoSupports::find_islands(const s
NO_ISLAND: ;// continue with next ExPolygon
}
+#ifdef SLA_AUTOSUPPORTS_DEBUG
//if (!islands.empty())
// output_expolygons(islands, "islands" + layer_num_str + ".svg");
+#endif /* SLA_AUTOSUPPORTS_DEBUG */
}
return islands;
diff --git a/src/libslic3r/SLA/SLAAutoSupports.hpp b/src/libslic3r/SLA/SLAAutoSupports.hpp
index 568c200d0..08dc45236 100644
--- a/src/libslic3r/SLA/SLAAutoSupports.hpp
+++ b/src/libslic3r/SLA/SLAAutoSupports.hpp
@@ -5,7 +5,7 @@
#include <libslic3r/TriangleMesh.hpp>
#include <libslic3r/SLA/SLASupportTree.hpp>
-
+// #define SLA_AUTOSUPPORTS_DEBUG
namespace Slic3r {
@@ -33,7 +33,9 @@ private:
std::vector<Vec3d> uniformly_cover(const std::pair<ExPolygon, coord_t>& island);
void project_upward_onto_mesh(std::vector<Vec3d>& points) const;
+#ifdef SLA_AUTOSUPPORTS_DEBUG
void output_expolygons(const ExPolygons& expolys, std::string filename) const;
+#endif /* SLA_AUTOSUPPORTS_DEBUG */
SLAAutoSupports::Config m_config;
const Eigen::MatrixXd& m_V;