Omit G92 if No Extrusion

This commit is contained in:
Alessandro Ranellucci 2012-04-16 20:06:53 +02:00
parent 8d851c24a9
commit 285caffa9c
2 changed files with 2 additions and 2 deletions

View File

@ -211,7 +211,7 @@ sub retract {
# reset extrusion distance during retracts
# this makes sure we leave sufficient precision in the firmware
if (!$Slic3r::use_relative_e_distances && $Slic3r::gcode_flavor ne 'mach3') {
$gcode .= "G92 " . $Slic3r::extrusion_axis . "0\n";
$gcode .= "G92 " . $Slic3r::extrusion_axis . "0\n" if $Slic3r::extrusion_axis;
$self->extrusion_distance(0);
}

View File

@ -746,7 +746,7 @@ sub export_gcode {
print $fh "G90 ; use absolute coordinates\n";
print $fh "G21 ; set units to millimeters\n";
if ($Slic3r::gcode_flavor =~ /^(?:reprap|teacup)$/) {
printf $fh "G92 %s0 ; reset extrusion distance\n", $Slic3r::extrusion_axis;
printf $fh "G92 %s0 ; reset extrusion distance\n", $Slic3r::extrusion_axis if $Slic3r::extrusion_axis;
if ($Slic3r::gcode_flavor =~ /^(?:reprap|makerbot)$/) {
if ($Slic3r::use_relative_e_distances) {
print $fh "M83 ; use relative distances for extrusion\n";