From 06c22c9db336a9162239b8bfed1b2d652198eb57 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 3 Mar 2012 22:21:30 +0100 Subject: [PATCH] New --fan-always-on option. #241 #110 --- README.markdown | 2 ++ lib/Slic3r.pm | 1 + lib/Slic3r/Config.pm | 5 +++++ lib/Slic3r/GUI/SkeinPanel.pm | 2 +- lib/Slic3r/Print.pm | 4 ++-- slic3r.pl | 2 ++ 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.markdown b/README.markdown index 1ec4245da..cd41d1ad8 100644 --- a/README.markdown +++ b/README.markdown @@ -176,6 +176,8 @@ The author is Alessandro Ranellucci (me). of seconds (default: 15) --min-print-speed Minimum print speed speed (mm/s, default: 10) --disable-fan-first-layers Disable fan for the first N layers (default: 1) + --fan-always-on Keep fan always on at min fan speed, even for layers that don't need + cooling Skirt options: --skirts Number of skirts to draw (0+, default: 1) diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 19d668ae2..1735eca70 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -124,6 +124,7 @@ our $fan_below_layer_time = 60; our $slowdown_below_layer_time = 15; our $min_print_speed = 10; our $disable_fan_first_layers = 1; +our $fan_always_on = 0; # skirt options our $skirts = 1; diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index cc4033805..4d70960b5 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -338,6 +338,11 @@ our $Options = { cli => 'disable-fan-first-layers=i', type => 'i', }, + 'fan_always_on' => { + label => 'Keep fan always on', + cli => 'fan-always-on', + type => 'bool', + }, # skirt options 'skirts' => { diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm index 638072edf..628f77225 100644 --- a/lib/Slic3r/GUI/SkeinPanel.pm +++ b/lib/Slic3r/GUI/SkeinPanel.pm @@ -49,7 +49,7 @@ sub new { }, cooling => { title => 'Cooling', - options => [qw(cooling min_fan_speed max_fan_speed bridge_fan_speed fan_below_layer_time slowdown_below_layer_time min_print_speed disable_fan_first_layers)], + options => [qw(cooling min_fan_speed max_fan_speed bridge_fan_speed fan_below_layer_time slowdown_below_layer_time min_print_speed disable_fan_first_layers fan_always_on)], label_width => 300, }, skirt => { diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 59a3568b3..25e69b6ac 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -670,7 +670,7 @@ sub export_gcode { } last if !$layer_gcode; - my $fan_speed = 0; + my $fan_speed = $Slic3r::fan_always_on ? $Slic3r::min_fan_speed : 0; my $speed_factor = 1; if ($Slic3r::cooling) { my $layer_time = $extruder->elapsed_time; @@ -694,8 +694,8 @@ sub export_gcode { /gexm; } $fan_speed = 0 if $layer->id < $Slic3r::disable_fan_first_layers; - $layer_gcode = $extruder->set_fan($fan_speed) . $layer_gcode; } + $layer_gcode = $extruder->set_fan($fan_speed) . $layer_gcode; # bridge fan speed if (!$Slic3r::cooling || $Slic3r::bridge_fan_speed == 0 || $layer->id < $Slic3r::disable_fan_first_layers) { diff --git a/slic3r.pl b/slic3r.pl index bc10c95e9..25cbb0158 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -194,6 +194,8 @@ Usage: slic3r.pl [ OPTIONS ] file.stl of seconds (default: $Slic3r::slowdown_below_layer_time) --min-print-speed Minimum print speed speed (mm/s, default: $Slic3r::min_print_speed) --disable-fan-first-layers Disable fan for the first N layers (default: $Slic3r::disable_fan_first_layers) + --fan-always-on Keep fan always on at min fan speed, even for layers that don't need + cooling Skirt options: --skirts Number of skirts to draw (0+, default: $Slic3r::skirts)