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.
This commit is contained in:
harrierpigeon
2026-10-03 19:19:02 -05:00
parent 6a0d07664f
commit 69e7cc1544
+12 -2
View File
@@ -1518,8 +1518,18 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
});
m_paths_bounding_box = BoundingBoxf3(libvgcode::convert(bbox[0]).cast<double>(), libvgcode::convert(bbox[1]).cast<double>());
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;