diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2013-05-11 11:19:23 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2013-05-11 11:19:23 +0400 |
commit | 7953dcfb1277b0522226c66831437c7bda36ea6a (patch) | |
tree | c2bda152b3fdc939e1108a3e1e53ee1301846d86 /t/clipper.t | |
parent | bac5093de49a2ad6f043cd37e7ae42b20a2a07ed (diff) | |
parent | 6b8894cf9aab685c471c412545e5ce57f47d468a (diff) |
Merge branch 'better-brim'
Conflicts:
lib/Slic3r/Geometry/Clipper.pm
lib/Slic3r/Print.pm
Diffstat (limited to 't/clipper.t')
-rw-r--r-- | t/clipper.t | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/t/clipper.t b/t/clipper.t index 7d316dde9..fda0c9270 100644 --- a/t/clipper.t +++ b/t/clipper.t @@ -30,21 +30,22 @@ use Math::Clipper ':all'; $clipper->add_subject_polygons([ $square, $hole_in_square ]); $clipper->add_clip_polygons([ $square2 ]); my $intersection = $clipper->ex_execute(CT_INTERSECTION, PFT_NONZERO, PFT_NONZERO); + is_deeply $intersection, [ { holes => [ [ + [14, 14], [14, 16], [16, 16], [16, 14], - [14, 14], ], ], outer => [ - [10, 18], - [10, 12], [20, 12], [20, 18], + [10, 18], + [10, 12], ], }, ], 'hole is preserved after intersection'; @@ -60,14 +61,15 @@ use Math::Clipper ':all'; my $clipper = Math::Clipper->new; $clipper->add_subject_polygons([ $contour1, $contour2, $hole ]); my $union = $clipper->ex_execute(CT_UNION, PFT_NONZERO, PFT_NONZERO); - is_deeply $union, [{ holes => [], outer => [ [0,40], [0,0], [40,0], [40,40] ] }], + + is_deeply $union, [{ holes => [], outer => [ [40,0], [40,40], [0,40], [0,0] ] }], 'union of two ccw and one cw is a contour with no holes'; $clipper->clear; $clipper->add_subject_polygons([ $contour1, $contour2 ]); $clipper->add_clip_polygons([ $hole ]); my $diff = $clipper->ex_execute(CT_DIFFERENCE, PFT_NONZERO, PFT_NONZERO); - is_deeply $diff, [{ holes => [[ [15,25], [25,25], [25,15], [15,15] ]], outer => [ [0,40], [0,0], [40,0], [40,40] ] }], + is_deeply $diff, [{ holes => [[ [15,15], [15,25], [25,25], [25,15] ]], outer => [ [40,0], [40,40], [0,40], [0,0] ] }], 'difference of a cw from two ccw is a contour with one hole'; } |