diff --git a/README.markdown b/README.markdown index 462697189..fc5ce7f86 100644 --- a/README.markdown +++ b/README.markdown @@ -87,10 +87,9 @@ The author of the Silk icon set is Mark James. --save Save configuration to the specified file --load Load configuration from the specified file. It can be used more than once to load options from multiple files. - -o, --output 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 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 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 @@ -193,6 +191,13 @@ The author of the Silk icon set is Mark James. --retract-before-travel 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 @@ -247,7 +252,7 @@ The author of the Silk icon set is Mark James. --support-material-extrusion-width Set a different extrusion width for support material --bridge-flow-ratio Multiplier for extrusion when bridging (> 0, default: 1) - + Multiple extruder options: --extruder-offset Offset of each extruder, if firmware doesn't handle the displacement (can be specified multiple times, default: 0x0) @@ -256,8 +261,6 @@ The author of the Silk icon set is Mark James. --infill-extruder Extruder to use for infill (1+, default: 1) --support-material-extruder Extruder to use for support material (1+, default: 1) - - If you want to change a preset file, just do diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 1cee4503a..46189d77d 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -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' => { diff --git a/lib/Slic3r/Extruder.pm b/lib/Slic3r/Extruder.pm index 5ebaa9fc5..4b7b6b19a 100644 --- a/lib/Slic3r/Extruder.pm +++ b/lib/Slic3r/Extruder.pm @@ -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}; diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index a9f62fd5c..ab8f01576 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -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; } diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index acab6ca5d..111800e0a 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -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; } diff --git a/slic3r.pl b/slic3r.pl index f5575c0e7..2990d5aa2 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -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 @@ -235,6 +234,13 @@ $j --retract-before-travel 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