From beabf46e871dcc40a593f4d87daa968aabce5730 Mon Sep 17 00:00:00 2001 From: Pavel Mikus Date: Wed, 22 Feb 2023 11:01:12 +0100 Subject: [PATCH] Set cooling markers correctly - finally fix of cooperation between dynamic speed and pressure equalizer Fixes the following issues: 9769, 9485 and maybe others where presusre equalier is used with dynamic speeds --- src/libslic3r/GCode.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 460ddc111..7088a158d 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2930,19 +2930,19 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de + float_to_string_decimal_point(m_last_height) + "\n"; } - std::string comment; + std::string cooling_marker_setspeed_comments; if (m_enable_cooling_markers) { if (path.role().is_bridge()) gcode += ";_BRIDGE_FAN_START\n"; else - comment = ";_EXTRUDE_SET_SPEED"; + cooling_marker_setspeed_comments = ";_EXTRUDE_SET_SPEED"; if (path.role() == ExtrusionRole::ExternalPerimeter) - comment += ";_EXTERNAL_PERIMETER"; + cooling_marker_setspeed_comments += ";_EXTERNAL_PERIMETER"; } if (!variable_speed) { // F is mm per minute. - gcode += m_writer.set_speed(F, "", comment); + gcode += m_writer.set_speed(F, "", cooling_marker_setspeed_comments); double path_length = 0.; std::string comment; if (m_config.gcode_comments) { @@ -2966,7 +2966,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de marked_comment += description_bridge; } double last_set_speed = new_points[0].speed * 60.0; - gcode += m_writer.set_speed(last_set_speed, "", comment); + gcode += m_writer.set_speed(last_set_speed, "", cooling_marker_setspeed_comments); 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]; @@ -2976,7 +2976,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de prev = p; double new_speed = processed_point.speed * 60.0; if (last_set_speed != new_speed) { - gcode += m_writer.set_speed(new_speed, "", comment); + gcode += m_writer.set_speed(new_speed, "", cooling_marker_setspeed_comments); last_set_speed = new_speed; } }