New separate options for retraction length to be used when switching tools

This commit is contained in:
Alessandro Ranellucci 2012-08-22 19:11:45 +02:00
parent 075213c731
commit 9e682924c7
6 changed files with 58 additions and 17 deletions

View File

@ -87,10 +87,9 @@ The author of the Silk icon set is Mark James.
--save <file> Save configuration to the specified file
--load <file> Load configuration from the specified file. It can be used
more than once to load options from multiple files.
-o, --output <file> File or directory to output gcode to (by default, the file will be
saved into the same directory as the input file using the
-o, --output <file> File to output gcode to (by default, the file will be saved
into the same directory as the input file using the
--output-filename-format to generate the filename)
-j, --threads <num> Number of threads to use (1+, default: 2)
Output options:
--output-filename-format
@ -127,7 +126,7 @@ The author of the Silk icon set is Mark James.
--temperature Extrusion temperature in degree Celsius, set 0 to disable (default: 200)
--first-layer-temperature Extrusion temperature for the first layer, in degree Celsius,
set 0 to disable (default: same as --temperature)
--bed-temperature Heated bed temperature in degree Celsius, set 0 to disable (default: 200)
--bed-temperature Heated bed temperature in degree Celsius, set 0 to disable (default: 0)
--first-layer-bed-temperature Heated bed temperature for the first layer, in degree Celsius,
set 0 to disable (default: same as --bed-temperature)
@ -184,8 +183,7 @@ The author of the Silk icon set is Mark James.
Support material angle in degrees (range: 0-90, default: 0)
Retraction options:
--retract-length Length of retraction in mm when pausing extrusion
(default: 1)
--retract-length Length of retraction in mm when pausing extrusion (default: 1)
--retract-speed Speed for retraction in mm/s (default: 30)
--retract-restart-extra
Additional amount of filament in mm to push after
@ -194,6 +192,13 @@ The author of the Silk icon set is Mark James.
Only retract before travel moves of this length in mm (default: 2)
--retract-lift Lift Z by the given distance in mm when retracting (default: 0)
Retraction options for multi-extruder setups:
--retract-length-toolchange
Length of retraction in mm when disabling tool (default: 1)
--retract-restart-extra-toolchnage
Additional amount of filament in mm to push after
switching tool (default: 0)
Cooling options:
--cooling Enable fan and cooling control
--min-fan-speed Minimum fan speed (default: 35%)
@ -257,8 +262,6 @@ The author of the Silk icon set is Mark James.
--support-material-extruder
Extruder to use for support material (1+, default: 1)
If you want to change a preset file, just do
slic3r.pl --load config.ini --layer-height 0.25 --save config.ini

View File

@ -607,6 +607,26 @@ END
deserialize => $deserialize_comma,
default => [0],
},
'retract_length_toolchange' => {
label => 'Length',
tooltip => 'When retraction is triggered before changing tool, filament is pulled back by the specified amount (the length is measured on raw filament, before it enters the extruder).',
sidetext => 'mm (zero to disable)',
cli => 'retract-length-toolchange=f@',
type => 'f',
serialize => $serialize_comma,
deserialize => $deserialize_comma,
default => [3],
},
'retract_restart_extra_toolchange' => {
label => 'Extra length on restart',
tooltip => 'When the retraction is compensated after changing tool, the extruder will push this additional amount of filament.',
sidetext => 'mm',
cli => 'retract-restart-extra-toolchange=f@',
type => 'f',
serialize => $serialize_comma,
deserialize => $deserialize_comma,
default => [0],
},
# cooling options
'cooling' => {

View File

@ -7,6 +7,7 @@ use constant OPTIONS => [qw(
extruder_offset
nozzle_diameter filament_diameter extrusion_multiplier temperature first_layer_temperature
retract_length retract_lift retract_speed retract_restart_extra retract_before_travel
retract_length_toolchange retract_restart_extra_toolchange
)];
has $_ => (is => 'ro', required => 1) for @{&OPTIONS};

View File

@ -196,12 +196,15 @@ sub retract {
my $self = shift;
my %params = @_;
return "" unless $self->extruder->retract_length > 0
&& !$self->extruder->retracted;
my ($length, $restart_extra) = $params{toolchange}
? ($self->extruder->retract_length_toolchange, $self->extruder->retract_restart_extra_toolchange)
: ($self->extruder->retract_length, $self->extruder->retract_restart_extra);
return "" unless $length > 0 && !$self->extruder->retracted;
# prepare moves
$self->speed('retract');
my $retract = [undef, undef, -$self->extruder->retract_length, "retract"];
my $retract = [undef, undef, -$length, "retract"];
my $lift = ($self->extruder->retract_lift == 0 || defined $params{move_z})
? undef
: [undef, $self->z + $self->extruder->retract_lift, 0, 'lift plate during retraction'];
@ -231,7 +234,7 @@ sub retract {
$gcode .= $self->G1(@$lift);
}
}
$self->extruder->retracted($self->extruder->retract_length + $self->extruder->retract_restart_extra);
$self->extruder->retracted($length + $restart_extra);
$self->lifted($self->extruder->retract_lift) if $lift;
# reset extrusion distance during retracts
@ -378,7 +381,7 @@ sub set_tool {
return "" if $self->extruder_idx == $tool;
$self->extruder_idx($tool);
return $self->retract
return $self->retract(toolchange => 1)
. (sprintf "T%d%s\n", $tool, ($Slic3r::Config->gcode_comments ? ' ; change tool' : ''))
. $self->reset_e;
}

View File

@ -583,7 +583,8 @@ sub build {
$self->_build_extruder_pages;
}
sub _extruder_options { qw(nozzle_diameter extruder_offset retract_length retract_lift retract_speed retract_restart_extra retract_before_travel) }
sub _extruder_options { qw(nozzle_diameter extruder_offset retract_length retract_lift retract_speed retract_restart_extra retract_before_travel
retract_length_toolchange retract_restart_extra_toolchange) }
sub config {
my $self = shift;
@ -619,6 +620,13 @@ sub _build_extruder_pages {
qw(retract_length retract_lift retract_speed retract_restart_extra retract_before_travel)
],
},
{
title => 'Retraction when tool is disabled (advanced settings for multi-extruder setups)',
options => [
map "${_}#${extruder_idx}",
qw(retract_length_toolchange retract_restart_extra_toolchange)
],
},
]);
$self->{extruder_pages}[$extruder_idx]{disabled} = 0;
}

View File

@ -226,8 +226,7 @@ $j
Support material angle in degrees (range: 0-90, default: $config->{support_material_angle})
Retraction options:
--retract-length Length of retraction in mm when pausing extrusion
(default: $config->{retract_length}[0])
--retract-length Length of retraction in mm when pausing extrusion (default: $config->{retract_length}[0])
--retract-speed Speed for retraction in mm/s (default: $config->{retract_speed}[0])
--retract-restart-extra
Additional amount of filament in mm to push after
@ -236,6 +235,13 @@ $j
Only retract before travel moves of this length in mm (default: $config->{retract_before_travel}[0])
--retract-lift Lift Z by the given distance in mm when retracting (default: $config->{retract_lift}[0])
Retraction options for multi-extruder setups:
--retract-length-toolchange
Length of retraction in mm when disabling tool (default: $config->{retract_length}[0])
--retract-restart-extra-toolchnage
Additional amount of filament in mm to push after
switching tool (default: $config->{retract_restart_extra}[0])
Cooling options:
--cooling Enable fan and cooling control
--min-fan-speed Minimum fan speed (default: $config->{min_fan_speed}%)