Automatic SLA support points: Disable debug outputs by default.

This commit is contained in:
bubnikv 2018-12-22 10:55:15 +01:00
parent 126035f6f8
commit 18beb10ae0
2 changed files with 11 additions and 2 deletions

View File

@ -171,7 +171,7 @@ float SLAAutoSupports::distance_limit(float angle) const
return 1./(2.4*get_required_density(angle)); return 1./(2.4*get_required_density(angle));
} }
#ifdef SLA_AUTOSUPPORTS_DEBUG
void SLAAutoSupports::output_expolygons(const ExPolygons& expolys, std::string filename) const void SLAAutoSupports::output_expolygons(const ExPolygons& expolys, std::string filename) const
{ {
BoundingBox bb(Point(-30000000, -30000000), Point(30000000, 30000000)); 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)); 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 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]); 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); 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"); output_expolygons(expolys_top, "top" + layer_num_str + ".svg");
#endif /* SLA_AUTOSUPPORTS_DEBUG */
ExPolygons diff = diff_ex(expolys_top, expolys_bottom); ExPolygons diff = diff_ex(expolys_top, expolys_bottom);
#ifdef SLA_AUTOSUPPORTS_DEBUG
output_expolygons(diff, "diff" + layer_num_str + ".svg"); output_expolygons(diff, "diff" + layer_num_str + ".svg");
#endif /* SLA_AUTOSUPPORTS_DEBUG */
ClosestPointLookupType cpl(SCALED_EPSILON); ClosestPointLookupType cpl(SCALED_EPSILON);
for (const ExPolygon& expol : expolys_top) { 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 NO_ISLAND: ;// continue with next ExPolygon
} }
#ifdef SLA_AUTOSUPPORTS_DEBUG
//if (!islands.empty()) //if (!islands.empty())
// output_expolygons(islands, "islands" + layer_num_str + ".svg"); // output_expolygons(islands, "islands" + layer_num_str + ".svg");
#endif /* SLA_AUTOSUPPORTS_DEBUG */
} }
return islands; return islands;

View File

@ -5,7 +5,7 @@
#include <libslic3r/TriangleMesh.hpp> #include <libslic3r/TriangleMesh.hpp>
#include <libslic3r/SLA/SLASupportTree.hpp> #include <libslic3r/SLA/SLASupportTree.hpp>
// #define SLA_AUTOSUPPORTS_DEBUG
namespace Slic3r { namespace Slic3r {
@ -33,7 +33,9 @@ private:
std::vector<Vec3d> uniformly_cover(const std::pair<ExPolygon, coord_t>& island); std::vector<Vec3d> uniformly_cover(const std::pair<ExPolygon, coord_t>& island);
void project_upward_onto_mesh(std::vector<Vec3d>& points) const; void project_upward_onto_mesh(std::vector<Vec3d>& points) const;
#ifdef SLA_AUTOSUPPORTS_DEBUG
void output_expolygons(const ExPolygons& expolys, std::string filename) const; void output_expolygons(const ExPolygons& expolys, std::string filename) const;
#endif /* SLA_AUTOSUPPORTS_DEBUG */
SLAAutoSupports::Config m_config; SLAAutoSupports::Config m_config;
const Eigen::MatrixXd& m_V; const Eigen::MatrixXd& m_V;