Skip to content

Commit

Permalink
Apply G92 E0 after G11. #2201
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed Aug 8, 2014
1 parent 3175f11 commit 6e81360
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Slic3r/GCode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,15 @@ sub retract {
# TODO: add regression test
$gcode .= $self->G1(undef, undef, $retract->[2] - $retracted, $self->extruder->retract_speed_mm_min, $comment);
}
$gcode .= $self->reset_e;
} elsif ($self->config->use_firmware_retraction) {
$gcode .= "G10 ; retract\n";
} else {
$gcode .= $self->G1(@$retract);

# reset extrusion distance during retracts
# this makes sure we leave sufficient precision in the firmware
$gcode .= $self->reset_e;
}
if (!$self->lifted) {
if (defined $params{move_z} && $self->config->retract_lift->[0] > 0) {
Expand All @@ -469,10 +474,6 @@ sub retract {
$self->extruder->set_restart_extra($restart_extra);
$self->lifted($self->config->retract_lift->[0]) if $lift;

# reset extrusion distance during retracts
# this makes sure we leave sufficient precision in the firmware
$gcode .= $self->reset_e;

$gcode .= "M103 ; extruder off\n" if $self->config->gcode_flavor eq 'makerware';

return $gcode;
Expand All @@ -493,6 +494,7 @@ sub unretract {
if ($to_unretract) {
if ($self->config->use_firmware_retraction) {
$gcode .= "G11 ; unretract\n";
$gcode .= $self->reset_e;
} elsif ($self->config->get_extrusion_axis) {
# use G1 instead of G0 because G0 will blend the restart with the previous travel move
$gcode .= sprintf "G1 %s%.5f F%.3f",
Expand Down

0 comments on commit 6e81360

Please sign in to comment.