From 2b85615b31d24a81e60d3bc46fe6cd4afb75ee3c Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Thu, 6 Apr 2023 16:20:56 +0200 Subject: [PATCH] Fix issue https://github.com/prusa3d/PrusaSlicer/issues/10269 Dynamic overhang speed could sometimes wrongly apply volumtric limits Also, setting speed to zero will now cause the algorithm to use base external perim speed. --- src/libslic3r/GCode.cpp | 13 ++++++++++--- src/libslic3r/GCode/ExtrusionProcessor.hpp | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index e82433d47..b0fdcc015 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3020,9 +3020,16 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de {100, ConfigOptionInts{0}}}; } - double external_perim_reference_speed = std::min(m_config.get_abs_value("external_perimeter_speed"), - std::min(EXTRUDER_CONFIG(filament_max_volumetric_speed) / path.mm3_per_mm, - m_config.max_volumetric_speed.value / path.mm3_per_mm)); + double external_perim_reference_speed = m_config.get_abs_value("external_perimeter_speed"); + if (external_perim_reference_speed == 0) + external_perim_reference_speed = m_volumetric_speed / path.mm3_per_mm; + if (m_config.max_volumetric_speed.value > 0) + external_perim_reference_speed = std::min(external_perim_reference_speed, m_config.max_volumetric_speed.value / path.mm3_per_mm); + if (EXTRUDER_CONFIG(filament_max_volumetric_speed) > 0) { + external_perim_reference_speed = std::min(external_perim_reference_speed, + EXTRUDER_CONFIG(filament_max_volumetric_speed) / path.mm3_per_mm); + } + new_points = m_extrusion_quality_estimator.estimate_extrusion_quality(path, overhangs_with_speeds, overhang_w_fan_speeds, m_writer.extruder()->id(), external_perim_reference_speed, speed); diff --git a/src/libslic3r/GCode/ExtrusionProcessor.hpp b/src/libslic3r/GCode/ExtrusionProcessor.hpp index 1b1748827..625ea695c 100644 --- a/src/libslic3r/GCode/ExtrusionProcessor.hpp +++ b/src/libslic3r/GCode/ExtrusionProcessor.hpp @@ -272,6 +272,7 @@ public: float distance = path.width * (1.0 - (overhangs_w_speeds[i].first / 100.0)); float speed = overhangs_w_speeds[i].second.percent ? (speed_base * overhangs_w_speeds[i].second.value / 100.0) : overhangs_w_speeds[i].second.value; + if (speed < EPSILON) speed = speed_base; speed_sections[distance] = speed; }