From a6f0bd4d28c4a26288f8fe9c33f017c9e8c37286 Mon Sep 17 00:00:00 2001 From: SoftFever <103989404+SoftFever@users.noreply.github.com> Date: Mon, 16 Jan 2023 20:59:10 +0800 Subject: [PATCH] Allow 100% retract before wipe Signed-off-by: SoftFever <103989404+SoftFever@users.noreply.github.com> --- src/libslic3r/GCode.cpp | 4 +++- src/libslic3r/GCodeWriter.cpp | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 7842f7f4dc..daa95e0bb3 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -180,7 +180,9 @@ bool GCode::gcode_label_objects = true; // Shorten the retraction length by the amount already retracted before wipe. length *= (1. - gcodegen.writer().extruder()->retract_before_wipe()); - if (length > 0) { + //SoftFever: allow 100% retract before wipe +// if (length > 0) + { /* Calculate how long we need to travel in order to consume the required amount of retraction. In other words, how far do we move in XY at wipe_speed for the time needed to consume retraction_length at retraction_speed? */ diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 0b58d9fbe7..2ebfc181fc 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -504,6 +504,9 @@ std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std: { m_pos(0) = point(0); m_pos(1) = point(1); + if(std::abs(dE) <= std::numeric_limits::epsilon()) + force_no_extrusion = true; + if (!force_no_extrusion) m_extruder->extrude(dE);