Apply a true double-ended nearest-neightbor search to thin fills in order to minimize travel moves between them. #2213

This commit is contained in:
Alessandro Ranellucci 2014-12-20 22:40:43 +01:00
parent 79ac29b435
commit 795c85d30e
2 changed files with 24 additions and 27 deletions

View file

@ -179,7 +179,6 @@ sub make_fill {
}
my @fills = ();
my @fills_ordering_points = ();
SURFACE: foreach my $surface (@surfaces) {
next if $surface->surface_type == S_TYPE_INTERNALVOID;
my $filler = $layerm->config->fill_pattern;
@ -244,19 +243,13 @@ sub make_fill {
), @polylines,
);
}
push @fills_ordering_points, $polylines[0]->first_point;
}
# add thin fill regions
foreach my $thin_fill (@{$layerm->thin_fills}) {
push @fills, Slic3r::ExtrusionPath::Collection->new($thin_fill);
push @fills_ordering_points, $thin_fill->first_point;
}
# organize infill paths using a nearest-neighbor search
@fills = @fills[ @{chained_path(\@fills_ordering_points)} ];
return @fills;
}