mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-30 08:32:42 +00:00
Implemented split_at_index() and split_at_first_point() for Polygon
This commit is contained in:
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user