mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-10 15:25:18 -06:00
Implemented split_at_index() and split_at_first_point() for Polygon
This commit is contained in:
parent
62e5bd0ee7
commit
0d07a2e4e6
3 changed files with 29 additions and 1 deletions
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 4;
|
||||
use Test::More tests => 6;
|
||||
|
||||
my $square = [ # ccw
|
||||
[100, 100],
|
||||
|
@ -27,4 +27,7 @@ is_deeply [ map $_->pp, @$lines ], [
|
|||
[ [100, 200], [100, 100] ],
|
||||
], 'polygon lines';
|
||||
|
||||
is_deeply $polygon->split_at_first_point->pp, $square, 'split_at_first_point';
|
||||
is_deeply $polygon->split_at_index(2)->pp, [ @$square[2,3,0,1] ], 'split_at_index';
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue