mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-09 14:55:08 -06:00
Polygon->lines
This commit is contained in:
parent
77c479c127
commit
62e5bd0ee7
3 changed files with 25 additions and 2 deletions
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 3;
|
||||
use Test::More tests => 4;
|
||||
|
||||
my $square = [ # ccw
|
||||
[100, 100],
|
||||
|
@ -19,4 +19,12 @@ is_deeply $polygon->pp, $square, 'polygon roundtrip';
|
|||
is ref($polygon->arrayref), 'ARRAY', 'polygon arrayref is unblessed';
|
||||
isa_ok $polygon->[0], 'Slic3r::Point', 'polygon point is blessed';
|
||||
|
||||
my $lines = $polygon->lines;
|
||||
is_deeply [ map $_->pp, @$lines ], [
|
||||
[ [100, 100], [200, 100] ],
|
||||
[ [200, 100], [200, 200] ],
|
||||
[ [200, 200], [100, 200] ],
|
||||
[ [100, 200], [100, 100] ],
|
||||
], 'polygon lines';
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue