ENH: precise tree support wall count

Change the behavior of "tree support wall count" option, let it control precisely.
0 means auto.

jira: STUDIO-8068
github: 4780
Change-Id: I6d1a64cff9b121f5c0a3e910c5ddbfe6db198687
(cherry picked from commit a557bbe758cd352fa9bb48323995ed2c90737577)
This commit is contained in:
Arthur 2024-09-12 15:50:37 +08:00 committed by Noisyfox
parent e78d50f733
commit 3e7e4df7ce
8 changed files with 8 additions and 31 deletions

View file

@ -812,7 +812,7 @@ static std::vector<std::string> s_Preset_print_options {
"wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits", "wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits",
"flush_into_infill", "flush_into_objects", "flush_into_support", "flush_into_infill", "flush_into_objects", "flush_into_support",
"tree_support_branch_angle", "tree_support_angle_slow", "tree_support_wall_count", "tree_support_top_rate", "tree_support_branch_distance", "tree_support_tip_diameter", "tree_support_branch_angle", "tree_support_angle_slow", "tree_support_wall_count", "tree_support_top_rate", "tree_support_branch_distance", "tree_support_tip_diameter",
"tree_support_branch_diameter", "tree_support_branch_diameter_angle", "tree_support_branch_diameter_double_wall", "tree_support_branch_diameter", "tree_support_branch_diameter_angle",
"detect_narrow_internal_solid_infill", "detect_narrow_internal_solid_infill",
"gcode_add_line_number", "enable_arc_fitting", "precise_z_height", "infill_combination","infill_combination_max_layer_height", /*"adaptive_layer_height",*/ "gcode_add_line_number", "enable_arc_fitting", "precise_z_height", "infill_combination","infill_combination_max_layer_height", /*"adaptive_layer_height",*/
"support_bottom_interface_spacing", "enable_overhang_speed", "slowdown_for_curled_perimeters", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed", "support_bottom_interface_spacing", "enable_overhang_speed", "slowdown_for_curled_perimeters", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed",

View file

@ -4940,26 +4940,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(5)); def->set_default_value(new ConfigOptionFloat(5));
def = this->add("tree_support_branch_diameter_double_wall", coFloat);
def->label = L("Branch Diameter with double walls");
def->category = L("Support");
// TRN PrintSettings: "Organic supports" > "Branch Diameter"
def->tooltip = L("Branches with area larger than the area of a circle of this diameter will be printed with double walls for stability. "
"Set this value to zero for no double walls.");
def->sidetext = L("mm");
def->min = 0;
def->max = 100.f;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(3.));
def = this->add("tree_support_wall_count", coInt); def = this->add("tree_support_wall_count", coInt);
def->label = L("Support wall loops"); def->label = L("Support wall loops");
def->category = L("Support"); def->category = L("Support");
def->tooltip = L("This setting specifies the min count of support walls in the range of [0,2]. Actual wall count may be larger than the specified value."); def->tooltip = L("This setting specifies the count of support walls in the range of [0,2]. 0 means auto.");
def->min = 0; def->min = 0;
def->max = 2; def->max = 2;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(1)); def->set_default_value(new ConfigOptionInt(0));
def = this->add("tree_support_with_infill", coBool); def = this->add("tree_support_with_infill", coBool);
def->label = L("Tree support with infill"); def->label = L("Tree support with infill");

View file

@ -843,7 +843,6 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, tree_support_tip_diameter)) ((ConfigOptionFloat, tree_support_tip_diameter))
((ConfigOptionFloat, tree_support_branch_diameter)) ((ConfigOptionFloat, tree_support_branch_diameter))
((ConfigOptionFloat, tree_support_branch_diameter_angle)) ((ConfigOptionFloat, tree_support_branch_diameter_angle))
((ConfigOptionFloat, tree_support_branch_diameter_double_wall))
((ConfigOptionFloat, tree_support_branch_angle)) ((ConfigOptionFloat, tree_support_branch_angle))
((ConfigOptionFloat, tree_support_angle_slow)) ((ConfigOptionFloat, tree_support_angle_slow))
((ConfigOptionInt, tree_support_wall_count)) ((ConfigOptionInt, tree_support_wall_count))

View file

@ -1033,7 +1033,6 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "tree_support_branch_diameter" || opt_key == "tree_support_branch_diameter"
|| opt_key == "tree_support_branch_diameter_organic" || opt_key == "tree_support_branch_diameter_organic"
|| opt_key == "tree_support_branch_diameter_angle" || opt_key == "tree_support_branch_diameter_angle"
|| opt_key == "tree_support_branch_diameter_double_wall"
|| opt_key == "tree_support_branch_angle" || opt_key == "tree_support_branch_angle"
|| opt_key == "tree_support_branch_angle_organic" || opt_key == "tree_support_branch_angle_organic"
|| opt_key == "tree_support_angle_slow" || opt_key == "tree_support_angle_slow"

