mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-01 05:01:10 -06:00
Many changes and fixes to remove leaks and return objects by reference
This commit is contained in:
parent
275422fac7
commit
a49dc603cc
27 changed files with 67 additions and 46 deletions
|
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 4;
|
||||
use Test::More tests => 5;
|
||||
|
||||
my $square = [ # ccw
|
||||
[200, 100],
|
||||
|
|
@ -20,6 +20,21 @@ my $hole_in_square = [ # cw
|
|||
];
|
||||
my $expolygon = Slic3r::ExPolygon->new($square, $hole_in_square);
|
||||
|
||||
{
|
||||
my $result = Slic3r::Geometry::Clipper::offset([ $square, $hole_in_square ], 5);
|
||||
is_deeply [ map $_->pp, @$result ], [ [
|
||||
[205, 95],
|
||||
[205, 205],
|
||||
[95, 205],
|
||||
[95, 95],
|
||||
], [
|
||||
[155, 145],
|
||||
[145, 145],
|
||||
[145, 155],
|
||||
[155, 155],
|
||||
] ], 'offset';
|
||||
}
|
||||
|
||||
{
|
||||
my $result = Slic3r::Geometry::Clipper::offset_ex([ @$expolygon ], 5);
|
||||
is_deeply $result->[0]->pp, [ [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue