From 016103dd95a7a2d8455c4d5fa90f3921e2526b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Tue, 27 Aug 2024 13:50:44 +0200 Subject: [PATCH] SPE-2455: Fix extrusions with the zero feedrate after passing through CoolingBuffer. --- src/libslic3r/GCode/CoolingBuffer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index 1a52e22aaa..f0d717e4cb 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -298,13 +298,18 @@ float new_feedrate_to_reach_time_stretch( } } } + + // Handle cases when all lines have feedrate below or equal to min_feedrate + // or when the accumulated sum of time is a very small number. assert(denom > 0); - if (denom <= 0) + if (nomin <= 0 || denom <= EPSILON) return min_feedrate; + new_feedrate = nomin / denom; assert(new_feedrate > min_feedrate - EPSILON); if (new_feedrate < min_feedrate + EPSILON) goto finished; + for (auto it = it_begin; it != it_end; ++ it) for (size_t i = 0; i < (*it)->n_lines_adjustable; ++i) { const CoolingLine &line = (*it)->lines[i];