Merge branch 'master' into xsdata
Conflicts: lib/Slic3r.pm lib/Slic3r/ExPolygon.pm lib/Slic3r/Fill.pm lib/Slic3r/Fill/Rectilinear.pm lib/Slic3r/GCode.pm lib/Slic3r/GUI/Plater.pm lib/Slic3r/Geometry/Clipper.pm lib/Slic3r/Layer/Region.pm lib/Slic3r/Print.pm lib/Slic3r/Print/Object.pm lib/Slic3r/TriangleMesh.pm t/shells.t xs/MANIFEST
This commit is contained in:
commit
b38cc2c244
60 changed files with 1432 additions and 798 deletions
|
@ -2,7 +2,7 @@ use Test::More;
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
plan tests => 7;
|
||||
plan tests => 10;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
|
@ -78,6 +78,28 @@ use Slic3r;
|
|||
ok @simplified == 1, 'gear simplified to a single polygon';
|
||||
note sprintf "original points: %d\nnew points: %d", $num_points, scalar(@{$simplified[0]});
|
||||
ok @{$simplified[0]} < $num_points, 'gear was further simplified using Douglas-Peucker';
|
||||
|
||||
my @simplified_ex = Slic3r::ExPolygon->new($polygon)->simplify(10);
|
||||
is_deeply [ map $_->pp, @simplified_ex ], [ [ map $_->pp, @simplified ] ], 'simplified polygon equals simplified expolygon';
|
||||
}
|
||||
|
||||
{
|
||||
my $square = Slic3r::Polygon->new( # ccw
|
||||
[100, 100],
|
||||
[200, 100],
|
||||
[200, 200],
|
||||
[100, 200],
|
||||
);
|
||||
my $hole_in_square = Slic3r::Polygon->new( # cw
|
||||
[140, 140],
|
||||
[140, 160],
|
||||
[160, 160],
|
||||
[160, 140],
|
||||
);
|
||||
my $expolygon = Slic3r::ExPolygon->new($square, $hole_in_square);
|
||||
my @simplified = $hole_in_square->simplify;
|
||||
is scalar(@simplified), 1, 'hole simplification returns one polygon';
|
||||
ok $simplified[0]->is_counter_clockwise, 'hole simplification turns cw polygon into ccw polygon';
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue