2013-07-15 10:14:22 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use Slic3r::XS;
|
|
|
|
use Test::More tests => 3;
|
|
|
|
|
|
|
|
my $square = [ # ccw
|
|
|
|
[100, 100],
|
|
|
|
[200, 100],
|
|
|
|
[200, 200],
|
|
|
|
[100, 200],
|
|
|
|
];
|
|
|
|
|
2013-07-15 20:57:22 +00:00
|
|
|
my $polygon = Slic3r::Polygon->new(@$square);
|
|
|
|
is_deeply [ @{$polygon->pp} ], [ @$square ], 'polygon roundtrip';
|
2013-07-15 10:14:22 +00:00
|
|
|
|
2013-07-15 20:57:22 +00:00
|
|
|
is ref($polygon->arrayref), 'ARRAY', 'polygon arrayref is unblessed';
|
|
|
|
isa_ok $polygon->[0], 'Slic3r::Point', 'polygon point is blessed';
|
2013-07-15 10:14:22 +00:00
|
|
|
|
|
|
|
__END__
|