From 92cdaf2f2d4930301027c8cdcaf03ec3a797e998 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 20 Jan 2012 14:48:51 +0100 Subject: [PATCH] Retract at end of print --- lib/Slic3r/Print.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 0f5045699..c79c14a8a 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -483,17 +483,17 @@ sub export_gcode { # write gcode commands layer by layer foreach my $layer (@{ $self->layers }) { # go to layer - printf $fh $extruder->change_layer($layer); + print $fh $extruder->change_layer($layer); # extrude skirts - printf $fh $extruder->extrude_loop($_, 'skirt') for @{ $layer->skirts }; + print $fh $extruder->extrude_loop($_, 'skirt') for @{ $layer->skirts }; # extrude perimeters - printf $fh $extruder->extrude($_, 'perimeter') for @{ $layer->perimeters }; + print $fh $extruder->extrude($_, 'perimeter') for @{ $layer->perimeters }; # extrude fills for my $fill (@{ $layer->fills }) { - printf $fh $extruder->extrude_path($_, 'fill') + print $fh $extruder->extrude_path($_, 'fill') for $fill->shortest_path($extruder->last_pos); } } @@ -502,6 +502,7 @@ sub export_gcode { $self->total_extrusion_length($extruder->total_extrusion_length); # write end commands to file + print $fh $extruder->retract; print $fh "$Slic3r::end_gcode\n"; printf $fh "; filament used = %.1fmm (%.1fcm3)\n",