mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-01 21:21:10 -06:00
Adopt XS containers everywhere (incomplete work)
This commit is contained in:
parent
339ba9e5c3
commit
9b582a11ff
30 changed files with 130 additions and 311 deletions
|
|
@ -16,11 +16,11 @@ my $path = Slic3r::ExtrusionPath->new(
|
|||
polyline => Slic3r::Polyline->new(@$points),
|
||||
role => Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER,
|
||||
);
|
||||
isa_ok $path->as_polyline, 'Slic3r::Polyline', 'path polyline';
|
||||
is_deeply $path->as_polyline->pp, $points, 'path points roundtrip';
|
||||
isa_ok $path->polyline, 'Slic3r::Polyline', 'path polyline';
|
||||
is_deeply $path->polyline->pp, $points, 'path points roundtrip';
|
||||
|
||||
$path->reverse;
|
||||
is_deeply $path->as_polyline->pp, [ reverse @$points ], 'reverse path';
|
||||
is_deeply $path->polyline->pp, [ reverse @$points ], 'reverse path';
|
||||
|
||||
$path->append([ 150, 150 ]);
|
||||
is scalar(@$path), 4, 'append to path';
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ my $loop = Slic3r::ExtrusionLoop->new(
|
|||
polygon => Slic3r::Polygon->new(@$square),
|
||||
role => Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER,
|
||||
);
|
||||
isa_ok $loop->as_polygon, 'Slic3r::Polygon', 'loop polygon';
|
||||
is_deeply $loop->as_polygon->pp, $square, 'polygon points roundtrip';
|
||||
isa_ok $loop->polygon, 'Slic3r::Polygon', 'loop polygon';
|
||||
is_deeply $loop->polygon->pp, $square, 'polygon points roundtrip';
|
||||
|
||||
$loop = $loop->clone;
|
||||
|
||||
|
|
@ -28,10 +28,10 @@ is $loop->role, Slic3r::ExtrusionPath::EXTR_ROLE_FILL, 'modify role';
|
|||
|
||||
{
|
||||
my $path = $loop->split_at_first_point;
|
||||
is_deeply $path->as_polyline->pp, $square, 'split_at_first_point';
|
||||
is_deeply $path->polyline->pp, $square, 'split_at_first_point';
|
||||
is $path->role, $loop->role, 'role preserved after split';
|
||||
|
||||
is_deeply $loop->split_at_index(2)->as_polyline->pp, [ @$square[2,3,0,1] ], 'split_at_index';
|
||||
is_deeply $loop->split_at_index(2)->polyline->pp, [ @$square[2,3,0,1] ], 'split_at_index';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue