diff --git a/lib/Slic3r/ExtrusionLoop.pm b/lib/Slic3r/ExtrusionLoop.pm index c97684f0..1cdc27b9 100644 --- a/lib/Slic3r/ExtrusionLoop.pm +++ b/lib/Slic3r/ExtrusionLoop.pm @@ -33,11 +33,6 @@ sub pack { return $o; } -sub shortest_path { - my $self = shift; - return $self; -} - sub split_at_index { my $self = shift; my ($index) = @_; diff --git a/lib/Slic3r/ExtrusionPath.pm b/lib/Slic3r/ExtrusionPath.pm index 717e1ad6..63f2267e 100644 --- a/lib/Slic3r/ExtrusionPath.pm +++ b/lib/Slic3r/ExtrusionPath.pm @@ -58,11 +58,6 @@ sub pack { # no-op, this allows to use both packed and non-packed objects in Collections sub unpack { $_[0] } -sub shortest_path { - my $self = shift; - return $self; -} - sub clip_end { my $self = shift; my ($distance) = @_; diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index a95570d6..43f2b264 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -349,13 +349,14 @@ sub make_perimeters { # add thin walls as perimeters { my @thin_paths = (); + my %properties = ( + role => EXTR_ROLE_PERIMETER, + flow_spacing => $self->perimeters_flow->spacing, + ); for (@{ $self->thin_walls }) { - if ($_->isa('Slic3r::Polygon')) { - push @thin_paths, Slic3r::ExtrusionLoop->pack(polygon => $_, role => EXTR_ROLE_PERIMETER); - } else { - push @thin_paths, Slic3r::ExtrusionPath->pack(polyline => $_, role => EXTR_ROLE_PERIMETER); - } - $thin_paths[-1]->flow_spacing($self->perimeters_flow->spacing); + push @thin_paths, $_->isa('Slic3r::Polygon') + ? Slic3r::ExtrusionLoop->pack(polygon => $_, %properties) + : Slic3r::ExtrusionPath->pack(polyline => $_, %properties); } my $collection = Slic3r::ExtrusionPath::Collection->new(paths => \@thin_paths); push @{ $self->perimeters }, $collection->shortest_path; diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 22e9002e..ac4a195b 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -604,8 +604,12 @@ sub write_gcode { $gcode .= $gcodegen->set_tool($Slic3r::infill_extruder-1); $gcode .= $gcodegen->set_acceleration($Slic3r::infill_acceleration); for my $fill (@{ $layer->fills }) { - $gcode .= $gcodegen->extrude($_, 'fill') - for $fill->shortest_path($gcodegen->last_pos); + if ($fill->isa('Slic3r::ExtrusionPath::Collection')) { + $gcode .= $gcodegen->extrude($_, 'fill') + for $fill->shortest_path($gcodegen->last_pos); + } else { + $gcode .= $gcodegen->extrude($fill, 'fill') ; + } } # extrude support material