From beb7939e22d93fb2954d345b41114e55314c73a3 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 15 Nov 2013 16:01:15 +0100 Subject: [PATCH] Rename standby_temperature to ooze_prevention. #1523 --- README.md | 6 ++++++ lib/Slic3r/Config.pm | 4 ++-- lib/Slic3r/GCode.pm | 4 ++-- lib/Slic3r/GUI/Tab.pm | 4 ++-- lib/Slic3r/Print.pm | 12 ++++++------ slic3r.pl | 13 +++++++++---- t/multi.t | 2 +- 7 files changed, 28 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 86f7e7f1b..66baf6512 100644 --- a/README.md +++ b/README.md @@ -347,6 +347,12 @@ The author of the Silk icon set is Mark James. Extruder to use for support material (1+, default: 1) --support-material-interface-extruder Extruder to use for support material interface (1+, default: 1) + --ooze-prevention Drop temperature and park extruders outside a full skirt for automatic wiping + (default: no) + --standby-temperature-delta + Temperature difference to be applied when an extruder is not active and + --ooze-prevention is enabled (default: -5) + If you want to change a preset file, just do diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 3f9e2071e..50fd29e21 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -226,10 +226,10 @@ our $Options = { }, # multiple extruder options - 'standby_temperature' => { + 'ooze_prevention' => { label => 'Enable', tooltip => 'This option will drop the temperature of the inactive extruders to prevent oozing. It will enable a tall skirt automatically and move extruders outside such skirt when changing temperatures.', - cli => 'standby-temperature!', + cli => 'ooze-prevention!', type => 'bool', default => 0, }, diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index b85826dd1..4563cd734 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -648,7 +648,7 @@ sub set_extruder { } # set the current extruder to the standby temperature - if ($self->config->standby_temperature && defined $self->extruder) { + if ($self->config->ooze_prevention && defined $self->extruder) { # move to the nearest standby point $gcode .= $self->travel_to($self->last_pos->nearest_point($self->standby_points)); @@ -673,7 +673,7 @@ sub set_extruder { $gcode .= $self->reset_e; # set the new extruder to the operating temperature - if ($self->config->standby_temperature) { + if ($self->config->ooze_prevention) { my $temp = defined $self->layer && $self->layer->id == 0 ? $self->extruder->first_layer_temperature : $self->extruder->temperature; diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index e9c80ec74..02fcf6ad4 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -534,8 +534,8 @@ sub build { options => [qw(perimeter_extruder infill_extruder support_material_extruder support_material_interface_extruder)], }, { - title => 'Standby Temperature', - options => [qw(standby_temperature standby_temperature_delta)], + title => 'Ooze prevention', + options => [qw(ooze_prevention standby_temperature_delta)], }, ]); diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 660cb8f7f..f178fdde0 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -275,9 +275,9 @@ sub init_extruders { )); } - # enforce tall skirt if using standby_temperature - # NOTE: this is not idempotent (i.e. switching standby_temperature off will not revert skirt settings) - if ($self->config->standby_temperature) { + # enforce tall skirt if using ooze_prevention + # NOTE: this is not idempotent (i.e. switching ooze_prevention off will not revert skirt settings) + if ($self->config->ooze_prevention && @{$self->extruders} > 1) { $self->config->set('skirt_height', 9999999999); $self->config->set('skirts', 1) if $self->config->skirts == 0; } @@ -574,7 +574,7 @@ EOF sub make_skirt { my $self = shift; return unless $Slic3r::Config->skirts > 0 - || ($Slic3r::Config->standby_temperature && @{$self->extruders} > 1); + || ($Slic3r::Config->ooze_prevention && @{$self->extruders} > 1); # collect points from all layers contained in skirt height my @points = (); @@ -744,7 +744,7 @@ sub write_gcode { return if $Slic3r::Config->start_gcode =~ /M(?:109|104)/i; for my $t (0 .. $#{$self->extruders}) { my $temp = $self->extruders->[$t]->first_layer_temperature; - $temp += $self->config->standby_temperature_delta if $self->config->standby_temperature; + $temp += $self->config->standby_temperature_delta if $self->config->ooze_prevention; printf $fh $gcodegen->set_temperature($temp, $wait, $t) if $temp > 0; } }; @@ -801,7 +801,7 @@ sub write_gcode { } # calculate wiping points if needed - if ($self->config->standby_temperature) { + if ($self->config->ooze_prevention) { my $outer_skirt = Slic3r::Polygon->new(@{convex_hull([ map $_->pp, map @$_, @{$self->skirt} ])}); my @skirts = (); foreach my $extruder (@{$self->extruders}) { diff --git a/slic3r.pl b/slic3r.pl index c29f3a21e..d573a4735 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -419,12 +419,17 @@ $j --extruder-offset Offset of each extruder, if firmware doesn't handle the displacement (can be specified multiple times, default: 0x0) --perimeter-extruder - Extruder to use for perimeters (1+, default: 1) - --infill-extruder Extruder to use for infill (1+, default: 1) + Extruder to use for perimeters (1+, default: $config->{perimeter_extruder}) + --infill-extruder Extruder to use for infill (1+, default: $config->{infill_extruder}) --support-material-extruder - Extruder to use for support material (1+, default: 1) + Extruder to use for support material (1+, default: $config->{support_material_extruder}) --support-material-interface-extruder - Extruder to use for support material interface (1+, default: 1) + Extruder to use for support material interface (1+, default: $config->{support_material_interface_extruder}) + --ooze-prevention Drop temperature and park extruders outside a full skirt for automatic wiping + (default: no) + --standby-temperature-delta + Temperature difference to be applied when an extruder is not active and + --ooze-prevention is enabled (default: $config->{standby_temperature_delta}) EOF exit ($exit_code || 0); diff --git a/t/multi.t b/t/multi.t index 1423499ee..d338a2d4e 100644 --- a/t/multi.t +++ b/t/multi.t @@ -18,7 +18,7 @@ use Slic3r::Test; $config->set('raft_layers', 2); $config->set('infill_extruder', 2); $config->set('support_material_extruder', 3); - $config->set('standby_temperature', 1); + $config->set('ooze_prevention', 1); $config->set('extruder_offset', [ [0,0], [20,0], [0,20] ]); $config->set('temperature', [200, 180, 170]); $config->set('first_layer_temperature', [206, 186, 166]);