From 69e7cc1544c2ae7be32fdf39e2aee6667ee9fc7b Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 19:19:02 -0500 Subject: [PATCH] Preview: judge a belt print's toolpaths by their back-transformed box all_paths_inside() accepts the path bounding box only within 3*EPSILON of the bed and otherwise tests every move; a belt print's moves are machine-frame coordinates whose Z is belt travel, so that test can never pass, and the designed view's min-corner anchor leaves the box a fraction of a millimetre below zero. Every multi-object belt plate therefore reported a path beyond the plate. The belt preview now judges the back-transformed box with a millimetre of room. --- src/slic3r/GUI/GCodeViewer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index d34b8c2c63..89bc7e3fab 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1518,8 +1518,18 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const }); m_paths_bounding_box = BoundingBoxf3(libvgcode::convert(bbox[0]).cast(), libvgcode::convert(bbox[1]).cast()); - if (wxGetApp().is_editor()) - m_contained_in_bed = wxGetApp().plater()->build_volume().all_paths_inside(gcode_result, m_paths_bounding_box); + if (wxGetApp().is_editor()) { + if (is_belt) { + // The moves are machine-frame coordinates (Z is belt travel), so the per-move + // test inside all_paths_inside() can never pass on a belt. Judge the + // back-transformed box instead, with room for the designed view's min-corner + // anchor, which is only accurate to a fraction of a millimetre. + BoundingBoxf3 bed = wxGetApp().plater()->build_volume().bounding_volume(); + bed.offset(1.); + m_contained_in_bed = !m_paths_bounding_box.defined || (bed.contains(m_paths_bounding_box.min) && bed.contains(m_paths_bounding_box.max)); + } else + m_contained_in_bed = wxGetApp().plater()->build_volume().all_paths_inside(gcode_result, m_paths_bounding_box); + } m_extruders_count = gcode_result.filaments_count;