perf: skip the unused curled wall estimate to speed up slicing by up to 9% (#16113)

perf: skip estimating curled walls when nothing reads them

The curled extrusion estimate ran whenever a region had overhang speed on,
which is the default, but only the slowdown for curled perimeters reads the
curled lines it produces, and that slowdown is off by default. The step now
also requires a region with the slowdown on, and clears the curled lines
when it skips the estimate, so none are left from an earlier slice. 
Also fixes stale fan commands due to the stale curled lines on the reused layers.
This commit is contained in:
Kris Austin
2026-10-04 09:45:19 +01:00
committed by GitHub
parent 88346efceb
commit 90ac58d3cd
4 changed files with 69 additions and 9 deletions
+10 -4
View File
@@ -1025,10 +1025,13 @@ void PrintObject::generate_support_material()
void PrintObject::estimate_curled_extrusions()
{
if (this->set_started(posEstimateCurledExtrusions)) {
if ( std::any_of(this->print()->m_print_regions.begin(), this->print()->m_print_regions.end(), [](const PrintRegion* region) {
const auto& cfg = region->config().enable_overhang_speed.values;
return std::any_of(cfg.begin(), cfg.end(), [](const unsigned char v) { return (bool) v; });
})) {
const auto any_region_enables = [this](ConfigOptionBoolsNullable PrintRegionConfig::*option) {
return std::any_of(this->print()->m_print_regions.begin(), this->print()->m_print_regions.end(),
[option](const PrintRegion* region) { return any_enabled(region->config().*option); });
};
// Only the slowdown for curled perimeters reads the curled lines, and they stay empty unless some region has overhang speed on.
if (any_region_enables(&PrintRegionConfig::enable_overhang_speed) &&
any_region_enables(&PrintRegionConfig::slowdown_for_curled_perimeters)) {
// Estimate curling of support material and add it to the malformaition lines of each layer
float support_flow_width = support_material_flow(this, this->config().layer_height).width();
@@ -1038,6 +1041,9 @@ void PrintObject::estimate_curled_extrusions()
float(this->config().brim_width.getFloat())};
SupportSpotsGenerator::estimate_malformations(this->layers(), params);
m_print->throw_if_canceled();
} else {
for (Layer *layer : m_layers)
layer->curled_lines.clear();
}
//this->set_done(posEstimateCurledExtrusions);
}