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 <noreply@anthropic.com>
This commit is contained in:
harrierpigeon
2026-10-07 18:24:27 -05:00
co-authored by Claude Fable 5.1
parent 54e079ae25
commit 4eaaf9a992
+5 -2
View File
@@ -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<double>();
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()));
});
}