mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-01 05:01:10 -06:00
Some tests were failing
This commit is contained in:
parent
02a1b0cdab
commit
7628c83e9f
5 changed files with 64 additions and 65 deletions
14
t/clipper.t
14
t/clipper.t
|
|
@ -1,4 +1,6 @@
|
|||
use Test::More;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
plan tests => 1;
|
||||
|
||||
|
|
@ -20,7 +22,7 @@ my $hole_in_square = [ # cw
|
|||
[16, 14],
|
||||
];
|
||||
|
||||
my $square = [ # ccw
|
||||
my $square2 = [ # ccw
|
||||
[5, 12],
|
||||
[25, 12],
|
||||
[25, 18],
|
||||
|
|
@ -28,7 +30,7 @@ my $square = [ # ccw
|
|||
];
|
||||
|
||||
$clipper->add_subject_polygons([ $square, $hole_in_square ]);
|
||||
$clipper->add_clip_polygons([ $square ]);
|
||||
$clipper->add_clip_polygons([ $square2 ]);
|
||||
my $intersection = $clipper->ex_execute(CT_INTERSECTION, PFT_NONZERO, PFT_NONZERO);
|
||||
|
||||
is_deeply $intersection, [
|
||||
|
|
@ -42,10 +44,10 @@ is_deeply $intersection, [
|
|||
],
|
||||
],
|
||||
outer => [
|
||||
[5, 18],
|
||||
[5, 12],
|
||||
[25, 12],
|
||||
[25, 18],
|
||||
[10, 18],
|
||||
[10, 12],
|
||||
[20, 12],
|
||||
[20, 18],
|
||||
],
|
||||
},
|
||||
], 'hole is preserved after intersection';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue