Rename shortest_path to chained_path, which reflects its algorithm more correctly

This commit is contained in:
Alessandro Ranellucci 2013-02-05 17:27:45 +01:00
parent 11637d527a
commit 090e3b1fe3
10 changed files with 19 additions and 19 deletions

View file

@ -8,19 +8,19 @@ sub endpoints {
return [ map $_->endpoints, @{$self->paths} ];
}
sub shortest_path {
sub chained_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
# and the ->chained_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 $_->polyline, @paths ],
);
return $collection->shortest_path($start_near, \@paths);
return $collection->chained_path($start_near, \@paths);
}
sub cleanup {