From 4eaaf9a992974108b37471591344e4ee9ae69291 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 7 Oct 2026 16:09:25 -0500 Subject: [PATCH] Belt G-code: first-layer speed test subtracts the instance offset only The writer hands set_first_layer_point_test() a point with the plate origin (its own XY offset) already removed, but the test subtracted the whole of m_origin, which carries the plate origin as well as the instance shift. On a plate other than the first the point was moved by the plate origin a second time and the band test looked at the wrong spot. Subtract only the part of m_origin that is not the writer's offset. Co-Authored-By: Claude Fable 5.1 --- src/libslic3r/GCode.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c96d299211..6f4c15561f 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3192,8 +3192,11 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato if (print.config().belt_printer.value) { m_writer.set_first_layer_point_test([this](const Vec3d &point_logical) { const Vec2d extruder_offset = m_writer.filament() != nullptr ? EXTRUDER_CONFIG(extruder_offset) : Vec2d::Zero(); - return this->on_first_layer(Vec3d(point_logical.x() - m_origin.x() + extruder_offset.x(), - point_logical.y() - m_origin.y() + extruder_offset.y(), + // The writer hands over the point with the plate origin (its XY offset) already + // taken off, while m_origin still carries it: take off the instance part only. + const Vec2d plate_offset = m_writer.get_xy_offset().cast(); + return this->on_first_layer(Vec3d(point_logical.x() - (m_origin.x() - plate_offset.x()) + extruder_offset.x(), + point_logical.y() - (m_origin.y() - plate_offset.y()) + extruder_offset.y(), point_logical.z())); }); }