From 679638fca37f42fbbedd349976254c2448a501bd Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 8 Oct 2026 13:40:52 -0500 Subject: [PATCH] Belt G-code: correct the first-layer point test comment The comment said the lambda takes off "the instance part" of m_origin. On a belt m_origin has been rotated by on_set_origin() by then, so m_origin minus the plate offset is not the instance shift. Say what the code does: undo what point_to_gcode() added and what the writer took off. Comment only. Reported by raistlin7447 in the review of #14394. Co-Authored-By: Claude Opus 5.5 --- src/libslic3r/GCode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c2db414fc5..d29363e639 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3173,8 +3173,8 @@ 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(); - // 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. + // Undo what point_to_gcode() added (m_origin, minus the extruder offset) and + // what the writer then took off (its XY offset, the plate origin). 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(),