From 2c16509e8a3972c47b7537c5566c88a43b73d76c Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 3 Mar 2012 22:28:44 +0100 Subject: [PATCH] Slowdown wasn't triggered when fan_below_layer_time was set to zero. #237 --- lib/Slic3r/Print.pm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 25e69b6ac..042a6c190 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -675,15 +675,13 @@ sub export_gcode { if ($Slic3r::cooling) { my $layer_time = $extruder->elapsed_time; Slic3r::debugf "Layer %d estimated printing time: %d seconds\n", $layer->id, $layer_time; - if ($layer_time < $Slic3r::fan_below_layer_time) { - if ($layer_time < $Slic3r::slowdown_below_layer_time) { - $fan_speed = $Slic3r::max_fan_speed; - $speed_factor = $layer_time / $Slic3r::slowdown_below_layer_time; - } else { - $fan_speed = $Slic3r::max_fan_speed - ($Slic3r::max_fan_speed - $Slic3r::min_fan_speed) - * ($layer_time - $Slic3r::slowdown_below_layer_time) - / ($Slic3r::fan_below_layer_time - $Slic3r::slowdown_below_layer_time); #/ - } + if ($layer_time < $Slic3r::slowdown_below_layer_time) { + $fan_speed = $Slic3r::max_fan_speed; + $speed_factor = $layer_time / $Slic3r::slowdown_below_layer_time; + } elsif ($layer_time < $Slic3r::fan_below_layer_time) { + $fan_speed = $Slic3r::max_fan_speed - ($Slic3r::max_fan_speed - $Slic3r::min_fan_speed) + * ($layer_time - $Slic3r::slowdown_below_layer_time) + / ($Slic3r::fan_below_layer_time - $Slic3r::slowdown_below_layer_time); #/ } Slic3r::debugf " fan = %d%%, speed = %d%%\n", $fan_speed, $speed_factor * 100;