NEW: add tree_support_brim_width option

Jira: STUDIO-2921

Change-Id: Id5fddc0b6f5ffe3beb9afb0be5f81a766fc5b21e
(cherry picked from commit 86d7b6016e48143aad03744a58d44042ff0a0b4c)
This commit is contained in:
Arthur 2023-05-16 14:55:50 +08:00 committed by Lane.Wei
parent 297e922daf
commit 3d1f61c7ed
8 changed files with 19 additions and 8 deletions

View file

@ -740,7 +740,7 @@ static std::vector<std::string> s_Preset_print_options {
"flush_into_infill", "flush_into_objects", "flush_into_support",
// BBS
"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance",
"tree_support_branch_diameter",
"tree_support_branch_diameter","tree_support_brim_width",
"detect_narrow_internal_solid_infill",
"gcode_add_line_number", "enable_arc_fitting", "infill_combination", /*"adaptive_layer_height",*/
"support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed",

View file

@ -2790,6 +2790,16 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(1));
def = this->add("tree_support_brim_width", coFloat);
def->label = L("Tree support brim width");
def->category = L("Support");
def->tooltip = L("The brim width around tree support. 0 means auto.");
def->sidetext = L("mm");
def->min = 0;
def->max = 100;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("nozzle_temperature", coInts);
def->label = L("Other layers");
def->tooltip = L("Nozzle temperature for layers after the initial one");

View file

@ -685,6 +685,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, tree_support_branch_diameter))
((ConfigOptionFloat, tree_support_branch_angle))
((ConfigOptionInt, tree_support_wall_count))
((ConfigOptionFloat, tree_support_brim_width))
((ConfigOptionBool, detect_narrow_internal_solid_infill))
// ((ConfigOptionBool, adaptive_layer_height))
((ConfigOptionFloat, support_bottom_interface_spacing))

View file

@ -770,6 +770,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "tree_support_branch_distance"
|| opt_key == "tree_support_branch_diameter"
|| opt_key == "tree_support_branch_angle"
|| opt_key == "tree_support_brim_width"
|| opt_key == "tree_support_wall_count") {
steps.emplace_back(posSupportMaterial);
} else if (

View file

@ -33,8 +33,6 @@
namespace Slic3r
{
#define unscale_(val) ((val) * SCALING_FACTOR)
#define FIRST_LAYER_EXPANSION 1.2
inline unsigned int round_divide(unsigned int dividend, unsigned int divisor) //!< Return dividend divided by divisor rounded to the nearest integer
{
@ -2020,7 +2018,7 @@ void TreeSupport::draw_circles(const std::vector<std::vector<Node*>>& contact_no
const bool with_lightning_infill = m_support_params.base_fill_pattern == ipLightning;
coordf_t support_extrusion_width = m_support_params.support_extrusion_width;
const size_t wall_count = config.tree_support_wall_count.value;
const float tree_brim_width = config.tree_support_brim_width.value;
const PrintObjectConfig& object_config = m_object->config();
BOOST_LOG_TRIVIAL(info) << "draw_circles for object: " << m_object->model_object()->name;
@ -2110,7 +2108,7 @@ void TreeSupport::draw_circles(const std::vector<std::vector<Node*>>& contact_no
}
}
if (layer_nr == 0 && m_raft_layers == 0) {
double brim_width = layers_to_top * layer_height / (scale * branch_radius) * 0.5;
double brim_width = tree_brim_width > 0 ? tree_brim_width : layers_to_top * layer_height / (scale * branch_radius) * 0.5;
circle = offset(circle, scale_(brim_width))[0];
}
area.emplace_back(ExPolygon(circle));

View file

@ -600,11 +600,11 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
//toggle_field("support_closing_radius", have_support_material && support_style == smsSnug);
bool support_is_tree = config->opt_bool("enable_support") && is_tree(support_type);
for (auto el : {"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance", "tree_support_branch_diameter"})
for (auto el : {"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance", "tree_support_branch_diameter","tree_support_brim_width"})
toggle_field(el, support_is_tree);
// hide tree support settings when normal is selected
for (auto el : {"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance", "tree_support_branch_diameter", "max_bridge_length"})
for (auto el : {"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance", "tree_support_branch_diameter", "max_bridge_length","tree_support_brim_width" })
toggle_line(el, support_is_tree);
// tree support use max_bridge_length instead of bridge_no_support

View file

@ -80,7 +80,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_expansion", "",24},{"support_style", "",25},
{"tree_support_branch_angle", "",10}, {"tree_support_wall_count", "",11},//tree support
{"tree_support_brim_width", "",26}, {"tree_support_branch_angle", "",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},
{"support_interface_top_layers", "",16},{"support_interface_bottom_layers", "",17},{"support_interface_spacing", "",18},{"support_bottom_interface_spacing", "",19},
{"support_object_xy_distance", "",20}, {"bridge_no_support", "",21},{"max_bridge_length", "",22},{"support_critical_regions_only", "",23}

View file

@ -1968,6 +1968,7 @@ void TabPrint::build()
optgroup->append_single_option_line("tree_support_branch_diameter", "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_wall_count");
optgroup->append_single_option_line("tree_support_brim_width");
optgroup->append_single_option_line("support_top_z_distance", "support#top-z-distance");
optgroup->append_single_option_line("support_bottom_z_distance", "support#bottom-z-distance");
optgroup->append_single_option_line("support_base_pattern", "support#base-pattern");