Smarter ordering of gap fill

This commit is contained in:
Alessandro Ranellucci 2013-07-26 00:03:28 +02:00
parent 2b8662cf0c
commit 8fe228fcee
2 changed files with 18 additions and 5 deletions

View file

@ -196,8 +196,10 @@ sub make_fill {
}
# add thin fill regions
push @fills, @{$layerm->thin_fills};
push @fills_ordering_points, map $_->unpack->points->[0], @{$layerm->thin_fills};
if (@{ $layerm->thin_fills }) {
push @fills, Slic3r::ExtrusionPath::Collection->new(paths => $layerm->thin_fills);
push @fills_ordering_points, $fills[-1]->first_point;
}
# organize infill paths using a nearest-neighbor search
@fills = @fills[ chained_path(\@fills_ordering_points) ];