mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 12:41:18 -07:00
Use XS Point everywhere
This commit is contained in:
parent
d0701cdcd4
commit
9af2a1c007
37 changed files with 238 additions and 303 deletions
12
t/polyclip.t
12
t/polyclip.t
|
|
@ -60,10 +60,10 @@ is_deeply $intersection, [ [120, 120], [180, 160] ], 'internal lines are preserv
|
|||
[160, 140],
|
||||
];
|
||||
my $expolygon = Slic3r::ExPolygon->new($square, $hole_in_square);
|
||||
is $expolygon->encloses_point([100, 100]), 1, 'corner point is recognized';
|
||||
is $expolygon->encloses_point([100, 180]), 1, 'point on contour is recognized';
|
||||
is $expolygon->encloses_point([140, 150]), 1, 'point on hole contour is recognized';
|
||||
is $expolygon->encloses_point([140, 140]), 1, 'point on hole corner is recognized';
|
||||
is $expolygon->encloses_point(Slic3r::Point->new(100, 100)), 1, 'corner point is recognized';
|
||||
is $expolygon->encloses_point(Slic3r::Point->new(100, 180)), 1, 'point on contour is recognized';
|
||||
is $expolygon->encloses_point(Slic3r::Point->new(140, 150)), 1, 'point on hole contour is recognized';
|
||||
is $expolygon->encloses_point(Slic3r::Point->new(140, 140)), 1, 'point on hole corner is recognized';
|
||||
{
|
||||
my $intersections = $expolygon->clip_line(Slic3r::Line->new([150,180], [150,150]));
|
||||
is_deeply $intersections, [
|
||||
|
|
@ -144,8 +144,8 @@ is_deeply $intersection, [ [120, 120], [180, 160] ], 'internal lines are preserv
|
|||
|
||||
my $intersections = $expolygon->clip_line($line);
|
||||
is_deeply $intersections, [
|
||||
[ [152.742, 288.086660915295], [152.742, 215.178843238354], ],
|
||||
[ [152.742, 108.087506777797], [152.742, 35.1664774739315] ],
|
||||
[ [152.742, 287.908315789474], [152.742, 214.522], ],
|
||||
[ [152.742, 107.478], [152.742, 35] ],
|
||||
], 'line is clipped to square with hole';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue