From f682ab5cd3939ed65c5ff043dba780b8da29d828 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Wed, 10 Jun 2026 21:17:47 +0200 Subject: [PATCH] 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 --- src/libslic3r/BuildVolume.cpp | 11 +++++------ src/libslic3r/Print.cpp | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/BuildVolume.cpp b/src/libslic3r/BuildVolume.cpp index 2e194bdd7e..c9e779f9e7 100644 --- a/src/libslic3r/BuildVolume.cpp +++ b/src/libslic3r/BuildVolume.cpp @@ -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; } } diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index b511898ae8..257aa19f1d 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -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()) {