Tree supports: Added the most important tree support parameters

to parameter layer.
This commit is contained in:
Vojtech Bubnik 2023-01-19 17:12:14 +01:00
parent 443f5c1821
commit 88ba9ab1c8
7 changed files with 101 additions and 4 deletions

View File

@ -450,7 +450,9 @@ static std::vector<std::string> s_Preset_print_options {
"support_material_synchronize_layers", "support_material_angle", "support_material_interface_layers", "support_material_bottom_interface_layers", "support_material_synchronize_layers", "support_material_angle", "support_material_interface_layers", "support_material_bottom_interface_layers",
"support_material_interface_pattern", "support_material_interface_spacing", "support_material_interface_contact_loops", "support_material_interface_pattern", "support_material_interface_spacing", "support_material_interface_contact_loops",
"support_material_contact_distance", "support_material_bottom_contact_distance", "support_material_contact_distance", "support_material_bottom_contact_distance",
"support_material_buildplate_only", "dont_support_bridges", "thick_bridges", "notes", "complete_objects", "extruder_clearance_radius", "support_material_buildplate_only",
"support_tree_angle", "support_tree_angle_slow", "support_tree_branch_diameter", "support_tree_branch_diameter_angle", "support_tree_top_rate", "support_tree_tip_diameter",
"dont_support_bridges", "thick_bridges", "notes", "complete_objects", "extruder_clearance_radius",
"extruder_clearance_height", "gcode_comments", "gcode_label_objects", "output_filename_format", "post_process", "gcode_substitutions", "perimeter_extruder", "extruder_clearance_height", "gcode_comments", "gcode_label_objects", "output_filename_format", "post_process", "gcode_substitutions", "perimeter_extruder",
"infill_extruder", "solid_infill_extruder", "support_material_extruder", "support_material_interface_extruder", "infill_extruder", "solid_infill_extruder", "support_material_extruder", "support_material_interface_extruder",
"ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width", "ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",

View File

@ -2876,6 +2876,71 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert; def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(true)); def->set_default_value(new ConfigOptionBool(true));
def = this->add("support_tree_angle", coFloat);
def->label = L("Tree Support Maximum Branch Angle");
def->category = L("Support material");
def->tooltip = L("The maximum angle of the branches, when the branches have to avoid the model. "
"Use a lower angle to make them more vertical and more stable. Use a higher angle to be able to have more reach.");
def->sidetext = L("°");
def->min = 0;
def->max = 85;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(40));
def = this->add("support_tree_angle_slow", coFloat);
def->label = L("Tree Support Preferred Branch Angle");
def->category = L("Support material");
def->tooltip = L("The preferred angle of the branches, when they do not have to avoid the model. "
"Use a lower angle to make them more vertical and more stable. Use a higher angle for branches to merge faster.");
def->sidetext = L("°");
def->min = 10;
def->max = 85;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(25));
def = this->add("support_tree_tip_diameter", coFloat);
def->label = L("Tree Support Tip Diameter");
def->category = L("Support material");
def->tooltip = L("The diameter of the top of the tip of the branches of tree support.");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.8));
def = this->add("support_tree_branch_diameter", coFloat);
def->label = L("Tree Support Branch Diameter");
def->category = L("Support material");
def->tooltip = L("The diameter of the thinnest branches of tree support. Thicker branches are more sturdy. "
"Branches towards the base will be thicker than this.");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(2));
def = this->add("support_tree_branch_diameter_angle", coFloat);
def->label = L("Tree Support Branch Diameter Angle");
def->category = L("Support material");
def->tooltip = L("The angle of the branches' diameter as they gradually become thicker towards the bottom. "
"An angle of 0 will cause the branches to have uniform thickness over their length. "
"A bit of an angle can increase stability of the tree support.");
def->sidetext = L("°");
def->min = 0;
def->max = 15;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(5));
def = this->add("support_tree_top_rate", coPercent);
def->label = L("Tree Support Branch Density");
def->category = L("Support material");
def->tooltip = L("Adjusts the density of the support structure used to generate the tips of the branches. "
"A higher value results in better overhangs, but the supports are harder to remove. "
"Use Support Roof for very high values or ensure support density is similarly high at the top.");
def->sidetext = L("%");
def->min = 5;
def->max_literal = 35;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionPercent(30));
def = this->add("temperature", coInts); def = this->add("temperature", coInts);
def->label = L("Other layers"); def->label = L("Other layers");
def->tooltip = L("Nozzle temperature for layers after the first one. Set this to zero to disable " def->tooltip = L("Nozzle temperature for layers after the first one. Set this to zero to disable "

View File

@ -547,6 +547,14 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionInt, support_material_threshold)) ((ConfigOptionInt, support_material_threshold))
((ConfigOptionBool, support_material_with_sheath)) ((ConfigOptionBool, support_material_with_sheath))
((ConfigOptionFloatOrPercent, support_material_xy_spacing)) ((ConfigOptionFloatOrPercent, support_material_xy_spacing))
// Tree supports
((ConfigOptionFloat, support_tree_angle))
((ConfigOptionFloat, support_tree_angle_slow))
((ConfigOptionFloat, support_tree_branch_diameter))
((ConfigOptionFloat, support_tree_branch_diameter_angle))
((ConfigOptionPercent, support_tree_top_rate))
((ConfigOptionFloat, support_tree_tip_diameter))
// The rest
((ConfigOptionBool, thick_bridges)) ((ConfigOptionBool, thick_bridges))
((ConfigOptionFloat, xy_size_compensation)) ((ConfigOptionFloat, xy_size_compensation))
((ConfigOptionBool, wipe_into_objects)) ((ConfigOptionBool, wipe_into_objects))

