diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2013-08-27 03:26:44 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2013-08-27 03:26:44 +0400 |
commit | fb763b01879f6943bf8f601f37e03947ccbf7511 (patch) | |
tree | 9a517eb477b366c33c622ab219289714a4e3fa02 /t/polyclip.t | |
parent | b11b595c97232f5ff68fc6fa2ddab6b69108f459 (diff) |
Removed dependency on Math::Clipper
Diffstat (limited to 't/polyclip.t')
-rw-r--r-- | t/polyclip.t | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/t/polyclip.t b/t/polyclip.t index 2cfe6951f..1711abfd1 100644 --- a/t/polyclip.t +++ b/t/polyclip.t @@ -9,7 +9,6 @@ BEGIN { use lib "$FindBin::Bin/../lib"; } -use Math::Clipper qw(is_counter_clockwise); use Slic3r; #========================================================== @@ -115,7 +114,7 @@ is_deeply $intersection, [ [120, 120], [180, 160] ], 'internal lines are preserv #========================================================== { - my $large_circle = [ # ccw + my $large_circle = Slic3r::Polygon->new( # ccw [151.8639,288.1192], [133.2778,284.6011], [115.0091,279.6997], [98.2859,270.8606], [82.2734,260.7933], [68.8974,247.4181], [56.5622,233.0777], [47.7228,216.3558], [40.1617,199.0172], [36.6431,180.4328], [34.932,165.2312], [37.5567,165.1101], [41.0547,142.9903], [36.9056,141.4295], [40.199,124.1277], @@ -125,10 +124,10 @@ is_deeply $intersection, [ [120, 120], [180, 160] ], 'internal lines are preserv [275.6832,106.6636], [281.9225,124.52], [286.8064,142.795], [287.5061,161.696], [286.7874,180.5972], [281.8856,198.8664], [275.6283,216.7169], [265.5604,232.7294], [254.3211,247.942], [239.9802,260.2776], [224.757,271.5022], [207.4179,279.0635], [189.5605,285.3035], [170.7649,287.4188], - ]; - is is_counter_clockwise($large_circle), 1, "contour is counter-clockwise"; + ); + ok $large_circle->is_counter_clockwise, "contour is counter-clockwise"; - my $small_circle = [ # cw + my $small_circle = Slic3r::Polygon->new( # cw [158.227,215.9007], [164.5136,215.9007], [175.15,214.5007], [184.5576,210.6044], [190.2268,207.8743], [199.1462,201.0306], [209.0146,188.346], [213.5135,177.4829], [214.6979,168.4866], [216.1025,162.3325], [214.6463,151.2703], [213.2471,145.1399], [209.0146,134.9203], [199.1462,122.2357], [189.8944,115.1366], @@ -136,8 +135,8 @@ is_deeply $intersection, [ [120, 120], [180, 160] ], 'internal lines are preserv [138.183,112.6616], [132.5135,115.3919], [123.5943,122.2357], [113.7259,134.92], [109.2269,145.7834], [108.0426,154.7799], [106.638,160.9339], [108.0941,171.9957], [109.4933,178.1264], [113.7259,188.3463], [123.5943,201.0306], [132.8461,208.1296], [141.4901,211.7094], [147.172,214.4458], - ]; - is is_counter_clockwise($small_circle), 0, "hole is clockwise"; + ); + ok $small_circle->is_clockwise, "hole is clockwise"; my $expolygon = Slic3r::ExPolygon->new($large_circle, $small_circle); $line = Slic3r::Line->new([152.742,288.086671142818], [152.742,34.166466971035]); |