Refactor chained_path(), add chained_path_items() and chained_path_points()

This commit is contained in:
Alessandro Ranellucci 2013-02-06 12:03:53 +01:00
parent e593a30fc7
commit 26a3cd5542
3 changed files with 37 additions and 19 deletions

View file

@ -182,10 +182,8 @@ sub make_fill {
push @fills, @{$layer->thin_fills};
push @fills_ordering_points, map $_->unpack->points->[0], @{$layer->thin_fills};
# organize infill paths using a shortest path search
@fills = @{chained_path([
map [ $fills_ordering_points[$_], $fills[$_] ], 0..$#fills,
])};
# organize infill paths using a nearest-neighbor search
@fills = @fills[ chained_path(\@fills_ordering_points) ];
return @fills;
}