mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-30 21:42:02 -06:00
Allow user to turn adaptive layer height for tree support.
Signed-off-by: SoftFever <softfeverever@gmail.com> #257
This commit is contained in:
parent
6ed219fb65
commit
a6cd32fe72
11 changed files with 32 additions and 15 deletions
|
@ -753,7 +753,8 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
"default_jerk", "outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk","travel_jerk",
|
||||
"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"
|
||||
"bridge_density", "precise_outer_wall", "overhang_speed_classic", "bridge_acceleration",
|
||||
"sparse_infill_acceleration", "internal_solid_infill_acceleration", "tree_support_adaptive_layer_height"
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -2994,6 +2994,12 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(5.));
|
||||
|
||||
def = this->add("tree_support_adaptive_layer_height", coBool);
|
||||
def->label = L("Adaptive layer height");
|
||||
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_branch_diameter", coFloat);
|
||||
def->label = L("Tree support branch diameter");
|
||||
def->category = L("Support");
|
||||
|
|
|
@ -679,6 +679,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
((ConfigOptionFloat, tree_support_branch_diameter))
|
||||
((ConfigOptionFloat, tree_support_branch_angle))
|
||||
((ConfigOptionInt, tree_support_wall_count))
|
||||
((ConfigOptionBool, tree_support_adaptive_layer_height))
|
||||
((ConfigOptionBool, detect_narrow_internal_solid_infill))
|
||||
// ((ConfigOptionBool, adaptive_layer_height))
|
||||
((ConfigOptionFloat, support_bottom_interface_spacing))
|
||||
|
|
|
@ -756,6 +756,7 @@ bool PrintObject::invalidate_state_by_config_options(
|
|||
|| opt_key == "bridge_no_support"
|
||||
|| opt_key == "max_bridge_length"
|
||||
|| opt_key == "initial_layer_line_width"
|
||||
|| opt_key == "tree_support_adaptive_layer_height"
|
||||
|| opt_key == "tree_support_branch_distance"
|
||||
|| opt_key == "tree_support_branch_diameter"
|
||||
|| opt_key == "tree_support_branch_angle"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#define _L(s) Slic3r::I18N::translate(s)
|
||||
|
||||
#define USE_PLAN_LAYER_HEIGHTS 1
|
||||
#define HEIGHT_TO_SWITCH_INFILL_DIRECTION 30 // change infill direction every 20mm
|
||||
|
||||
#ifndef M_PI
|
||||
|
@ -1917,10 +1916,10 @@ void TreeSupport::generate_support_areas()
|
|||
|
||||
smooth_nodes(contact_nodes);
|
||||
|
||||
#if !USE_PLAN_LAYER_HEIGHTS
|
||||
// Adjust support layer heights
|
||||
adjust_layer_heights(contact_nodes);
|
||||
#endif
|
||||
if (!m_object->config().tree_support_adaptive_layer_height)
|
||||
// Adjust support layer heights
|
||||
adjust_layer_heights(contact_nodes);
|
||||
|
||||
|
||||
//Generate support areas.
|
||||
profiler.stage_start(STAGE_DRAW_CIRCLES);
|
||||
|
@ -3209,7 +3208,7 @@ std::vector<std::pair<coordf_t, coordf_t>> TreeSupport::plan_layer_heights(std::
|
|||
std::vector<std::pair<coordf_t, coordf_t>> layer_heights(contact_nodes.size(), std::pair<coordf_t, coordf_t>(0.0, 0.0));
|
||||
std::vector<int> bounds;
|
||||
|
||||
if (!USE_PLAN_LAYER_HEIGHTS || layer_height == max_layer_height || !print_config.independent_support_layer_height) {
|
||||
if (!config.tree_support_adaptive_layer_height || layer_height == max_layer_height || !print_config.independent_support_layer_height) {
|
||||
for (int layer_nr = 0; layer_nr < contact_nodes.size(); layer_nr++) {
|
||||
layer_heights[layer_nr].first = m_object->get_layer(layer_nr)->print_z;
|
||||
layer_heights[layer_nr].second = m_object->get_layer(layer_nr)->height;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue