Optimization of travel paths for fills

This commit is contained in:
Alessandro Ranellucci 2011-09-26 10:52:58 +02:00
parent 0cd10441a1
commit 415d1a5170
9 changed files with 230 additions and 136 deletions

View file

@ -22,4 +22,16 @@ sub clip_end {
}
}
sub endpoints {
my $self = shift;
my ($as_arrayref) = @_;
my @points = ($self->points->[0], $self->points->[-1]);
return $as_arrayref ? map($_->p, @points) : @points;
}
sub reverse {
my $self = shift;
@{$self->points} = reverse @{$self->points};
}
1;