From 5998bcc747ada28f1eb043cb8fed5fa8d4eec796 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Mon, 30 Oct 2023 18:02:53 +0800 Subject: [PATCH] FIX: When the calibration line exceeds the range of the heatbed Prompt user to modify parameters Jira: 4951 Change-Id: Id856c50fa999c188c403f428e7bfd874ddcca04c --- src/slic3r/Utils/CalibUtils.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/slic3r/Utils/CalibUtils.cpp b/src/slic3r/Utils/CalibUtils.cpp index fa34b1a6e..edd0575a7 100644 --- a/src/slic3r/Utils/CalibUtils.cpp +++ b/src/slic3r/Utils/CalibUtils.cpp @@ -840,6 +840,16 @@ void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f plate_size[1] = bedfs[2].y() - bedfs[0].y(); plate_size[2] = print_height; + if (params.mode == CalibMode::Calib_PA_Line) { + double space_y = 3.5; + int max_line_nums = int(plate_size[1] - 10) / space_y; + int count = std::llround(std::ceil((params.end - params.start) / params.step)); + if (count > max_line_nums) { + error_message = _L("Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small"); + return; + } + } + if (params.mode == CalibMode::Calib_PA_Pattern) { ModelInstance *instance = model->objects[0]->instances[0]; Vec3d offset = model->calib_pa_pattern->get_start_offset() +