From 4db6923a5af5520e4dde786cf9a4e5ce13bb1d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0ach?= Date: Thu, 4 Jul 2024 15:33:41 +0200 Subject: [PATCH] Fix sequential print --- src/libslic3r/GCode.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 111b43df7e..3ccc2fb7a3 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2563,10 +2563,8 @@ LayerResult GCodeGenerator::process_layer( } } - const Vec3crd point{to_3d(first_point, scaled(print_z))}; - gcode += this->travel_to_first_position(point, print_z, ExtrusionRole::Mixed, [this](){ - return m_writer.multiple_extruders ? "" : m_label_objects.maybe_change_instance(m_writer); - }); + this->set_origin({0, 0}); + bool moved_to_first_point{false}; // Extrude the skirt, brim, support, perimeters, infill ordered by the extruders. for (const ExtruderExtrusions &extruder_extrusions : extrusions) @@ -2586,6 +2584,14 @@ LayerResult GCodeGenerator::process_layer( gcode += ProcessLayer::emit_custom_gcode_per_print_z(*this, *layer_tools.custom_gcode, m_writer.extruder()->id(), first_extruder_id, print.config()); } + if (!moved_to_first_point) { + const Vec3crd point{to_3d(first_point, scaled(print_z))}; + gcode += this->travel_to_first_position(point, print_z, ExtrusionRole::Mixed, [this](){ + return m_writer.multiple_extruders ? "" : m_label_objects.maybe_change_instance(m_writer); + }); + moved_to_first_point = true; + } + if (!extruder_extrusions.skirt.empty()) { if (!this->m_config.complete_objects.value) { gcode += this->m_label_objects.maybe_stop_instance();