NEW: Add "Support xy expansion distance" setting

Open the "Support xy expansion distance" setting for users who can set
expanding and shrinking distance along xy to change normal supports' overhang area.

Jira: STUDIO-1297
Change-Id: If3a1efe99acaced12216966a6f8abd0dc3734757
(cherry picked from commit c1fd588a181b17403109b64a0019818f428252da)
This commit is contained in:
MusangKing 2022-11-25 18:23:54 +08:00 committed by Lane.Wei
parent ab49516ec1
commit d1e4cb430c
10 changed files with 21 additions and 7 deletions

View File

@ -82,6 +82,7 @@
"support_interface_top_layers": "2",
"support_interface_bottom_layers": "2",
"support_interface_spacing": "0.5",
"support_expansion": "0",
"support_interface_speed": "80",
"support_base_pattern": "rectilinear",
"support_base_pattern_spacing": "2.5",

View File

@ -708,7 +708,7 @@ static std::vector<std::string> s_Preset_print_options {
"outer_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield",
"brim_width", "brim_object_gap", "brim_type", "enable_support", "support_type", "support_threshold_angle", "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_style",
"support_base_pattern", "support_base_pattern_spacing", "support_expansion", "support_style",
// BBS
//"independent_support_layer_height",
"support_angle", "support_interface_top_layers", "support_interface_bottom_layers",

View File

@ -2593,6 +2593,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(2.5));
def = this->add("support_expansion", coFloat);
def->label = L("Support xy expansion distance");
def->category = L("Support");
def->tooltip = L("Expanding (+) or shrinking (-) support volume");
def->sidetext = L("mm");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("support_speed", coFloat);
def->label = L("Support");
def->category = L("Speed");

View File

@ -634,6 +634,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionEnum<SupportMaterialInterfacePattern>, support_interface_pattern))
// Spacing between support material lines (the hatching distance).
((ConfigOptionFloat, support_base_pattern_spacing))
((ConfigOptionFloat, support_expansion))
((ConfigOptionFloat, support_speed))
((ConfigOptionEnum<SupportMaterialStyle>, support_style))
// BBS

View File

@ -739,6 +739,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "support_style"
|| opt_key == "support_object_xy_distance"
|| opt_key == "support_base_pattern_spacing"
|| opt_key == "support_expansion"
//|| opt_key == "independent_support_layer_height" // BBS
|| opt_key == "support_threshold_angle"
|| opt_key == "raft_expansion"

View File

@ -1512,6 +1512,7 @@ static inline Polygons detect_overhangs(
0.;
const coordf_t max_bridge_length = scale_(object_config.max_bridge_length.value);
const bool bridge_no_support = object_config.bridge_no_support.value;
const coordf_t xy_expansion = scale_(object_config.support_expansion.value);
if (layer_id == 0)
{
@ -1567,9 +1568,9 @@ static inline Polygons detect_overhangs(
// Offset the support regions back to a full overhang, restrict them to the full overhang.
// This is done to increase size of the supporting columns below, as they are calculated by
// propagating these contact surfaces downwards.
diff_polygons = diff(
intersection(expand(diff_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS), layerm_polygons),
lower_layer_polygons);
diff_polygons =
expand(diff(intersection(expand(diff_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS), layerm_polygons), lower_layer_polygons),
xy_expansion, SUPPORT_SURFACES_OFFSET_PARAMETERS);
}
//FIXME add user defined filtering here based on minimal area or minimum radius or whatever.

View File

@ -136,6 +136,7 @@ public:
float base_angle;
float interface_angle;
coordf_t interface_spacing;
coordf_t support_expansion;
coordf_t interface_density;
coordf_t support_spacing;
coordf_t support_density;

View File

@ -528,7 +528,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool have_support_soluble = have_support_material && config->opt_float("support_top_z_distance") == 0;
auto support_style = config->opt_enum<SupportMaterialStyle>("support_style");
for (auto el : { "support_style", "support_base_pattern",
"support_base_pattern_spacing", "support_angle",
"support_base_pattern_spacing", "support_expansion", "support_angle",
"support_interface_pattern", "support_interface_top_layers", "support_interface_bottom_layers",
"bridge_no_support", "max_bridge_length", "support_top_z_distance", "support_bottom_z_distance",
//BBS: add more support params to dependent of enable_support

View File

@ -56,7 +56,7 @@ static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF =
// BBS
{ L("Support") , { "enable_support", "support_type", "support_threshold_angle",
"support_base_pattern", "support_on_build_plate_only","support_critical_regions_only",
"support_base_pattern_spacing" } },
"support_base_pattern_spacing", "support_expansion"}},
//BBS
{ L("Flush options") , { "flush_into_infill", "flush_into_objects", "flush_into_support"} }
};
@ -78,7 +78,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},
{"support_filament", "",8},{"support_interface_filament", "",9},
{"support_filament", "",8},{"support_interface_filament", "",9},{"support_expansion", "",25},
{"tree_support_branch_angle", "",10}, {"tree_support_wall_count", "",11},{"tree_support_with_infill", "",12},//tree support
{"support_top_z_distance", "",13},{"support_bottom_z_distance", "",24},{"support_base_pattern", "",14},{"support_base_pattern_spacing", "",15},
{"support_interface_top_layers", "",16},{"support_interface_bottom_layers", "",17},{"support_interface_spacing", "",18},{"support_bottom_interface_spacing", "",19},

View File

@ -1899,6 +1899,7 @@ void TabPrint::build()
optgroup->append_single_option_line("support_interface_pattern", "support#base-pattern");
optgroup->append_single_option_line("support_interface_spacing", "support#base-pattern");
optgroup->append_single_option_line("support_bottom_interface_spacing");
optgroup->append_single_option_line("support_expansion", "support#base-pattern");
//optgroup->append_single_option_line("support_interface_loop_pattern");
optgroup->append_single_option_line("support_object_xy_distance", "support#supportobject-xy-distance");