mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-05 16:51:07 -07:00
Made this as an option in the GUI
This commit is contained in:
parent
8a7c6a297a
commit
7d14ac9e03
8 changed files with 84 additions and 33 deletions
|
|
@ -4530,39 +4530,72 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
|||
|
||||
if (m_config.enable_overhang_speed && !m_config.overhang_speed_classic && !this->on_first_layer() &&
|
||||
( is_perimeter(path.role()))) {
|
||||
double out_wall_ref_speed = m_config.get_abs_value("outer_wall_speed");
|
||||
ConfigOptionPercents overhang_overlap_levels({75, 50, 25, 13, 12.99, 0});
|
||||
ConfigOptionFloatsOrPercents dynamic_overhang_speeds(
|
||||
{(m_config.get_abs_value("overhang_1_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_1_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_2_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_2_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_3_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_3_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_4_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_4_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_4_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_4_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_4_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_4_4_speed") * 100 / out_wall_ref_speed, true}});
|
||||
|
||||
double out_wall_ref_speed = m_config.get_abs_value("outer_wall_speed");
|
||||
ConfigOptionPercents overhang_overlap_levels({75, 50, 25, 13, 12.99, 0});
|
||||
|
||||
if (out_wall_ref_speed == 0)
|
||||
out_wall_ref_speed = EXTRUDER_CONFIG(filament_max_volumetric_speed) / _mm3_per_mm;
|
||||
if (m_config.slowdown_for_curled_perimeters){
|
||||
ConfigOptionFloatsOrPercents dynamic_overhang_speeds(
|
||||
{(m_config.get_abs_value("overhang_1_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_1_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_2_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_2_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_3_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_3_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_4_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_4_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_4_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_4_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_4_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_4_4_speed") * 100 / out_wall_ref_speed, true}});
|
||||
if (out_wall_ref_speed == 0)
|
||||
out_wall_ref_speed = EXTRUDER_CONFIG(filament_max_volumetric_speed) / _mm3_per_mm;
|
||||
|
||||
if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) {
|
||||
out_wall_ref_speed = std::min(out_wall_ref_speed, EXTRUDER_CONFIG(filament_max_volumetric_speed) / path.mm3_per_mm);
|
||||
}
|
||||
if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) {
|
||||
out_wall_ref_speed = std::min(out_wall_ref_speed, EXTRUDER_CONFIG(filament_max_volumetric_speed) / path.mm3_per_mm);
|
||||
}
|
||||
|
||||
new_points = m_extrusion_quality_estimator.estimate_extrusion_quality(path, overhang_overlap_levels, dynamic_overhang_speeds,
|
||||
out_wall_ref_speed, speed);
|
||||
new_points = m_extrusion_quality_estimator.estimate_extrusion_quality(path, overhang_overlap_levels, dynamic_overhang_speeds,
|
||||
out_wall_ref_speed, speed, true);
|
||||
|
||||
variable_speed = std::any_of(new_points.begin(), new_points.end(), [speed](const ProcessedPoint &p) { return p.speed != speed; });
|
||||
|
||||
}else{
|
||||
ConfigOptionFloatsOrPercents dynamic_overhang_speeds(
|
||||
{(m_config.get_abs_value("overhang_1_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_1_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_2_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_2_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_3_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_3_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
(m_config.get_abs_value("overhang_4_4_speed") < 0.5) ?
|
||||
FloatOrPercent{100, true} :
|
||||
FloatOrPercent{m_config.get_abs_value("overhang_4_4_speed") * 100 / out_wall_ref_speed, true},
|
||||
FloatOrPercent{m_config.get_abs_value("bridge_speed") * 100 / out_wall_ref_speed, true},
|
||||
FloatOrPercent{m_config.get_abs_value("bridge_speed") * 100 / out_wall_ref_speed, true}});
|
||||
|
||||
if (out_wall_ref_speed == 0)
|
||||
out_wall_ref_speed = EXTRUDER_CONFIG(filament_max_volumetric_speed) / _mm3_per_mm;
|
||||
|
||||
if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) {
|
||||
out_wall_ref_speed = std::min(out_wall_ref_speed, EXTRUDER_CONFIG(filament_max_volumetric_speed) / path.mm3_per_mm);
|
||||
}
|
||||
|
||||
new_points = m_extrusion_quality_estimator.estimate_extrusion_quality(path, overhang_overlap_levels, dynamic_overhang_speeds,
|
||||
out_wall_ref_speed, speed, false);
|
||||
|
||||
variable_speed = std::any_of(new_points.begin(), new_points.end(), [speed](const ProcessedPoint &p) { return p.speed != speed; });
|
||||
}
|
||||
|
||||
variable_speed = std::any_of(new_points.begin(), new_points.end(), [speed](const ProcessedPoint &p) { return p.speed != speed; });
|
||||
}
|
||||
|
||||
double F = speed * 60; // convert mm/sec to mm/min
|
||||
|
|
|
|||
|
|
@ -268,11 +268,14 @@ public:
|
|||
const ConfigOptionPercents &overlaps,
|
||||
const ConfigOptionFloatsOrPercents &speeds,
|
||||
float ext_perimeter_speed,
|
||||
float original_speed)
|
||||
float original_speed,
|
||||
bool slowdown_for_curled_edges)
|
||||
{
|
||||
size_t speed_sections_count = std::min(overlaps.values.size(), speeds.values.size());
|
||||
std::vector<std::pair<float, float>> speed_sections;
|
||||
|
||||
|
||||
|
||||
for (size_t i = 0; i < speed_sections_count; i++) {
|
||||
float distance = path.width * (1.0 - (overlaps.get_at(i) / 100.0));
|
||||
float speed = speeds.get_at(i).percent ? (ext_perimeter_speed * speeds.get_at(i).value / 100.0) : speeds.get_at(i).value;
|
||||
|
|
@ -371,8 +374,10 @@ public:
|
|||
};
|
||||
|
||||
float extrusion_speed = std::min(calculate_speed(curr.distance), calculate_speed(next.distance));
|
||||
float curled_speed = calculate_speed(artificial_distance_to_curled_lines);
|
||||
extrusion_speed = std::min(curled_speed, extrusion_speed); // adjust extrusion speed based on what is smallest - the calculated overhang speed or the artificial curled speed
|
||||
if(slowdown_for_curled_edges) {
|
||||
float curled_speed = calculate_speed(artificial_distance_to_curled_lines);
|
||||
extrusion_speed = std::min(curled_speed, extrusion_speed); // adjust extrusion speed based on what is smallest - the calculated overhang speed or the artificial curled speed
|
||||
}
|
||||
|
||||
float overlap = std::min(1 - curr.distance * width_inv, 1 - next.distance * width_inv);
|
||||
|
||||
|
|
|
|||
|
|
@ -752,7 +752,7 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
"tree_support_branch_diameter", "tree_support_branch_diameter_angle", "tree_support_branch_diameter_double_wall",
|
||||
"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",
|
||||
"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",
|
||||
"initial_layer_infill_speed", "only_one_wall_top",
|
||||
"timelapse_type", "internal_bridge_support_thickness",
|
||||
"wall_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle",
|
||||
|
|
|
|||
|
|
@ -800,6 +800,13 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("Enable this option to slow printing down for different overhang degree");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool{ true });
|
||||
|
||||
def = this->add("slowdown_for_curled_perimeters", coBool);
|
||||
def->label = L("Slow down at curled perimeters");
|
||||
def->category = L("Speed");
|
||||
def->tooltip = L("Enable this option to slow printing down in areas where potential curled perimeters may exist");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool{ true });
|
||||
|
||||
def = this->add("overhang_1_4_speed", coFloatOrPercent);
|
||||
def->label = "(10%, 25%)";
|
||||
|
|
|
|||
|
|
@ -812,6 +812,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
// Orca
|
||||
((ConfigOptionBool, make_overhang_printable))
|
||||
((ConfigOptionBool, extra_perimeters_on_overhangs))
|
||||
((ConfigOptionBool, slowdown_for_curled_perimeters))
|
||||
)
|
||||
|
||||
PRINT_CONFIG_CLASS_DEFINE(
|
||||
|
|
|
|||
|
|
@ -775,6 +775,7 @@ bool PrintObject::invalidate_state_by_config_options(
|
|||
|| opt_key == "raft_contact_distance"
|
||||
|| opt_key == "slice_closing_radius"
|
||||
|| opt_key == "slicing_mode"
|
||||
|| opt_key == "slowdown_for_curled_perimeters"
|
||||
|| opt_key == "make_overhang_printable"
|
||||
|| opt_key == "make_overhang_printable_angle"
|
||||
|| opt_key == "make_overhang_printable_hole_size") {
|
||||
|
|
|
|||
|
|
@ -692,6 +692,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
// Orca
|
||||
auto is_role_based_wipe_speed = config->opt_bool("role_based_wipe_speed");
|
||||
toggle_field("wipe_speed",!is_role_based_wipe_speed);
|
||||
// Orca
|
||||
bool has_slowdown_for_curled_perimeters = config->opt_bool("slowdown_for_curled_perimeters");
|
||||
//toggle_field("slowdown_for_curled_perimeters",has_slowdown_for_curled_perimeters);
|
||||
|
||||
for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"})
|
||||
toggle_line(el, gcflavor == gcfKlipper);
|
||||
|
|
|
|||
|
|
@ -1957,6 +1957,7 @@ void TabPrint::build()
|
|||
optgroup = page->new_optgroup(L("Overhang speed"), L"param_speed", 15);
|
||||
optgroup->append_single_option_line("enable_overhang_speed", "slow-down-for-overhang");
|
||||
optgroup->append_single_option_line("overhang_speed_classic", "slow-down-for-overhang");
|
||||
optgroup->append_single_option_line("slowdown_for_curled_perimeters");
|
||||
Line line = { L("Overhang speed"), L("This is the speed for various overhang degrees. Overhang degrees are expressed as a percentage of line width. 0 speed means no slowing down for the overhang degree range and wall speed is used") };
|
||||
line.label_path = "slow-down-for-overhang";
|
||||
line.append_option(optgroup->get_option("overhang_1_4_speed"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue