New option to disable retraction on layer change

This commit is contained in:
Alessandro Ranellucci 2013-03-09 20:05:43 +01:00
parent e71bf48463
commit 460e169c67
6 changed files with 18 additions and 5 deletions

View File

@ -232,6 +232,8 @@ 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)
--retract-layer-change
Enforce a retraction before each Z move (default: yes)
Retraction options for multi-extruder setups:
--retract-length-toolchange

View File

@ -745,6 +745,15 @@ END
deserialize => $deserialize_comma,
default => [0],
},
'retract_layer_change' => {
label => 'Retract on layer change',
tooltip => 'This flag enforces a retraction whenever a Z move is done.',
cli => 'retract-layer-change!',
type => 'bool',
serialize => $serialize_comma,
deserialize => $deserialize_comma,
default => [1],
},
'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).',
@ -1012,7 +1021,7 @@ sub new_from_cli {
}
$args{$_} = $Options->{$_}{deserialize}->($args{$_})
for grep exists $args{$_}, qw(print_center bed_size duplicate_grid extruder_offset);
for grep exists $args{$_}, qw(print_center bed_size duplicate_grid extruder_offset retract_layer_change);
return $class->new(%args);
}

View File

@ -7,7 +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
retract_layer_change retract_length_toolchange retract_restart_extra_toolchange
)];
has 'id' => (is => 'rw', required => 1);

View File

@ -103,7 +103,7 @@ sub move_z {
my $gcode = "";
my $current_z = $self->z;
if (!defined $current_z || $current_z != ($z + $self->lifted)) {
$gcode .= $self->retract(move_z => $z);
$gcode .= $self->retract(move_z => $z) if $self->extruder->retract_layer_change;
$self->speed('travel');
$gcode .= $self->G0(undef, $z, 0, $comment || ('move to next layer (' . $self->layer->id . ')'))
unless ($current_z // -1) != ($self->z // -1);

View File

@ -687,7 +687,7 @@ sub build {
}
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) }
retract_layer_change retract_length_toolchange retract_restart_extra_toolchange) }
sub config {
my $self = shift;
@ -720,7 +720,7 @@ sub _build_extruder_pages {
title => 'Retraction',
options => [
map "${_}#${extruder_idx}",
qw(retract_length retract_lift retract_speed retract_restart_extra retract_before_travel)
qw(retract_length retract_lift retract_speed retract_restart_extra retract_before_travel retract_layer_change)
],
},
{

View File

@ -285,6 +285,8 @@ $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])
--retract-layer-change
Enforce a retraction before each Z move (default: yes)
Retraction options for multi-extruder setups:
--retract-length-toolchange