mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 20:51:23 -07:00
Implement split_at_index() and split_at_first_point() in ExtrusionLoop too
This commit is contained in:
parent
0d07a2e4e6
commit
339ba9e5c3
4 changed files with 38 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 4;
|
||||
use Test::More tests => 7;
|
||||
|
||||
my $square = [
|
||||
[100, 100],
|
||||
|
|
@ -26,4 +26,12 @@ is $loop->role, Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER, 'role';
|
|||
$loop->role(Slic3r::ExtrusionPath::EXTR_ROLE_FILL);
|
||||
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 $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';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue