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:
parent
6877c075dc
commit
c80aae1bdb
3 changed files with 21 additions and 17 deletions
|
@ -9,7 +9,7 @@
|
||||||
// For debugging:
|
// For debugging:
|
||||||
// #include <fstream>
|
// #include <fstream>
|
||||||
// #include <libnest2d/tools/benchmark.h>
|
// #include <libnest2d/tools/benchmark.h>
|
||||||
#include "SVG.hpp"
|
// #include "SVG.hpp"
|
||||||
|
|
||||||
namespace Slic3r { namespace sla {
|
namespace Slic3r { namespace sla {
|
||||||
|
|
||||||
|
@ -390,11 +390,13 @@ void offset_with_breakstick_holes(ExPolygon& poly,
|
||||||
double penetration)
|
double penetration)
|
||||||
{
|
{
|
||||||
// We do the basic offsetting first
|
// We do the basic offsetting first
|
||||||
const bool dont_round_edges = false;
|
static const bool dont_round_edges = false;
|
||||||
|
|
||||||
|
if(padding > 0.0)
|
||||||
offset(poly, coord_t(padding / SCALING_FACTOR), dont_round_edges);
|
offset(poly, coord_t(padding / SCALING_FACTOR), dont_round_edges);
|
||||||
|
|
||||||
SVG svg("bridgestick_plate.svg");
|
// SVG svg("bridgestick_plate.svg");
|
||||||
svg.draw(poly);
|
// svg.draw(poly);
|
||||||
|
|
||||||
auto transf = [stick_width, penetration, padding, stride](Points &pts) {
|
auto transf = [stick_width, penetration, padding, stride](Points &pts) {
|
||||||
// The connector stick will be a small rectangle with dimensions
|
// The connector stick will be a small rectangle with dimensions
|
||||||
|
@ -454,11 +456,13 @@ void offset_with_breakstick_holes(ExPolygon& poly,
|
||||||
pts.swap(out);
|
pts.swap(out);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(stride > 0.0 && stick_width > 0.0 && padding > 0.0) {
|
||||||
transf(poly.contour.points);
|
transf(poly.contour.points);
|
||||||
for (auto &h : poly.holes) transf(h.points);
|
for (auto &h : poly.holes) transf(h.points);
|
||||||
|
}
|
||||||
|
|
||||||
svg.draw(poly);
|
// svg.draw(poly);
|
||||||
svg.Close();
|
// svg.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Only a debug function to generate top and bottom plates from a 2D shape.
|
/// Only a debug function to generate top and bottom plates from a 2D shape.
|
||||||
|
|
|
@ -84,7 +84,7 @@ struct SupportConfig {
|
||||||
|
|
||||||
// The shortest distance between a pillar base perimeter from the model
|
// The shortest distance between a pillar base perimeter from the model
|
||||||
// body. This is only useful when elevation is set to zero.
|
// 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)
|
// Compile time configuration values (candidates for runtime)
|
||||||
|
|
|
@ -595,6 +595,9 @@ sla::SupportConfig make_support_cfg(const SLAPrintObjectConfig& c) {
|
||||||
scfg.pillar_widening_factor = c.support_pillar_widening_factor.getFloat();
|
scfg.pillar_widening_factor = c.support_pillar_widening_factor.getFloat();
|
||||||
scfg.base_radius_mm = 0.5*c.support_base_diameter.getFloat();
|
scfg.base_radius_mm = 0.5*c.support_base_diameter.getFloat();
|
||||||
scfg.base_height_mm = c.support_base_height.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;
|
return scfg;
|
||||||
}
|
}
|
||||||
|
@ -1699,10 +1702,8 @@ bool SLAPrintObject::invalidate_all_steps()
|
||||||
}
|
}
|
||||||
|
|
||||||
double SLAPrintObject::get_elevation() const {
|
double SLAPrintObject::get_elevation() const {
|
||||||
bool se = m_config.supports_enable.getBool();
|
double ret = m_config.support_object_elevation.getFloat();
|
||||||
double ret = se? m_config.support_object_elevation.getFloat() : 0;
|
|
||||||
|
|
||||||
// if the pad is enabled, then half of the pad height is its base plate
|
|
||||||
if(m_config.pad_enable.getBool()) {
|
if(m_config.pad_enable.getBool()) {
|
||||||
// Normally the elevation for the pad itself would be the thickness of
|
// Normally the elevation for the pad itself would be the thickness of
|
||||||
// its walls but currently it is half of its thickness. Whatever it
|
// 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
|
double SLAPrintObject::get_current_elevation() const
|
||||||
{
|
{
|
||||||
bool se = m_config.supports_enable.getBool();
|
|
||||||
bool has_supports = is_step_done(slaposSupportTree);
|
bool has_supports = is_step_done(slaposSupportTree);
|
||||||
bool has_pad = is_step_done(slaposBasePool);
|
bool has_pad = is_step_done(slaposBasePool);
|
||||||
|
|
||||||
if(!has_supports && !has_pad)
|
if(!has_supports && !has_pad)
|
||||||
return 0;
|
return 0;
|
||||||
else if(has_supports && !has_pad) {
|
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();
|
return get_elevation();
|
||||||
|
|
Loading…
Add table
Reference in a new issue