Fixes for the parameter layer

- Elevation value satisfied with no supports as well
- Removed debug svg writing
- Gap and sticks made optional in zero elevation pad.
This commit is contained in:
tamasmeszaros 2019-06-11 18:19:58 +02:00
parent 6877c075dc
commit c80aae1bdb
3 changed files with 21 additions and 17 deletions

View File

@ -9,7 +9,7 @@
// For debugging:
// #include <fstream>
// #include <libnest2d/tools/benchmark.h>
#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.

View File

@ -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)

View File

@ -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();