From 045bfaea8400b54fbcfc76fa6505e8497f6b3a2b Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Wed, 1 Aug 2018 19:37:26 -0500 Subject: [PATCH] Added more tests from fill.t --- src/test/libslic3r/test_fill.cpp | 54 ++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/src/test/libslic3r/test_fill.cpp b/src/test/libslic3r/test_fill.cpp index 52eb495a5..a1ce98b4c 100644 --- a/src/test/libslic3r/test_fill.cpp +++ b/src/test/libslic3r/test_fill.cpp @@ -138,35 +138,41 @@ TEST_CASE("Fill: Pattern Path Length") { REQUIRE(test_if_solid_surface_filled(expolygon, 0.55) == true); } } + SECTION("Solid surface fill") { + Points points { + Point(59515297,5422499),Point(59531249,5578697),Point(59695801,6123186), + Point(59965713,6630228),Point(60328214,7070685),Point(60773285,7434379), + Point(61274561,7702115),Point(61819378,7866770),Point(62390306,7924789), + Point(62958700,7866744),Point(63503012,7702244),Point(64007365,7434357), + Point(64449960,7070398),Point(64809327,6634999),Point(65082143,6123325), + Point(65245005,5584454),Point(65266967,5422499),Point(66267307,5422499), + Point(66269190,8310081),Point(66275379,17810072),Point(66277259,20697500), + Point(65267237,20697500),Point(65245004,20533538),Point(65082082,19994444), + Point(64811462,19488579),Point(64450624,19048208),Point(64012101,18686514), + Point(63503122,18415781),Point(62959151,18251378),Point(62453416,18198442), + Point(62390147,18197355),Point(62200087,18200576),Point(61813519,18252990), + Point(61274433,18415918),Point(60768598,18686517),Point(60327567,19047892), + Point(59963609,19493297),Point(59695865,19994587),Point(59531222,20539379), + Point(59515153,20697500),Point(58502480,20697500),Point(58502480,5422499) + }; + ExPolygon expolygon(points); + + REQUIRE(test_if_solid_surface_filled(expolygon, 0.55) == true); + REQUIRE(test_if_solid_surface_filled(expolygon, 0.55, PI/2.0) == true); + } + SECTION("Solid surface fill") { + Points points { + Point::new_scale(0,0),Point::new_scale(98,0),Point::new_scale(98,10), Point::new_scale(0,10) + }; + ExPolygon expolygon(points); + + REQUIRE(test_if_solid_surface_filled(expolygon, 0.5, 45.0, 0.99) == true); + } } /* -{ - - my $expolygon = Slic3r::ExPolygon->new([ - [6883102, 9598327.01296997], - [6883102, 20327272.01297], - [3116896, 20327272.01297], - [3116896, 9598327.01296997], - ]); - $test->($expolygon, 0.55); - - for (1..20) { - $expolygon->scale(1.05); - $test->($expolygon, 0.55); - } - - $expolygon = Slic3r::ExPolygon->new( - [[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, PI/2); - - $expolygon = Slic3r::ExPolygon->new([ scale_points [0,0], [98,0], [98,10], [0,10] ]); - $test->($expolygon, 0.5, 45, 0.99); # non-solid infill -} - { my $collection = Slic3r::Polyline::Collection->new( Slic3r::Polyline->new([0,15], [0,18], [0,20]),