From 4e1ec6d354fe8c521f624d31f725b67cb08d8ffa Mon Sep 17 00:00:00 2001 From: "songwei.li" Date: Mon, 11 Aug 2025 16:16:46 +0800 Subject: [PATCH] FIX: Increased the tolerance of printable area detection to 2mm In gcode processor, the result check, increased the tolerance of printable area detection to 2mm, to adaption to the requirement of command line slicing. jira: none Change-Id: I5be4d6396989c35ae394339376c1133c8862c075 (cherry picked from commit 2f09c98caa9d2afc3e33a0bf17c6a6bb39992e0c) --- src/libslic3r/GCode/GCodeProcessor.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 77bd231fd3..53c246f1d5 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -1727,7 +1727,13 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int bool valid = true; Point plate_offset = Point(scale_(m_x_offset), scale_(m_y_offset)); plate_printable_poly.translate(plate_offset); - wrapping_exclude_poly.translate(plate_offset); + //wrapping_exclude_poly.translate(plate_offset); + BoundingBox plate_printable_bbox = plate_printable_poly.bounding_box(); + if (plate_printable_poly.is_valid()) { + plate_printable_bbox.offset(scale_(2.0)); // Expand the range to provide a tolerance + } else + plate_printable_bbox.defined = false; //when this is used, the printable area config was missing, something wrong + for (auto obj_iter = gcode_path_pos.begin(); obj_iter != gcode_path_pos.end(); ++obj_iter) { int object_label_id = obj_iter->first; const std::map &path_pos = obj_iter->second; @@ -1738,8 +1744,8 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int Polygon path_poly(iter_points); if (path_poly.empty()) continue; BoundingBox bbox = path_poly.bounding_box(); - if (plate_printable_poly.is_valid()){ - if (!plate_printable_poly.bounding_box().contains(bbox)) {// out of the bed area + if (plate_printable_bbox.defined) { + if (!plate_printable_bbox.contains(bbox)) { // out of the bed area m_result.gcode_check_result.error_code |= (1<<2); std::pair filament_to_object_id; filament_to_object_id.first = iter->first;