diff --git a/src/libslic3r/SLA/SLABasePool.cpp b/src/libslic3r/SLA/SLABasePool.cpp index a882769f6..62a078cb7 100644 --- a/src/libslic3r/SLA/SLABasePool.cpp +++ b/src/libslic3r/SLA/SLABasePool.cpp @@ -9,7 +9,7 @@ // For debugging: // #include // #include -#include "SVG.hpp" +// #include "SVG.hpp" namespace Slic3r { namespace sla { @@ -390,11 +390,13 @@ void offset_with_breakstick_holes(ExPolygon& poly, double penetration) { // We do the basic offsetting first - const bool dont_round_edges = false; - offset(poly, coord_t(padding / SCALING_FACTOR), dont_round_edges); + static const bool dont_round_edges = false; + + if(padding > 0.0) + offset(poly, coord_t(padding / SCALING_FACTOR), dont_round_edges); - SVG svg("bridgestick_plate.svg"); - svg.draw(poly); + // SVG svg("bridgestick_plate.svg"); + // svg.draw(poly); auto transf = [stick_width, penetration, padding, stride](Points &pts) { // The connector stick will be a small rectangle with dimensions @@ -453,12 +455,14 @@ void offset_with_breakstick_holes(ExPolygon& poly, out.shrink_to_fit(); pts.swap(out); }; - - transf(poly.contour.points); - for (auto &h : poly.holes) transf(h.points); - svg.draw(poly); - svg.Close(); + if(stride > 0.0 && stick_width > 0.0 && padding > 0.0) { + transf(poly.contour.points); + for (auto &h : poly.holes) transf(h.points); + } + + // svg.draw(poly); + // svg.Close(); } /// Only a debug function to generate top and bottom plates from a 2D shape. diff --git a/src/libslic3r/SLA/SLASupportTree.hpp b/src/libslic3r/SLA/SLASupportTree.hpp index 93627d10c..8602d8a46 100644 --- a/src/libslic3r/SLA/SLASupportTree.hpp +++ b/src/libslic3r/SLA/SLASupportTree.hpp @@ -84,7 +84,7 @@ struct SupportConfig { // The shortest distance between a pillar base perimeter from the model // body. This is only useful when elevation is set to zero. - const double pillar_base_safety_distance_mm = 0.5; + double pillar_base_safety_distance_mm = 0.5; // ///////////////////////////////////////////////////////////////////////// // Compile time configuration values (candidates for runtime) diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 14cf2b6ff..78bd50220 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -595,7 +595,10 @@ sla::SupportConfig make_support_cfg(const SLAPrintObjectConfig& c) { scfg.pillar_widening_factor = c.support_pillar_widening_factor.getFloat(); scfg.base_radius_mm = 0.5*c.support_base_diameter.getFloat(); scfg.base_height_mm = c.support_base_height.getFloat(); - + scfg.pillar_base_safety_distance_mm = + c.support_base_safety_distance.getFloat() < EPSILON ? + scfg.safety_distance_mm : c.support_base_safety_distance.getFloat(); + return scfg; } @@ -1699,10 +1702,8 @@ bool SLAPrintObject::invalidate_all_steps() } double SLAPrintObject::get_elevation() const { - bool se = m_config.supports_enable.getBool(); - double ret = se? m_config.support_object_elevation.getFloat() : 0; + double ret = m_config.support_object_elevation.getFloat(); - // if the pad is enabled, then half of the pad height is its base plate if(m_config.pad_enable.getBool()) { // Normally the elevation for the pad itself would be the thickness of // its walls but currently it is half of its thickness. Whatever it @@ -1717,14 +1718,13 @@ double SLAPrintObject::get_elevation() const { double SLAPrintObject::get_current_elevation() const { - bool se = m_config.supports_enable.getBool(); bool has_supports = is_step_done(slaposSupportTree); bool has_pad = is_step_done(slaposBasePool); if(!has_supports && !has_pad) return 0; else if(has_supports && !has_pad) { - return se ? m_config.support_object_elevation.getFloat() : 0; + return m_config.support_object_elevation.getFloat(); } return get_elevation();