diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2011-10-06 14:20:25 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2011-10-06 14:20:25 +0400 |
commit | e2d2574b8be712d76bbf0e51974cca96d308889b (patch) | |
tree | 151979f594a72812f29ff458d3e00ca11c0721d6 /t/geometry.t | |
parent | 5812804d6b8a38b023b76249da11b3a5b3cfa068 (diff) |
New algorithm for clipping lines to complex polygons
Diffstat (limited to 't/geometry.t')
-rw-r--r-- | t/geometry.t | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/t/geometry.t b/t/geometry.t index 3d9018686..decdad899 100644 --- a/t/geometry.t +++ b/t/geometry.t @@ -2,7 +2,7 @@ use Test::More; use strict; use warnings; -plan tests => 4; +plan tests => 5; BEGIN { use FindBin; @@ -13,8 +13,14 @@ use Slic3r; #========================================================== -my $line1 = [ [73.6310778185108/0.0000001, 371.74239268924/0.0000001], [73.6310778185108/0.0000001, 501.74239268924/0.0000001] ]; -my $line2 = [ [75/0.0000001, 437.9853/0.0000001], [62.7484/0.0000001, 440.4223/0.0000001] ]; +my $line1 = [ [5, 15], [30, 15] ]; +my $line2 = [ [10, 20], [10, 10] ]; +is_deeply Slic3r::Geometry::line_intersection($line1, $line2, 1), [10, 15], 'line_intersection'; + +#========================================================== + +$line1 = [ [73.6310778185108/0.0000001, 371.74239268924/0.0000001], [73.6310778185108/0.0000001, 501.74239268924/0.0000001] ]; +$line2 = [ [75/0.0000001, 437.9853/0.0000001], [62.7484/0.0000001, 440.4223/0.0000001] ]; isnt Slic3r::Geometry::line_intersection($line1, $line2, 1), undef, 'line_intersection'; #========================================================== |