Merge branch 'master' into new-flow

This commit is contained in:
Alessandro Ranellucci 2012-07-06 20:06:09 +02:00
commit 4f6934bab8
3 changed files with 14 additions and 8 deletions

View file

@ -87,7 +87,6 @@ sub fill_surface {
$self->cache->{$cache_id},
[ map @$_, $expolygon->offset_ex($overlap_distance) ],
)};
# this shortest path search is probably unneeded or not effective
my $collection = Slic3r::ExtrusionPath::Collection->new(
paths => [ map Slic3r::ExtrusionPath->new(polyline => $_, role => -1), @paths ],
);

View file

@ -242,10 +242,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 !~ /^(?:mach3|makerbot)$/) {
$gcode .= "G92 " . $Slic3r::extrusion_axis . "0\n" if $Slic3r::extrusion_axis;
$self->extrusion_distance(0);
}
$gcode .= $self->reset_e if $Slic3r::gcode_flavor !~ /^(?:mach3|makerbot)$/;
return $gcode;
}
@ -267,6 +264,14 @@ sub unretract {
return $gcode;
}
sub reset_e {
my $self = shift;
$self->extrusion_distance(0);
return "G92 %s0%s\n", $Slic3r::extrusion_axis, ($Slic3r::gcode_comments ? ' ; reset extrusion distance' : '')
if $Slic3r::extrusion_axis && !$Slic3r::use_relative_e_distances;
}
sub set_acceleration {
my $self = shift;
my ($acceleration) = @_;
@ -377,7 +382,10 @@ sub set_tool {
return "" if $self->extruder_idx == $tool;
$self->extruder_idx($tool);
return $self->retract . sprintf "T%d%s\n", $tool, ($Slic3r::gcode_comments ? ' ; change tool' : '');
return $self->retract
. sprintf "T%d%s\n", $tool, ($Slic3r::gcode_comments ? ' ; change tool' : '')
. $self->reset_e
. $self->unretract;
}
sub set_fan {

View file

@ -530,8 +530,7 @@ sub write_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
if $Slic3r::extrusion_axis && !$Slic3r::use_relative_e_distances;
printf $fh $gcodegen->reset_e;
if ($Slic3r::gcode_flavor =~ /^(?:reprap|makerbot)$/) {
if ($Slic3r::use_relative_e_distances) {
print $fh "M83 ; use relative distances for extrusion\n";