Removed dependency on Math::Clipper

This commit is contained in:
Alessandro Ranellucci 2013-08-27 01:26:44 +02:00
parent b11b595c97
commit fb763b0187
21 changed files with 82 additions and 76 deletions

View file

@ -792,14 +792,13 @@ sub chained_path {
my %indices = map { $points[$_] => $_ } 0 .. $#points;
my @result = ();
my $last_point;
if (!$start_near) {
if (!$start_near && @points) {
$start_near = shift @points;
push @result, $indices{$start_near} if $start_near;
push @result, $indices{$start_near};
}
while (@points) {
$start_near = $start_near->nearest_point(\@points);
@points = grep $_ ne $start_near, @points;
my $idx = $start_near->nearest_point_index(\@points);
my ($start_near) = splice @points, $idx, 1;
push @result, $indices{$start_near};
}