Support threshold overlap (#6606)

* Support threshold overlap

* Update tooltip
This commit is contained in:
Vovodroid 2025-01-23 12:01:38 +02:00 committed by GitHub
parent 1b1288c435
commit 7a5746b1ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 23 additions and 8 deletions

View file

@ -785,7 +785,7 @@ static std::vector<std::string> s_Preset_print_options {
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
"bridge_speed", "internal_bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed",
"outer_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_type", "skirt_loops", "skirt_speed","min_skirt_length", "skirt_distance", "skirt_start_angle", "skirt_height", "draft_shield",
"brim_width", "brim_object_gap", "brim_type", "brim_ears_max_angle", "brim_ears_detection_length", "enable_support", "support_type", "support_threshold_angle", "enforce_support_layers",
"brim_width", "brim_object_gap", "brim_type", "brim_ears_max_angle", "brim_ears_detection_length", "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap","enforce_support_layers",
"raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion",
"support_base_pattern", "support_base_pattern_spacing", "support_expansion", "support_style",
"independent_support_layer_height",

View file

@ -4722,11 +4722,22 @@ void PrintConfigDef::init_fff_params()
def->category = L("Support");
def->tooltip = L("Support will be generated for overhangs whose slope angle is below the threshold.");
def->sidetext = L("°");
def->min = 1;
def->min = 0;
def->max = 90;
def->mode = comSimple;
def->set_default_value(new ConfigOptionInt(30));
def = this->add("support_threshold_overlap", coFloatOrPercent);
def->label = L("Threshold overlap");
def->category = L("Support");
def->tooltip = L("If threshold angle is zero, support will be generated for overhangs whose overlap is below the threshold. The smaller this value is, the steeper the overhang that can be printed without support.");
def->sidetext = L("mm or %");
def->min = 0;
def->max = 100;
def->max_literal = 0.5;
def->mode = comSimple;
def->set_default_value(new ConfigOptionFloatOrPercent(50., true));
def = this->add("tree_support_branch_angle", coFloat);
def->label = L("Tree support branch angle");
def->category = L("Support");

View file

@ -820,6 +820,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionEnum<InternalBridgeFilter>, dont_filter_internal_bridges))
// Overhang angle threshold.
((ConfigOptionInt, support_threshold_angle))
((ConfigOptionFloatOrPercent, support_threshold_overlap))
((ConfigOptionFloat, support_object_xy_distance))
((ConfigOptionFloat, xy_hole_compensation))
((ConfigOptionFloat, xy_contour_compensation))

View file

@ -1019,6 +1019,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "support_expansion"
//|| opt_key == "independent_support_layer_height" // BBS
|| opt_key == "support_threshold_angle"
|| opt_key == "support_threshold_overlap"
|| opt_key == "raft_expansion"
|| opt_key == "raft_first_layer_density"
|| opt_key == "raft_first_layer_expansion"

View file

@ -1517,8 +1517,8 @@ static inline ExPolygons detect_overhangs(
(threshold_rad > 0. ?
// Overhang defined by an angle.
float(scale_(lower_layer.height / tan(threshold_rad))) :
// Overhang defined by half the extrusion width.
0.5f * fw);
// Overhang defined by overlap.
fw - float(scale_(object_config.support_threshold_overlap.get_abs_value(unscale_(fw)))));
// Overhang polygons for this layer and region.
Polygons diff_polygons;
Polygons layerm_polygons = to_polygons(layerm->slices.surfaces);

View file

@ -239,7 +239,7 @@ static std::vector<std::pair<TreeSupportSettings, std::vector<size_t>>> group_me
for (const LayerRegion *layerm : lower_layer.regions())
external_perimeter_width += layerm->flow(frExternalPerimeter).scaled_width();
external_perimeter_width /= lower_layer.region_count();
lower_layer_offset = float(0.5 * external_perimeter_width);
lower_layer_offset = external_perimeter_width - float(scale_(config.support_threshold_overlap.get_abs_value(unscale_(external_perimeter_width))));
} else
lower_layer_offset = scaled<float>(lower_layer.height / tan_threshold);
overhangs = lower_layer_offset == 0 ?

View file

@ -599,6 +599,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
"support_object_xy_distance"/*, "independent_support_layer_height"*/})
toggle_field(el, have_support_material);
toggle_field("support_threshold_angle", have_support_material && is_auto(support_type));
toggle_field("support_threshold_overlap", config->opt_int("support_threshold_angle") == 0 && have_support_material && is_auto(support_type));
//toggle_field("support_closing_radius", have_support_material && support_style == smsSnug);
bool support_is_tree = config->opt_bool("enable_support") && is_tree(support_type);

View file

@ -61,7 +61,7 @@ static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF =
{ L("Shell"), { "wall_loops", "top_shell_layers", "bottom_shell_layers"} },
{ L("Infill") , { "sparse_infill_density", "sparse_infill_pattern" } },
// BBS
{ L("Support") , { "enable_support", "support_type", "support_threshold_angle",
{ L("Support") , { "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap",
"support_base_pattern", "support_on_build_plate_only","support_critical_regions_only",
"support_remove_small_overhang",
"support_base_pattern_spacing", "support_expansion"}},
@ -88,7 +88,7 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
}},
{ L("Support"), {{"brim_type", "",1},{"brim_width", "",2},{"brim_object_gap", "",3},
{"enable_support", "",4},{"support_type", "",5},{"support_threshold_angle", "",6},{"support_on_build_plate_only", "",7},
{"enable_support", "",4},{"support_type", "",5},{"support_threshold_angle", "",6}, {"support_threshold_overlap", "",6}, {"support_on_build_plate_only", "",7},
{"support_filament", "",8},{"support_interface_filament", "",9},{"support_expansion", "",24},{"support_style", "",25},
{"tree_support_brim_width", "",26}, {"tree_support_branch_angle", "",10},{"tree_support_branch_angle_organic","",10}, {"tree_support_wall_count", "",11},//tree support
{"support_top_z_distance", "",13},{"support_bottom_z_distance", "",12},{"support_base_pattern", "",14},{"support_base_pattern_spacing", "",15},
@ -150,7 +150,7 @@ std::vector<SimpleSettingData> SettingsFactory::get_visible_options(const std::s
//Quality
"layer_height", "initial_layer_print_height", "adaptive_layer_height", "seam_position", "xy_hole_compensation", "xy_contour_compensation", "elefant_foot_compensation", "support_line_width",
//Support
"enable_support", "support_type", "support_threshold_angle", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers",
"enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers",
//tree support
"tree_support_wall_count",
//support

View file

@ -2227,6 +2227,7 @@ void TabPrint::build()
optgroup->append_single_option_line("support_type", "support#support-types");
optgroup->append_single_option_line("support_style", "support#support-styles");
optgroup->append_single_option_line("support_threshold_angle", "support#threshold-angle");
optgroup->append_single_option_line("support_threshold_overlap", "support#threshold-angle");
optgroup->append_single_option_line("raft_first_layer_density");
optgroup->append_single_option_line("raft_first_layer_expansion");
optgroup->append_single_option_line("support_on_build_plate_only");