Added brim width setting for tree support

This commit is contained in:
SoftFever 2023-03-12 21:05:59 +08:00
parent a47c756112
commit 11c1c17245
7 changed files with 29 additions and 5 deletions

View file

@ -754,8 +754,8 @@ static std::vector<std::string> s_Preset_print_options {
"top_solid_infill_flow_ratio","bottom_solid_infill_flow_ratio","only_one_wall_first_layer", "print_flow_ratio", "seam_gap",
"role_based_wipe_speed", "wipe_speed", "accel_to_decel_enable", "accel_to_decel_factor", "wipe_on_loops",
"bridge_density", "precise_outer_wall", "overhang_speed_classic", "bridge_acceleration",
"sparse_infill_acceleration", "internal_solid_infill_acceleration", "tree_support_adaptive_layer_height",
"gcode_comments", "gcode_label_objects"
"sparse_infill_acceleration", "internal_solid_infill_acceleration", "tree_support_adaptive_layer_height", "tree_support_auto_brim",
"tree_support_brim_width", "gcode_comments", "gcode_label_objects"
};

View file

@ -3049,6 +3049,19 @@ void PrintConfigDef::init_fff_params()
def->category = L("Quality");
def->tooltip = L("Enabling this option means the height of tree support layer except the first will be automatically calculated ");
def->set_default_value(new ConfigOptionBool(1));
def = this->add("tree_support_auto_brim", coBool);
def->label = L("Auto brim width");
def->category = L("Quality");
def->tooltip = L("Enabling this option means the width of the brim for tree support will be automatically calculated");
def->set_default_value(new ConfigOptionBool(1));
def = this->add("tree_support_brim_width", coFloat);
def->label = L("Tree support brim width");
def->category = L("Quality");
def->min = 0.0;
def->tooltip = L("Distance from tree branch to the outermost brim line");
def->set_default_value(new ConfigOptionFloat(3));
def = this->add("tree_support_branch_diameter", coFloat);
def->label = L("Tree support branch diameter");

View file

@ -691,6 +691,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, tree_support_branch_angle))
((ConfigOptionInt, tree_support_wall_count))
((ConfigOptionBool, tree_support_adaptive_layer_height))
((ConfigOptionBool, tree_support_auto_brim))
((ConfigOptionFloat, tree_support_brim_width))
((ConfigOptionBool, detect_narrow_internal_solid_infill))
// ((ConfigOptionBool, adaptive_layer_height))
((ConfigOptionFloat, support_bottom_interface_spacing))

View file

@ -775,6 +775,8 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "max_bridge_length"
|| opt_key == "initial_layer_line_width"
|| opt_key == "tree_support_adaptive_layer_height"
|| opt_key == "tree_support_auto_brim"
|| opt_key == "tree_support_brim_width"
|| opt_key == "tree_support_branch_distance"
|| opt_key == "tree_support_branch_diameter"
|| opt_key == "tree_support_branch_angle"

View file

@ -2161,7 +2161,11 @@ 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 =
config.tree_support_auto_brim
? layers_to_top * layer_height /
(scale * branch_radius) * 0.5
: config.tree_support_brim_width;
circle = offset(circle, scale_(brim_width))[0];
}
area.emplace_back(ExPolygon(circle));