Configurable overhang threshold as function of perimeter width (#3752)

* Fix automatic overhang threshold

We should be supporting perimeters that are overhung further than half a
perimeter out, rather than two times the perimeter width.

Fixes: #2068

* Made the overhang detection configurable, up to 200 (the original value, which is still the default)

* Set default to 60% as per https://github.com/alexrj/Slic3r/wiki/Support:-Requirements
Removed some less useful enumerations (0-30%)

* Folded in auto_threshold into support threshold as a % value
This commit is contained in:
Joseph Lenox 2017-03-11 17:22:06 -06:00 committed by GitHub
parent 5d10d4c02b
commit a2fb7313c6
4 changed files with 15 additions and 11 deletions

View File

@ -868,6 +868,7 @@ sub _update {
support_material_spacing support_material_angle
support_material_interface_layers dont_support_bridges
support_material_extrusion_width support_material_contact_distance);
$self->get_field($_)->toggle($have_support_material && $have_support_interface)
for qw(support_material_interface_spacing support_material_interface_extruder
support_material_interface_speed);

View File

@ -92,7 +92,7 @@ sub contact_area {
# if user specified a custom angle threshold, convert it to radians
my $threshold_rad;
if ($self->object_config->support_material_threshold) {
if (!$self->object_config->support_material_threshold =~ /%$/) {
$threshold_rad = deg2rad($self->object_config->support_material_threshold + 1); # +1 makes the threshold inclusive
Slic3r::debugf "Threshold angle = %d°\n", rad2deg($threshold_rad);
}
@ -152,7 +152,7 @@ sub contact_area {
} else {
$diff = diff(
[ map $_->p, @{$layerm->slices} ],
offset([ map @$_, @{$lower_layer->slices} ], +$fw*2),
offset([ map @$_, @{$lower_layer->slices} ], +$self->object_config->get_abs_value_over('support_material_threshold', $fw)),
);
# collapse very tiny spots

View File

@ -1291,6 +1291,9 @@ PrintConfigDef::PrintConfigDef()
def->min = 0;
def->default_value = new ConfigOptionFloat(2.5);
def = this->add("support_material_speed", coFloat);
def->label = "Support material";
def->gui_type = "f_enum_open";
@ -1303,15 +1306,15 @@ PrintConfigDef::PrintConfigDef()
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloat(60);
def = this->add("support_material_threshold", coInt);
def = this->add("support_material_threshold", coFloatOrPercent);
def->label = "Overhang threshold";
def->category = "Support material";
def->tooltip = "Support material will not be generated for overhangs whose slope angle (90° = vertical) is above the given threshold. In other words, this value represent the most horizontal slope (measured from the horizontal plane) that you can print without support material. Set to zero for automatic detection (recommended).";
def->sidetext = "°";
def->cli = "support-material-threshold=i";
def->tooltip = "Support material will not be generated for overhangs whose slope angle (90° = vertical) is above the given threshold. In other words, this value represent the most horizontal slope (measured from the horizontal plane) that you can print without support material. Set to a percentage to automatically detect based on some % of overhanging perimeter width instead (recommended).";
def->sidetext = "° (or %)";
def->cli = "support-material-threshold=s";
def->min = 0;
def->max = 90;
def->default_value = new ConfigOptionInt(0);
def->max = 300;
def->default_value = new ConfigOptionFloatOrPercent(60, true);
def = this->add("temperature", coInts);
def->label = "Other layers";

View File

@ -161,7 +161,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig
ConfigOptionEnum<SupportMaterialPattern> support_material_pattern;
ConfigOptionFloat support_material_spacing;
ConfigOptionFloat support_material_speed;
ConfigOptionInt support_material_threshold;
ConfigOptionFloatOrPercent support_material_threshold;
ConfigOptionFloat xy_size_compensation;
PrintObjectConfig(bool initialize = true) : StaticPrintConfig() {