Mirror pad_around_object for 'Pad' page on 'Supports' page

This commit is contained in:
tamasmeszaros 2019-08-28 11:32:49 +02:00
parent 19f6d87689
commit c2b9980488
7 changed files with 30 additions and 25 deletions

View file

@ -2640,8 +2640,7 @@ void PrintConfigDef::init_sla_params()
def->label = L("Object elevation");
def->category = L("Supports");
def->tooltip = L("How much the supports should lift up the supported object. "
"If this value is zero, the bottom of the model geometry "
"will be considered as part of the pad.");
"If \"Pad around object\" is enabled, this value is ignored.");
def->sidetext = L("mm");
def->min = 0;
def->max = 150; // This is the max height of print on SL1
@ -2728,7 +2727,7 @@ void PrintConfigDef::init_sla_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(45.0));
def = this->add("pad_zero_elevation", coBool);
def = this->add("pad_around_object", coBool);
def->label = L("Pad around object");
def->category = L("Pad");
def->tooltip = L("Create pad around object and ignore the support elevation");

View file

@ -1042,7 +1042,7 @@ public:
// /////////////////////////////////////////////////////////////////////////
// Disable the elevation (ignore its value) and use the zero elevation mode
ConfigOptionBool pad_zero_elevation;
ConfigOptionBool pad_around_object;
// This is the gap between the object bottom and the generated pad
ConfigOptionFloat pad_object_gap;
@ -1085,7 +1085,7 @@ protected:
OPT_PTR(pad_max_merge_distance);
// OPT_PTR(pad_edge_radius);
OPT_PTR(pad_wall_slope);
OPT_PTR(pad_zero_elevation);
OPT_PTR(pad_around_object);
OPT_PTR(pad_object_gap);
OPT_PTR(pad_object_connector_stride);
OPT_PTR(pad_object_connector_width);

View file

@ -577,12 +577,7 @@ std::string SLAPrint::output_filename(const std::string &filename_base) const
namespace {
bool is_zero_elevation(const SLAPrintObjectConfig &c) {
bool en_implicit = c.support_object_elevation.getFloat() <= EPSILON &&
c.pad_enable.getBool() && c.supports_enable.getBool();
bool en_explicit = c.pad_zero_elevation.getBool() &&
c.supports_enable.getBool();
return en_implicit || en_explicit;
return c.pad_enable.getBool() && c.pad_around_object.getBool();
}
// Compile the argument for support creation from the static print config.
@ -676,12 +671,13 @@ std::string SLAPrint::validate() const
double elv = cfg.object_elevation_mm;
if(supports_en && elv > EPSILON && elv < pinhead_width )
sla::PoolConfig::EmbedObject builtinpad = builtin_pad_cfg(po->config());
if(supports_en && !builtinpad.enabled && elv < pinhead_width )
return L(
"Elevation is too low for object. Use the \"Pad around "
"obect\" feature to print the object without elevation.");
sla::PoolConfig::EmbedObject builtinpad = builtin_pad_cfg(po->config());
if(supports_en && builtinpad.enabled &&
cfg.pillar_base_safety_distance_mm < builtinpad.object_gap_mm) {
return L(
@ -1698,7 +1694,7 @@ bool SLAPrintObject::invalidate_state_by_config_options(const std::vector<t_conf
|| opt_key == "pad_wall_thickness"
|| opt_key == "supports_enable"
|| opt_key == "support_object_elevation"
|| opt_key == "pad_zero_elevation"
|| opt_key == "pad_around_object"
|| opt_key == "slice_closing_radius") {
steps.emplace_back(slaposObjectSlice);
} else if (