XS interface completed, including new Line class
This commit is contained in:
parent
9af2a1c007
commit
ab6b3d41a7
33 changed files with 435 additions and 257 deletions
|
@ -13,20 +13,20 @@ my $points = [
|
|||
];
|
||||
|
||||
my $path = Slic3r::ExtrusionPath->new(
|
||||
polyline => Slic3r::Polyline::XS->new(@$points),
|
||||
polyline => Slic3r::Polyline->new(@$points),
|
||||
role => Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER,
|
||||
);
|
||||
isa_ok $path->as_polyline, 'Slic3r::Polyline::XS', 'path polyline';
|
||||
is_deeply [ @{ $path->as_polyline->arrayref_pp } ], [ @$points ], 'path points roundtrip';
|
||||
isa_ok $path->as_polyline, 'Slic3r::Polyline', 'path polyline';
|
||||
is_deeply $path->as_polyline->pp, $points, 'path points roundtrip';
|
||||
|
||||
$path->reverse;
|
||||
is_deeply [ @{ $path->as_polyline->arrayref_pp } ], [ reverse @$points ], 'reverse path';
|
||||
is_deeply $path->as_polyline->pp, [ reverse @$points ], 'reverse path';
|
||||
|
||||
$path->append([ 150, 150 ]);
|
||||
is scalar(@{ $path }), 4, 'append to path';
|
||||
is scalar(@$path), 4, 'append to path';
|
||||
|
||||
$path->pop_back;
|
||||
is scalar(@{ $path }), 3, 'pop_back from path';
|
||||
is scalar(@$path), 3, 'pop_back from path';
|
||||
|
||||
$path = $path->clone;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue