Make sure the "avoid crossing perimeters" class is resetted

at the start of G-code export.
This commit is contained in:
bubnikv 2019-08-26 09:55:00 +02:00
parent 972b7d2d6b
commit 9cbfe8f5ef
2 changed files with 2 additions and 0 deletions

View file

@ -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();

View file

@ -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<MotionPlanner>(islands); }