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;