7
use Test::More tests => 8;
15
my $path = Slic3r::ExtrusionPath->new(
16
polyline => Slic3r::Polyline->new(@$points),
17
role => Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER,
20
isa_ok $path->polyline, 'Slic3r::Polyline::Ref', 'path polyline';
21
is_deeply $path->polyline->pp, $points, 'path points roundtrip';
24
is_deeply $path->polyline->pp, [ reverse @$points ], 'reverse path';
26
$path->append([ 150, 150 ]);
27
is scalar(@$path), 4, 'append to path';
30
is scalar(@$path), 3, 'pop_back from path';
32
ok $path->first_point->coincides_with($path->polyline->[0]), 'first_point';
36
is $path->role, Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER, 'role';
37
$path->role(Slic3r::ExtrusionPath::EXTR_ROLE_FILL);
38
is $path->role, Slic3r::ExtrusionPath::EXTR_ROLE_FILL, 'modify role';