Implemented split_at_index() and split_at_first_point() for Polygon

This commit is contained in:
Alessandro Ranellucci 2013-07-15 23:38:06 +02:00
parent 62e5bd0ee7
commit 0d07a2e4e6
3 changed files with 29 additions and 1 deletions

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 4;
use Test::More tests => 6;
my $square = [ # ccw
[100, 100],
@ -27,4 +27,7 @@ is_deeply [ map $_->pp, @$lines ], [
[ [100, 200], [100, 100] ],
], 'polygon lines';
is_deeply $polygon->split_at_first_point->pp, $square, 'split_at_first_point';
is_deeply $polygon->split_at_index(2)->pp, [ @$square[2,3,0,1] ], 'split_at_index';
__END__