Added max-support-layers (support_material_max_layers) (#4148)

* Added max-support-layers (support_material_max_layers)
* Revised tooltip text for support_material_max_layers
* Disable support_material_max_layers if no support.
This commit is contained in:
Jaggz H 2018-04-14 12:28:55 -07:00 committed by Joseph Lenox
parent df993c5020
commit a46aa09755
4 changed files with 20 additions and 1 deletions

View File

@ -456,7 +456,7 @@ sub options {
first_layer_acceleration default_acceleration
skirts skirt_distance skirt_height min_skirt_length
brim_connections_width brim_width interior_brim_width
support_material support_material_threshold support_material_enforce_layers
support_material support_material_threshold support_material_max_layers support_material_enforce_layers
raft_layers
support_material_pattern support_material_spacing support_material_angle
support_material_interface_layers support_material_interface_spacing
@ -600,6 +600,7 @@ sub build {
my $optgroup = $page->new_optgroup('Support material');
$optgroup->append_single_option_line('support_material');
$optgroup->append_single_option_line('support_material_threshold');
$optgroup->append_single_option_line('support_material_max_layers');
$optgroup->append_single_option_line('support_material_enforce_layers');
}
{
@ -926,6 +927,10 @@ sub _update {
support_material_interface_layers dont_support_bridges
support_material_extrusion_width support_material_interface_extrusion_width
support_material_contact_distance);
# Disable features that need support to be enabled.
$self->get_field($_)->toggle($config->support_material)
for qw(support_material_max_layers);
$self->get_field($_)->toggle($have_support_material && $have_support_interface)
for qw(support_material_interface_spacing support_material_interface_extruder

View File

@ -133,6 +133,8 @@ sub contact_area {
last;
}
my $layer = $object->get_layer($layer_id);
last if $conf->support_material_max_layers
&& $layer_id > $conf->support_material_max_layers;
if ($buildplate_only) {
# Collect the top surfaces up to this layer and merge them.

View File

@ -1394,6 +1394,16 @@ PrintConfigDef::PrintConfigDef()
def->enum_labels.push_back("0.2 (detachable)");
def->default_value = new ConfigOptionFloat(0.2);
def = this->add("support_material_max_layers", coInt);
def->label = "Max layer count for supports";
def->category = "Support material";
def->tooltip = "Disable support generation above this layer. Setting this to 0 will disable this feature.";
def->sidetext = "layers";
def->cli = "support-material-max-layers=f";
def->full_label = "Maximum layer count for support generation";
def->min = 0;
def->default_value = new ConfigOptionInt(0);
def = this->add("support_material_enforce_layers", coInt);
def->label = "Enforce support for the first";
def->category = "Support material";

View File

@ -171,6 +171,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig
ConfigOptionInt support_material_angle;
ConfigOptionBool support_material_buildplate_only;
ConfigOptionFloat support_material_contact_distance;
ConfigOptionInt support_material_max_layers;
ConfigOptionInt support_material_enforce_layers;
ConfigOptionInt support_material_extruder;
ConfigOptionFloatOrPercent support_material_extrusion_width;
@ -208,6 +209,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig
OPT_PTR(support_material_angle);
OPT_PTR(support_material_buildplate_only);
OPT_PTR(support_material_contact_distance);
OPT_PTR(support_material_max_layers);
OPT_PTR(support_material_enforce_layers);
OPT_PTR(support_material_extruder);
OPT_PTR(support_material_extrusion_width);