View File

@ -657,6 +657,12 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "support_material_synchronize_layers" || opt_key == "support_material_synchronize_layers"
|| opt_key == "support_material_threshold" || opt_key == "support_material_threshold"
|| opt_key == "support_material_with_sheath" || opt_key == "support_material_with_sheath"
|| opt_key == "support_tree_angle"
|| opt_key == "support_tree_angle_slow"
|| opt_key == "support_tree_branch_diameter"
|| opt_key == "support_tree_branch_diameter_angle"
|| opt_key == "support_tree_top_rate"
|| opt_key == "support_tree_tip_diameter"
|| opt_key == "raft_expansion" || opt_key == "raft_expansion"
|| opt_key == "raft_first_layer_density" || opt_key == "raft_first_layer_density"
|| opt_key == "raft_first_layer_expansion" || opt_key == "raft_first_layer_expansion"

View File

@ -54,6 +54,7 @@ TreeSupportMeshGroupSettings::TreeSupportMeshGroupSettings(const PrintObject &pr
this->layer_height = scaled<coord_t>(config.layer_height.value); this->layer_height = scaled<coord_t>(config.layer_height.value);
this->resolution = scaled<coord_t>(print_config.gcode_resolution.value); this->resolution = scaled<coord_t>(print_config.gcode_resolution.value);
// Arache feature
this->min_feature_size = scaled<coord_t>(config.min_feature_size.value); this->min_feature_size = scaled<coord_t>(config.min_feature_size.value);
// +1 makes the threshold inclusive // +1 makes the threshold inclusive
this->support_angle = 0.5 * M_PI - std::clamp<double>((config.support_material_threshold + 1) * M_PI / 180., 0., 0.5 * M_PI); this->support_angle = 0.5 * M_PI - std::clamp<double>((config.support_material_threshold + 1) * M_PI / 180., 0., 0.5 * M_PI);
@ -88,6 +89,14 @@ TreeSupportMeshGroupSettings::TreeSupportMeshGroupSettings(const PrintObject &pr
// this->minimum_support_area = // this->minimum_support_area =
// this->minimum_bottom_area = // this->minimum_bottom_area =
// this->support_offset = // this->support_offset =
// this->support_tree_branch_distance = 2.5 * line_width ??
this->support_tree_angle = std::clamp<double>(config.support_tree_angle * M_PI / 180., 0., 0.5 * M_PI - EPSILON);
this->support_tree_angle_slow = std::clamp<double>(config.support_tree_angle_slow * M_PI / 180., 0., this->support_tree_angle - EPSILON);
this->support_tree_branch_diameter = scaled<coord_t>(config.support_tree_branch_diameter.value);
this->support_tree_branch_diameter_angle = std::clamp<double>(config.support_tree_branch_diameter_angle * M_PI / 180., 0., 0.5 * M_PI - EPSILON);
this->support_tree_top_rate = config.support_tree_top_rate.value; // percent
// this->support_tree_tip_diameter = this->support_line_width;
this->support_tree_tip_diameter = std::clamp(scaled<coord_t>(config.support_tree_tip_diameter.value), 0, this->support_tree_branch_diameter);
} }
//FIXME Machine border is currently ignored. //FIXME Machine border is currently ignored.

