Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2011-10-06 14:20:25 +0400
committerAlessandro Ranellucci <aar@cpan.org>2011-10-06 14:20:25 +0400
commite2d2574b8be712d76bbf0e51974cca96d308889b (patch)
tree151979f594a72812f29ff458d3e00ca11c0721d6 /t/geometry.t
parent5812804d6b8a38b023b76249da11b3a5b3cfa068 (diff)
New algorithm for clipping lines to complex polygons
Diffstat (limited to 't/geometry.t')
-rw-r--r--t/geometry.t12
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';
#==========================================================