Ported ExPolygon->contour and ExPolygon->holes

This commit is contained in:
Alessandro Ranellucci 2013-08-26 23:09:18 +02:00
parent 85011dfef3
commit da0b85c0d9
7 changed files with 14 additions and 18 deletions

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 18;
use Test::More tests => 20;
use constant PI => 4 * atan2(1, 1);
@ -28,6 +28,8 @@ is_deeply $expolygon->pp, [$square, $hole_in_square], 'expolygon roundtrip';
is ref($expolygon->arrayref), 'ARRAY', 'expolygon arrayref is unblessed';
isa_ok $expolygon->[0], 'Slic3r::Polygon', 'expolygon polygon is blessed';
isa_ok $expolygon->contour, 'Slic3r::Polygon', 'expolygon contour is blessed';
isa_ok $expolygon->holes->[0], 'Slic3r::Polygon', 'expolygon hole is blessed';
isa_ok $expolygon->[0][0], 'Slic3r::Point', 'expolygon point is blessed';
{

View file

@ -13,6 +13,10 @@
%code{% RETVAL = THIS->to_SV(); %};
SV* pp()
%code{% RETVAL = THIS->to_SV_pureperl(); %};
Polygon* contour()
%code{% const char* CLASS = "Slic3r::Polygon"; RETVAL = new Polygon(THIS->contour); %};
Polygons holes()
%code{% RETVAL = THIS->holes; %};
void scale(double factor);
void translate(double x, double y);
double area();