From f43eb35d3873438f8520b27ec68b11324e7f0027 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Tue, 8 Nov 2022 17:54:57 +0800 Subject: [PATCH] ENH: shorten the travel before wipe Signed-off-by: qing.zhang Change-Id: I3b8c3e188aae85ead926c02a3edf8d23379fbcb1 --- src/libslic3r/GCode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 8ec81c520..26f04868a 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3275,7 +3275,12 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou double l2 = v.squaredNorm(); // Shift by no more than a nozzle diameter. //FIXME Hiding the seams will not work nicely for very densely discretized contours! - Point pt = ((nd * nd >= l2) ? p2 : (p1 + v * (nd / sqrt(l2)))).cast(); + //BBS. shorten the travel distant before the wipe path + double threshold = 0.2; + Point pt = (p1 + v * threshold).cast(); + if (nd * nd < l2) + pt = (p1 + threshold * v * (nd / sqrt(l2))).cast(); + //Point pt = ((nd * nd >= l2) ? (p1+v*0.4): (p1 + 0.2 * v * (nd / sqrt(l2)))).cast(); pt.rotate(angle, paths.front().polyline.points.front()); // generate the travel move gcode += m_writer.travel_to_xy(this->point_to_gcode(pt), "move inwards before travel");