mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 15:50:38 +08:00
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:
parent
5d10d4c02b
commit
a2fb7313c6
@ -482,7 +482,7 @@ sub build {
|
||||
brim_connections_width brim_width
|
||||
support_material support_material_threshold support_material_enforce_layers
|
||||
raft_layers
|
||||
support_material_pattern support_material_spacing support_material_angle
|
||||
support_material_pattern support_material_spacing support_material_angle
|
||||
support_material_interface_layers support_material_interface_spacing
|
||||
support_material_contact_distance dont_support_bridges
|
||||
notes
|
||||
@ -864,10 +864,11 @@ sub _update {
|
||||
my $have_support_material = $config->support_material || $config->raft_layers > 0;
|
||||
my $have_support_interface = $config->support_material_interface_layers > 0;
|
||||
$self->get_field($_)->toggle($have_support_material)
|
||||
for qw(support_material_threshold support_material_pattern
|
||||
for qw(support_material_threshold support_material_pattern
|
||||
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);
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user