diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 3f865601a..f766d5db8 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2946,10 +2946,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de prev = p; } } else { - std::string comment; + std::string marked_comment; if (m_config.gcode_comments) { - comment = description; - comment += description_bridge; + marked_comment = description; + marked_comment += description_bridge; } double last_set_speed = new_points[0].speed * 60.0; gcode += m_writer.set_speed(last_set_speed, "", comment); @@ -2958,7 +2958,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de const ProcessedPoint& processed_point = new_points[i]; Vec2d p = this->point_to_gcode_quantized(processed_point.p); const double line_length = (p - prev).norm(); - gcode += m_writer.extrude_to_xy(p, e_per_mm * line_length, comment); + gcode += m_writer.extrude_to_xy(p, e_per_mm * line_length, marked_comment); prev = p; double new_speed = processed_point.speed * 60.0; if (last_set_speed != new_speed) { diff --git a/src/libslic3r/GCode/ExtrusionProcessor.hpp b/src/libslic3r/GCode/ExtrusionProcessor.hpp index 1525624da..7ce7a77f6 100644 --- a/src/libslic3r/GCode/ExtrusionProcessor.hpp +++ b/src/libslic3r/GCode/ExtrusionProcessor.hpp @@ -264,10 +264,11 @@ public: float original_speed) { size_t speed_sections_count = std::min(overlaps.values.size(), speeds.values.size()); + float speed_base = ext_perimeter_speed > 0 ? ext_perimeter_speed : original_speed; std::vector> speed_sections; for (size_t i = 0; i < speed_sections_count; i++) { float distance = path.width * (1.0 - (overlaps.get_at(i) / 100.0)); - float speed = speeds.get_at(i).percent ? (ext_perimeter_speed * speeds.get_at(i).value / 100.0) : speeds.get_at(i).value; + float speed = speeds.get_at(i).percent ? (speed_base * speeds.get_at(i).value / 100.0) : speeds.get_at(i).value; speed_sections.push_back({distance, speed}); } std::sort(speed_sections.begin(), speed_sections.end(),