diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2013-08-16 11:09:56 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2013-08-16 11:09:56 +0400 |
commit | fa07c512b466e8c81fb72fba4b2e66cefc53900c (patch) | |
tree | 82fcdfa8419d67ba1f44aee2a3b00984baec3a3d /t/fill.t | |
parent | b38cc2c2442dfc8abd5b24e2964246075b2b3a19 (diff) | |
parent | 314f377d7b4d1cfa349336d2435d144a25cdb7a4 (diff) |
Merge branch 'master' into xsdata
Conflicts:
lib/Slic3r/Layer/Region.pm
lib/Slic3r/Print.pm
lib/Slic3r/Print/Object.pm
Diffstat (limited to 't/fill.t')
-rw-r--r-- | t/fill.t | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -2,7 +2,7 @@ use Test::More; use strict; use warnings; -plan tests => 32; +plan tests => 33; BEGIN { use FindBin; @@ -51,17 +51,21 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ } { my $test = sub { - my ($expolygon, $flow_spacing) = @_; + my ($expolygon, $flow_spacing, $angle, $density) = @_; my $filler = Slic3r::Fill::Rectilinear->new( bounding_box => $expolygon->bounding_box, - angle => 0, + angle => $angle // 0, ); my $surface = Slic3r::Surface->new( surface_type => S_TYPE_BOTTOM, expolygon => $expolygon, ); - my ($params, @paths) = $filler->fill_surface($surface, flow_spacing => $flow_spacing, density => 1); + my ($params, @paths) = $filler->fill_surface( + $surface, + flow_spacing => $flow_spacing, + density => $density // 1, + ); # check whether any part was left uncovered my @grown_paths = map Slic3r::Polyline->new(@$_)->grow(scale $params->{flow_spacing}/2), @paths; @@ -100,6 +104,9 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ } [[59515297,5422499],[59531249,5578697],[59695801,6123186],[59965713,6630228],[60328214,7070685],[60773285,7434379],[61274561,7702115],[61819378,7866770],[62390306,7924789],[62958700,7866744],[63503012,7702244],[64007365,7434357],[64449960,7070398],[64809327,6634999],[65082143,6123325],[65245005,5584454],[65266967,5422499],[66267307,5422499],[66269190,8310081],[66275379,17810072],[66277259,20697500],[65267237,20697500],[65245004,20533538],[65082082,19994444],[64811462,19488579],[64450624,19048208],[64012101,18686514],[63503122,18415781],[62959151,18251378],[62453416,18198442],[62390147,18197355],[62200087,18200576],[61813519,18252990],[61274433,18415918],[60768598,18686517],[60327567,19047892],[59963609,19493297],[59695865,19994587],[59531222,20539379],[59515153,20697500],[58502480,20697500],[58502480,5422499]] ); $test->($expolygon, 0.524341649025257); + + $expolygon = Slic3r::ExPolygon->new([ scale_points [0,0], [98,0], [98,10], [0,10] ]); + $test->($expolygon, 0.5, 45, 0.99); # non-solid infill } { |