From eef077b6ffd09e6370e440ed3ddc660a8255640f Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Tue, 4 Apr 2023 16:06:50 +0200 Subject: [PATCH] Fix issue 10229: When dynamic fan speed is enabled, sometimes the extrusion speed was not reset correctly after travel, resulting in travel speeds used for printing. https://github.com/prusa3d/PrusaSlicer/issues/10229 --- src/libslic3r/GCode.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 79d6d191c..e82433d47 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3083,8 +3083,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de std::string cooling_marker_setspeed_comments; if (m_enable_cooling_markers) { - if (path.role().is_bridge() && - (!path.role().is_perimeter() || !this->config().enable_dynamic_fan_speeds.get_at(m_writer.extruder()->id()))) + if (path.role().is_bridge()) gcode += ";_BRIDGE_FAN_START\n"; else cooling_marker_setspeed_comments = ";_EXTRUDE_SET_SPEED"; @@ -3120,7 +3119,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de double last_set_speed = new_points[0].speed * 60.0; double last_set_fan_speed = new_points[0].fan_speed; gcode += m_writer.set_speed(last_set_speed, "", cooling_marker_setspeed_comments); - gcode += ";_SET_FAN_SPEED" + std::to_string(int(last_set_fan_speed)) + "\n"; + gcode += "\n;_SET_FAN_SPEED" + std::to_string(int(last_set_fan_speed)) + "\n"; Vec2d prev = this->point_to_gcode_quantized(new_points[0].p); for (size_t i = 1; i < new_points.size(); i++) { const ProcessedPoint &processed_point = new_points[i]; @@ -3135,10 +3134,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de } if (last_set_fan_speed != processed_point.fan_speed) { last_set_fan_speed = processed_point.fan_speed; - gcode += ";_SET_FAN_SPEED" + std::to_string(int(last_set_fan_speed)) + "\n"; + gcode += "\n;_SET_FAN_SPEED" + std::to_string(int(last_set_fan_speed)) + "\n"; } } - gcode += ";_RESET_FAN_SPEED\n"; + gcode += "\n;_RESET_FAN_SPEED\n"; } if (m_enable_cooling_markers)