From a10d13120cf01da3da120965bb2f706fdf6086e2 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 13 Nov 2011 20:22:44 +0100 Subject: [PATCH] Better toolpaths for infills with different density --- lib/Slic3r/Fill.pm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index 579e07682..ad41cfd26 100644 --- a/lib/Slic3r/Fill.pm +++ b/lib/Slic3r/Fill.pm @@ -41,8 +41,6 @@ sub make_fill { printf "Filling layer %d:\n", $layer->id; foreach my $surfaces (@{ $layer->fill_surfaces }) { - my @path_collection = (); - SURFACE: foreach my $surface (@$surfaces) { Slic3r::debugf " Processing surface %s:\n", $surface->id; @@ -66,17 +64,17 @@ sub make_fill { flow_width => $flow_width, ); - push @path_collection, map Slic3r::ExtrusionPath->cast( - [ @$_ ], - depth_layers => $surface->depth_layers, - ), @paths; + # save into layer + push @{ $layer->fills }, Slic3r::ExtrusionPath::Collection->new( + paths => [ + map Slic3r::ExtrusionPath->cast( + [ @$_ ], + depth_layers => $surface->depth_layers, + ), @paths, + ], + ); + $layer->fills->[-1]->cleanup; } - - # save into layer - push @{ $layer->fills }, Slic3r::ExtrusionPath::Collection->new( - paths => [ @path_collection ], - ); - $layer->fills->[-1]->cleanup; } }