From fd00d280273be8bfbd247d295e9bc5da99a9be87 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Thu, 30 Nov 2023 11:03:43 +0800 Subject: [PATCH] FIX: The maximum value is not printed in PA line mode Jira: 5046 4951 Change-Id: Ic81f9a75ce7f088fe950fdde283ff5c942cd6e83 --- src/libslic3r/GCode.cpp | 2 +- src/slic3r/Utils/CalibUtils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index e58d5f4b5..c2500c56e 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2091,7 +2091,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato pa_test.set_speed(fast_speed, slow_speed); pa_test.draw_numbers() = print.calib_params().print_numbers; auto params = print.calib_params(); - gcode += pa_test.generate_test(params.start, params.step, std::llround(std::ceil((params.end - params.start) / params.step))); + gcode += pa_test.generate_test(params.start, params.step, std::llround(std::ceil((params.end - params.start) / params.step)) + 1); file.write(gcode); } diff --git a/src/slic3r/Utils/CalibUtils.cpp b/src/slic3r/Utils/CalibUtils.cpp index a7ec6010b..ba6888056 100644 --- a/src/slic3r/Utils/CalibUtils.cpp +++ b/src/slic3r/Utils/CalibUtils.cpp @@ -941,7 +941,7 @@ void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f 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)); + int count = std::llround(std::ceil((params.end - params.start) / params.step)) + 1; 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;