Disable retraction when moving over infill space. #29

This commit is contained in:
Alessandro Ranellucci 2011-11-21 12:37:12 +01:00
parent ed9b4e829c
commit d6ed9c6f34
2 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,7 @@ has 'z' => (is => 'rw', default => sub {0} );
has 'flow_ratio' => (is => 'rw', default => sub {1}); has 'flow_ratio' => (is => 'rw', default => sub {1});
has 'extrusion_distance' => (is => 'rw', default => sub {0} ); has 'extrusion_distance' => (is => 'rw', default => sub {0} );
has 'enable_retraction' => (is => 'rw', default => sub {1} );
has 'retracted' => (is => 'rw', default => sub {1} ); # this spits out some plastic at start has 'retracted' => (is => 'rw', default => sub {1} ); # this spits out some plastic at start
has 'lifted' => (is => 'rw', default => sub {0} ); has 'lifted' => (is => 'rw', default => sub {0} );
has 'last_pos' => (is => 'rw', default => sub { [0,0] } ); has 'last_pos' => (is => 'rw', default => sub { [0,0] } );
@ -123,7 +124,8 @@ sub retract {
my $self = shift; my $self = shift;
my %params = @_; my %params = @_;
return "" unless $Slic3r::retract_length > 0 return "" unless $self->enable_retraction
&& $Slic3r::retract_length > 0
&& !$self->retracted; && !$self->retracted;
# prepare moves # prepare moves

View File

@ -423,8 +423,11 @@ sub export_gcode {
# extrude fills # extrude fills
for my $fill (@{ $layer->fills }) { for my $fill (@{ $layer->fills }) {
printf $fh $extruder->extrude($_, 'fill') for ($fill->shortest_path($extruder->last_pos)) {
for $fill->shortest_path($extruder->last_pos); printf $fh $extruder->extrude($_, 'fill');
$extruder->enable_retraction(0);
}
$extruder->enable_retraction(1);
} }
} }