From 413241fcbc936a1e6c565c1d58fb8943c595c65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Thu, 4 Jan 2024 14:44:30 +0100 Subject: [PATCH] Remove unused variable path_length from GCodeGenerator::_extrude(). This variable hasn't been used since the beginning. --- src/libslic3r/GCode.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 8853ad9ce6..30df60c786 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3142,7 +3142,7 @@ std::string GCodeGenerator::_extrude( gcode += m_writer.set_speed(F, "", cooling_marker_setspeed_comments); if (dynamic_speed_and_fan_speed.second >= 0) gcode += ";_SET_FAN_SPEED" + std::to_string(int(dynamic_speed_and_fan_speed.second)) + "\n"; - double path_length = 0.; + std::string comment; if (m_config.gcode_comments) { comment = description; @@ -3176,16 +3176,13 @@ std::string GCodeGenerator::_extrude( } if (radius == 0) { // Extrude line segment. - if (const double line_length = (p - prev).norm(); line_length > 0) { - path_length += line_length; + if (const double line_length = (p - prev).norm(); line_length > 0) gcode += m_writer.extrude_to_xy(p, e_per_mm * line_length, comment); - } } else { double angle = Geometry::ArcWelder::arc_angle(prev.cast(), p.cast(), double(radius)); assert(angle > 0); const double line_length = angle * std::abs(radius); - path_length += line_length; - const double dE = e_per_mm * line_length; + const double dE = e_per_mm * line_length; assert(dE > 0); gcode += m_writer.extrude_to_xy_G2G3IJ(p, ij, it->ccw(), dE, comment); }