From f5996fe42f8f34dd68bec120ada9df4df2494eac Mon Sep 17 00:00:00 2001 From: supermerill Date: Thu, 28 Oct 2021 01:32:02 +0200 Subject: [PATCH] Fix fan speed for first layer when full_fan_speed_layer > 0 and disable_fan_first_layers == 0 supermerill/SuperSlicer#1727 --- src/libslic3r/GCode/CoolingBuffer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index 239dc8b5d..a146210df 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -797,9 +797,8 @@ std::string CoolingBuffer::apply_layer_cooldown( // Is the fan speed ramp enabled? int full_fan_speed_layer = EXTRUDER_CONFIG(full_fan_speed_layer); - // When ramping up fan speed from disable_fan_first_layers to full_fan_speed_layer, force disable_fan_first_layers above zero, - // so there will be a zero fan speed at least at the 1st layer. - disable_fan_first_layers = std::max(disable_fan_first_layers, 1); + // When ramping up fan speed from disable_fan_first_layers to full_fan_speed_layer, if disable_fan_first_layers is zero, + // the not-fan layer is a hypothetical -1 layer. if (int(layer_id) >= disable_fan_first_layers && int(layer_id) + 1 < full_fan_speed_layer) { // Ramp up the fan speed from disable_fan_first_layers to full_fan_speed_layer. float factor = float(int(layer_id + 1) - disable_fan_first_layers) / float(full_fan_speed_layer - disable_fan_first_layers);