From 6242b0e8cde42920a88a10362265cf9b11fd4695 Mon Sep 17 00:00:00 2001 From: Eldenroot Date: Sun, 26 Apr 2026 14:30:39 +0200 Subject: [PATCH] Fix auto-arrangement boundary for skirt loops (#12999) https://github.com/bambulab/BambuStudio/pull/10086 --- src/libslic3r/PrintConfig.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 508e7c805f..ce2eeb5445 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -10949,8 +10949,32 @@ bool has_skirt(const DynamicPrintConfig& cfg) || (opt_draft_shield && opt_draft_shield->getInt() != dsDisabled); } float get_real_skirt_dist(const DynamicPrintConfig& cfg) { - return has_skirt(cfg) ? cfg.opt_float("skirt_distance") : 0; + if (!has_skirt(cfg)) return 0.f; + + float dist = cfg.opt_float("skirt_distance"); + + int loops = cfg.opt_int("skirt_loops"); + auto opt_draft_shield = cfg.option("draft_shield"); + if (opt_draft_shield && opt_draft_shield->getInt() != dsDisabled && loops == 0) { + loops = 1; + } + + float width = cfg.opt_float("initial_layer_line_width"); + if (width <= 0.f) { + width = cfg.opt_float("line_width"); + } + if (width <= 0.f) { + auto* nd = cfg.opt("nozzle_diameter"); + if (nd && !nd->values.empty()) { + width = *std::max_element(nd->values.begin(), nd->values.end()); + } else { + width = 0.4f; + } + } + + return dist + loops * width; } + static bool is_XL_printer(const std::string& printer_notes) { return boost::algorithm::contains(printer_notes, "PRINTER_VENDOR_PRUSA3D")