belt: replace height-check skip with a belt-correct vertical-clearance check

The original PR skipped the max-print-height check entirely on belt printers
because the sliced (virtual) Z is belt travel, not build height. As the reviewer
noted, that removed the only working height guard. Restore a correct guard:

- Print::validate: on belt printers, compare the upright object height
  (max over instances of the scene-space bbox) against printable_height directly.
  printable_height is the usable VERTICAL clearance above the belt: the gantry
  travels up the tilted plane (reach = height/cos(tilt)) and its axis range is
  sized for that (IR3 V2: ~354 mm gantry travel = 250 mm vertical at 45deg, and
  printable_height = 250). Hardware-confirmed 250 mm vertical clearance, so no
  cos(tilt) factor is applied.
- BuildVolume::set_belt_printer: drop the diagonal Z scaling; the build-volume Z
  already equals printable_height, keeping the live 'outside build volume'
  highlight in agreement with validate().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tommaso Bianchi
2026-06-10 21:17:47 +02:00
parent 2bcb775b90
commit f682ab5cd3
2 changed files with 27 additions and 6 deletions

View File

@@ -193,12 +193,11 @@ void BuildVolume::set_belt_printer(bool enabled, double angle_deg, bool infinite
// Extend the Y bound to a very large value for infinite belt.
m_bboxf.max.y() = 100000.;
}
// Adjust max print height to diagonal reach: printable_height / sin(belt_angle).
if (angle_deg > 0. && angle_deg < 90.) {
double sin_a = std::sin(angle_deg * M_PI / 180.0);
if (sin_a > 0.)
m_bboxf.max.z() = m_max_print_height / sin_a;
}
// Belt printer: the Z extent already equals printable_height (set above), which
// is the usable vertical clearance above the belt. The gantry's axis range is
// sized to reach height/cos(tilt), so no diagonal scaling is applied here — this
// keeps the live "outside build volume" highlight in agreement with Print::validate().
(void) angle_deg;
}
}

View File

@@ -1406,6 +1406,28 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
// Checks that the print does not exceed the max print height
for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx) {
const PrintObject &print_object = *m_objects[print_object_idx];
// Belt printer: the sliced (virtual) Z is belt travel along the conveyor, not
// build height, so the loop below (which measures the sliced layer stack) is
// meaningless here. The real ceiling is the usable vertical clearance above the
// belt, which printable_height holds directly: the gantry travels up the tilted
// plane, so a part of height z needs gantry reach z / cos(tilt), and the machine's
// gantry-axis range is sized to accommodate that (e.g. IdeaFormer IR3 V2: ~354 mm
// of gantry travel = 250 mm vertical at 45°, and printable_height = 250). So compare
// the upright object height against printable_height directly.
if (m_config.belt_printer.value) {
const double max_h = m_config.printable_height.value;
double obj_top = 0.0;
const ModelObject *mo = print_object.model_object();
for (const ModelInstance *mi : mo->instances)
obj_top = std::max(obj_top, mo->instance_bounding_box(*mi).max.z());
if (obj_top > max_h + EPSILON)
return StringObjectException{
Slic3r::format(_u8L("The object %1% exceeds the maximum printable height "
"above the belt (%2% mm)."),
print_object.model_object()->name, max_h),
print_object.model_object(), "" };
continue;
}
//FIXME It is quite expensive to generate object layers just to get the print height!
if (auto layers = generate_object_layers(print_object.slicing_parameters(), layer_height_profile(print_object_idx), print_object.config().precise_z_height.value);
!layers.empty()) {