View file

@ -153,7 +153,9 @@ struct SupportParameters {
independent_layer_height = print_config.independent_support_layer_height; independent_layer_height = print_config.independent_support_layer_height;
// force double walls everywhere if wall count is larger than 1 // force double walls everywhere if wall count is larger than 1
tree_branch_diameter_double_wall_area_scaled = object_config.tree_support_wall_count.value > 1 ? 0.1 : 0.25 * sqr(scaled<double>(5.0)) * M_PI; tree_branch_diameter_double_wall_area_scaled = object_config.tree_support_wall_count.value > 1 ? 0.1 :
object_config.tree_support_wall_count.value == 0 ? 0.25 * sqr(scaled<double>(5.0)) * M_PI :
std::numeric_limits<double>::max();
support_style = object_config.support_style; support_style = object_config.support_style;
if (support_style == smsDefault) { if (support_style == smsDefault) {

View file

@ -1540,17 +1540,7 @@ void TreeSupport::generate_toolpaths()
erSupportMaterial, filler_support.get(), support_density); erSupportMaterial, filler_support.get(), support_density);
} }
else { else {
size_t walls = wall_count; tree_supports_generate_paths(ts_layer->support_fills.entities, loops, flow, m_support_params);
//if (area_group.need_extra_wall && walls < 2) walls += 1;
//for (size_t i = 1; i < walls; i++) {
// Polygons contour_new = offset(poly.contour, -(i - 0.5f) * flow.scaled_spacing(), jtSquare);
// loops.insert(loops.end(), contour_new.begin(), contour_new.end());
//}
//fill_expolygons_with_sheath_generate_paths(ts_layer->support_fills.entities, loops, nullptr, 0, erSupportMaterial, flow, true, false);
SupportParameters support_params = m_support_params;
if(walls>1)
support_params.tree_branch_diameter_double_wall_area_scaled=0.1;
tree_supports_generate_paths(ts_layer->support_fills.entities, loops, flow, support_params);
} }
} }
} }

View file

@ -614,7 +614,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
for (auto el : {"tree_support_auto_brim", "tree_support_brim_width", "tree_support_adaptive_layer_height"}) for (auto el : {"tree_support_auto_brim", "tree_support_brim_width", "tree_support_adaptive_layer_height"})
toggle_line(el, support_is_normal_tree); toggle_line(el, support_is_normal_tree);
// settings specific to organic trees // settings specific to organic trees
for (auto el : {"tree_support_branch_angle_organic", "tree_support_branch_distance_organic", "tree_support_branch_diameter_organic","tree_support_angle_slow","tree_support_tip_diameter", "tree_support_top_rate", "tree_support_branch_diameter_angle", "tree_support_branch_diameter_double_wall"}) for (auto el : {"tree_support_branch_angle_organic", "tree_support_branch_distance_organic", "tree_support_branch_diameter_organic","tree_support_angle_slow","tree_support_tip_diameter", "tree_support_top_rate", "tree_support_branch_diameter_angle"})
toggle_line(el, support_is_organic); toggle_line(el, support_is_organic);
toggle_field("tree_support_brim_width", support_is_tree && !config->opt_bool("tree_support_auto_brim")); toggle_field("tree_support_brim_width", support_is_tree && !config->opt_bool("tree_support_auto_brim"));

View file

@ -2242,7 +2242,6 @@ void TabPrint::build()
optgroup->append_single_option_line("tree_support_branch_angle", "support#tree-support-only-options"); optgroup->append_single_option_line("tree_support_branch_angle", "support#tree-support-only-options");
optgroup->append_single_option_line("tree_support_branch_angle_organic", "support#tree-support-only-options"); optgroup->append_single_option_line("tree_support_branch_angle_organic", "support#tree-support-only-options");
optgroup->append_single_option_line("tree_support_angle_slow"); optgroup->append_single_option_line("tree_support_angle_slow");
optgroup->append_single_option_line("tree_support_branch_diameter_double_wall");
optgroup->append_single_option_line("tree_support_adaptive_layer_height"); optgroup->append_single_option_line("tree_support_adaptive_layer_height");
optgroup->append_single_option_line("tree_support_auto_brim"); optgroup->append_single_option_line("tree_support_auto_brim");
optgroup->append_single_option_line("tree_support_brim_width"); optgroup->append_single_option_line("tree_support_brim_width");