Fix auto-arrangement boundary for skirt loops (#12999)

https://github.com/bambulab/BambuStudio/pull/10086
This commit is contained in:
Eldenroot
2026-04-26 14:30:39 +02:00
committed by GitHub
parent a2a62c30f7
commit 6242b0e8cd

View File

@@ -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<ConfigOptionFloats>("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")