Fixed regression causing inefficient paths during infill

This commit is contained in:
Alessandro Ranellucci 2012-12-20 18:10:20 +01:00
parent dcc0ce78db
commit bf603b0221
3 changed files with 50 additions and 5 deletions

View file

@ -12,11 +12,15 @@ sub shortest_path {
my $self = shift;
my ($start_near) = @_;
# make sure we pass the same path objects to the Collection constructor
# and the ->shortest_path() method because the latter will reverse the
# paths in-place when needed and we need to return them that way
my @paths = map $_->unpack, @{$self->paths};
my $collection = Slic3r::Polyline::Collection->new(
polylines => [ map $_->unpack->polyline, @{$self->paths} ],
polylines => [ map $_->polyline, @paths ],
);
return $collection->shortest_path($start_near, $self->paths);
return $collection->shortest_path($start_near, \@paths);
}
sub cleanup {