diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2013-11-24 15:37:36 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2013-11-24 15:37:36 +0400 |
commit | 5217bc370a2941221322c26c8cb08b6de4c0e0fd (patch) | |
tree | c2ec6187122a076d5eb16ddc3a75880f7d327b50 | |
parent | 97c65bac90191f5d286fd3f24c31c486e76d5c12 (diff) |
Fix regression causing retraction restarts to ignore extrusion_axis. Includes regression test. #1547
-rw-r--r-- | lib/Slic3r/GCode.pm | 3 | ||||
-rw-r--r-- | t/gcode.t | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index 4563cd734..9ae5d952a 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -546,7 +546,8 @@ sub unretract { $gcode .= "G11 ; unretract\n"; } elsif ($self->config->extrusion_axis) { # use G1 instead of G0 because G0 will blend the restart with the previous travel move - $gcode .= sprintf "G1 E%.5f F%.3f", + $gcode .= sprintf "G1 %s%.5f F%.3f", + $self->config->extrusion_axis, $self->extruder->extrude($to_unretract), $self->extruder->retract_speed_mm_min; $gcode .= " ; compensate retraction" if $self->config->gcode_comments; @@ -46,8 +46,13 @@ use Slic3r::Test; my $config = Slic3r::Config->new_from_defaults; $config->set('complete_objects', 1); $config->set('duplicate', 2); + $config->set('extrusion_axis', 'A'); my $print = Slic3r::Test::init_print('20mm_cube', config => $config); - ok Slic3r::Test::gcode($print), "complete_objects"; + ok my $gcode = Slic3r::Test::gcode($print), "complete_objects"; + Slic3r::GCode::Reader->new->parse($gcode, sub { + my ($self, $cmd, $args, $info) = @_; + fail 'unexpected E argument' if defined $args->{E}; + }); } __END__ |