Ported Slic3r::ExPolygon::Collection to XS

This commit is contained in:
Alessandro Ranellucci 2013-07-14 00:38:01 +02:00
parent 7f4dc4e248
commit b1ad466189
10 changed files with 173 additions and 68 deletions

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 9;
use Test::More tests => 11;
use constant PI => 4 * atan2(1, 1);
@ -71,4 +71,15 @@ isa_ok $expolygon->[0][0], 'Slic3r::Point', 'Perl polygon points are blessed';
], 'rotate around pure-Perl Point';
}
{
my $expolygon2 = $expolygon->clone;
$expolygon2->scale(2);
my $collection = Slic3r::ExPolygon::Collection->new($expolygon->arrayref, $expolygon2->arrayref);
is_deeply [ @$collection ], [ $expolygon->arrayref, $expolygon2->arrayref ],
'expolygon collection';
my $collection2 = Slic3r::ExPolygon::Collection->new($expolygon, $expolygon2);
is_deeply [ @$collection ], [ @$collection2 ],
'expolygon collection with XS expolygons';
}
__END__