Enhancement: ERS - Option to limit ERS to external perimeters and overhangs only (#7399)

* Option to limit ERS to external perimeters and overhangs only

* Label name

* Label update

* Merge branch 'main' into Limit-ERS-to-external-perimeters-and-overhangs

* Merge branch 'main' into Limit-ERS-to-external-perimeters-and-overhangs

* Merge branch 'SoftFever:main' into Limit-ERS-to-external-perimeters-and-overhangs

* Merge branch 'SoftFever:main' into Limit-ERS-to-external-perimeters-and-overhangs

* Merge branch 'main' into Limit-ERS-to-external-perimeters-and-overhangs

* Merge branch 'SoftFever:main' into Limit-ERS-to-external-perimeters-and-overhangs

* Merge branch 'main' into Limit-ERS-to-external-perimeters-and-overhangs

* Merge branch 'SoftFever:main' into Limit-ERS-to-external-perimeters-and-overhangs

* Merge branch 'main' into Limit-ERS-to-external-perimeters-and-overhangs
This commit is contained in:
Ioannis Giannakas 2025-01-05 15:19:00 +00:00 committed by GitHub
parent 67cc143916
commit bb009eaa99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 23 additions and 3 deletions

View file

@ -62,6 +62,7 @@ PressureEqualizer::PressureEqualizer(const Slic3r::GCodeConfig &config) : m_use_
m_max_volumetric_extrusion_rate_slope_positive = float(config.max_volumetric_extrusion_rate_slope.value) * 60.f * 60.f;
m_max_volumetric_extrusion_rate_slope_negative = float(config.max_volumetric_extrusion_rate_slope.value) * 60.f * 60.f;
m_max_segment_length = float(config.max_volumetric_extrusion_rate_slope_segment_length.value);
m_extrusion_rate_smoothing_external_perimeter_only = bool(config.extrusion_rate_smoothing_external_perimeter_only.value);
}
for (ExtrusionRateSlope &extrusion_rate_slope : m_max_volumetric_extrusion_rate_slopes) {
@ -629,7 +630,9 @@ void PressureEqualizer::adjust_volumetric_rate(const size_t fist_line_idx, const
rate_end = rate_succ;
// don't alter the flow rate for these extrusion types
if (!line.adjustable_flow || line.extrusion_role == ExtrusionRole::erBridgeInfill || line.extrusion_role == ExtrusionRole::erIroning) {
// Orca: Limit ERS to external perimeters and overhangs if option selected by user
if (!line.adjustable_flow || line.extrusion_role == ExtrusionRole::erBridgeInfill || line.extrusion_role == ExtrusionRole::erIroning ||
(m_extrusion_rate_smoothing_external_perimeter_only && line.extrusion_role != ExtrusionRole::erOverhangPerimeter && line.extrusion_role != ExtrusionRole::erExternalPerimeter)) {
rate_end = line.volumetric_extrusion_rate_end;
} else if (line.volumetric_extrusion_rate_end > rate_end) {
line.volumetric_extrusion_rate_end = rate_end;
@ -684,10 +687,13 @@ void PressureEqualizer::adjust_volumetric_rate(const size_t fist_line_idx, const
float rate_start = feedrate_per_extrusion_role[iRole];
// don't alter the flow rate for these extrusion types
if (!line.adjustable_flow || line.extrusion_role == ExtrusionRole::erBridgeInfill || line.extrusion_role == ExtrusionRole::erIroning) {
// Orca: Limit ERS to external perimeters and overhangs if option selected by user
if (!line.adjustable_flow || line.extrusion_role == ExtrusionRole::erBridgeInfill || line.extrusion_role == ExtrusionRole::erIroning ||
(m_extrusion_rate_smoothing_external_perimeter_only && line.extrusion_role != ExtrusionRole::erOverhangPerimeter && line.extrusion_role != ExtrusionRole::erExternalPerimeter)) {
rate_start = line.volumetric_extrusion_rate_start;
} else if (iRole == size_t(line.extrusion_role) && rate_prec < rate_start)
rate_start = rate_prec;
if (line.volumetric_extrusion_rate_start > rate_start) {
line.volumetric_extrusion_rate_start = rate_start;
line.max_volumetric_extrusion_rate_slope_positive = rate_slope;

View file

@ -84,6 +84,9 @@ private:
// Smaller value means a smoother transition between two different flow rates.
float m_max_segment_length;
// Apply ERS only on external perimeters and overhangs
bool m_extrusion_rate_smoothing_external_perimeter_only;
// Indicate if extrude set speed block was opened using the tag ";_EXTRUDE_SET_SPEED"
// or not (not opened, or it was closed using the tag ";_EXTRUDE_END").
bool opened_extrude_set_speed_block = false;

View file

@ -770,7 +770,7 @@ static std::vector<std::string> s_Preset_print_options {
"ironing_type", "ironing_pattern", "ironing_flow", "ironing_speed", "ironing_spacing", "ironing_angle",
"max_travel_detour_distance",
"fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_distance", "fuzzy_skin_first_layer",
"max_volumetric_extrusion_rate_slope", "max_volumetric_extrusion_rate_slope_segment_length",
"max_volumetric_extrusion_rate_slope", "max_volumetric_extrusion_rate_slope_segment_length","extrusion_rate_smoothing_external_perimeter_only",
"inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed",
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
"bridge_speed", "internal_bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed",

View file

@ -144,6 +144,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"slow_down_min_speed",
"max_volumetric_extrusion_rate_slope",
"max_volumetric_extrusion_rate_slope_segment_length",
"extrusion_rate_smoothing_external_perimeter_only",
"reduce_infill_retraction",
"filename_format",
"retraction_minimum_travel",

View file

@ -3356,6 +3356,13 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(3));
def = this->add("extrusion_rate_smoothing_external_perimeter_only", coBool);
def->label = L("Apply only on external features");
def->tooltip = L("Applies extrusion rate smoothing only on external perimeters and overhangs. This can help reduce artefacts due to sharp speed transitions on externally visible "
"overhangs without impacting the print speed of features that will not be visible to the user.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("fan_min_speed", coFloats);
def->label = L("Fan speed");
def->tooltip = L("Minimum speed for part cooling fan");

View file

@ -1092,6 +1092,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, max_volumetric_extrusion_rate_slope))
((ConfigOptionInt, max_volumetric_extrusion_rate_slope_segment_length))
((ConfigOptionBool, extrusion_rate_smoothing_external_perimeter_only))
((ConfigOptionPercents, retract_before_wipe))
((ConfigOptionFloats, retraction_length))

View file

@ -497,6 +497,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
int have_volumetric_extrusion_rate_slope_segment_length = config->option<ConfigOptionInt>("max_volumetric_extrusion_rate_slope_segment_length")->value;
toggle_field("enable_arc_fitting", !have_volumetric_extrusion_rate_slope);
toggle_line("max_volumetric_extrusion_rate_slope_segment_length", have_volumetric_extrusion_rate_slope);
toggle_line("extrusion_rate_smoothing_external_perimeter_only", have_volumetric_extrusion_rate_slope);
if(have_volumetric_extrusion_rate_slope) config->set_key_value("enable_arc_fitting", new ConfigOptionBool(false));
if(have_volumetric_extrusion_rate_slope_segment_length==0) {
DynamicPrintConfig new_conf = *config;

View file

@ -2215,6 +2215,7 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced", 15);
optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope", "extrusion-rate-smoothing");
optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_segment_length", "extrusion-rate-smoothing");
optgroup->append_single_option_line("extrusion_rate_smoothing_external_perimeter_only", "extrusion-rate-smoothing");
page = add_options_page(L("Support"), "custom-gcode_support"); // ORCA: icon only visible on placeholders
optgroup = page->new_optgroup(L("Support"), L"param_support");