View File

@ -11,7 +11,6 @@
#include <mutex> #include <mutex>
#include <unordered_map> #include <unordered_map>
#include <unordered_set>
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
@ -43,7 +42,7 @@ struct TreeSupportMeshGroupSettings {
// the print will be less accurate, but the g-code will be smaller. Maximum Deviation is a limit for Maximum Resolution, // the print will be less accurate, but the g-code will be smaller. Maximum Deviation is a limit for Maximum Resolution,
// so if the two conflict the Maximum Deviation will always be held true. // so if the two conflict the Maximum Deviation will always be held true.
coord_t resolution { scaled<coord_t>(0.025) }; coord_t resolution { scaled<coord_t>(0.025) };
// Minimum Feature Size (aka minimum line width) // Minimum Feature Size (aka minimum line width) - Arachne specific
// Minimum thickness of thin features. Model features that are thinner than this value will not be printed, while features thicker // Minimum thickness of thin features. Model features that are thinner than this value will not be printed, while features thicker
// than the Minimum Feature Size will be widened to the Minimum Wall Line Width. // than the Minimum Feature Size will be widened to the Minimum Wall Line Width.
coord_t min_feature_size { scaled<coord_t>(0.1) }; coord_t min_feature_size { scaled<coord_t>(0.1) };
@ -183,7 +182,7 @@ struct TreeSupportMeshGroupSettings {
// 5%-35% // 5%-35%
double support_tree_top_rate { 15. }; double support_tree_top_rate { 15. };
// Tree Support Tip Diameter // Tree Support Tip Diameter
// The diameter of the top of the tip of the branches of tree support." // The diameter of the top of the tip of the branches of tree support.
// minimum: min_wall_line_width, minimum warning: min_wall_line_width+0.05, maximum_value: support_tree_branch_diameter, value: support_line_width // minimum: min_wall_line_width, minimum warning: min_wall_line_width+0.05, maximum_value: support_tree_branch_diameter, value: support_line_width
coord_t support_tree_tip_diameter { scaled<coord_t>(0.4) }; coord_t support_tree_tip_diameter { scaled<coord_t>(0.4) };

View File

@ -1526,6 +1526,14 @@ void TabPrint::build()
optgroup->append_single_option_line("dont_support_bridges", category_path + "dont-support-bridges"); optgroup->append_single_option_line("dont_support_bridges", category_path + "dont-support-bridges");
optgroup->append_single_option_line("support_material_synchronize_layers", category_path + "synchronize-with-object-layers"); optgroup->append_single_option_line("support_material_synchronize_layers", category_path + "synchronize-with-object-layers");
optgroup = page->new_optgroup(L("Tree supports"));
optgroup->append_single_option_line("support_tree_angle", category_path + "tree_angle");
optgroup->append_single_option_line("support_tree_angle_slow", category_path + "tree_angle_slow");
optgroup->append_single_option_line("support_tree_branch_diameter", category_path + "tree_branch_diameter");
optgroup->append_single_option_line("support_tree_branch_diameter_angle", category_path + "tree_branch_diameter_angle");
optgroup->append_single_option_line("support_tree_tip_diameter", category_path + "tree_tip_diameter");
optgroup->append_single_option_line("support_tree_top_rate", category_path + "tree_top_rate");
page = add_options_page(L("Speed"), "time"); page = add_options_page(L("Speed"), "time");
optgroup = page->new_optgroup(L("Speed for print moves")); optgroup = page->new_optgroup(L("Speed for print moves"));
optgroup->append_single_option_line("perimeter_speed"); optgroup->append_single_option_line("perimeter_speed");