From 9cbfe8f5ef6f24ea88f8cdb74dcf866bfd98028d Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 26 Aug 2019 09:55:00 +0200 Subject: [PATCH] Make sure the "avoid crossing perimeters" class is resetted at the start of G-code export. --- src/libslic3r/GCode.cpp | 1 + src/libslic3r/GCode.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 5ff8c4dce..de43bfaec 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1012,6 +1012,7 @@ void GCode::_do_export(Print &print, FILE *file) _write(file, this->preamble()); // Initialize a motion planner for object-to-object travel moves. + m_avoid_crossing_perimeters.reset(); if (print.config().avoid_crossing_perimeters.value) { m_avoid_crossing_perimeters.init_external_mp(print); print.throw_if_canceled(); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 4baf000f3..83d61c483 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -45,6 +45,7 @@ public: AvoidCrossingPerimeters() : use_external_mp(false), use_external_mp_once(false), disable_once(true) {} ~AvoidCrossingPerimeters() {} + void reset() { m_external_mp.reset(); m_layer_mp.reset(); } void init_external_mp(const Print &print); void init_layer_mp(const ExPolygons &islands) { m_layer_mp = Slic3r::make_unique(islands); }