New +Line::intersection_infinite() method

This commit is contained in:
Alessandro Ranellucci 2015-01-16 16:25:39 +01:00
parent aa69ae11a8
commit e749f6040f
4 changed files with 33 additions and 1 deletions

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 39;
use Test::More tests => 40;
use constant PI => 4 * atan2(1, 1);
use constant EPSILON => 1E-4;
@ -71,4 +71,11 @@ foreach my $base_angle (0, PI/4, PI/2, PI) {
}
}
{
my $a = Slic3r::Line->new([100, 0], [200, 0]);
my $b = Slic3r::Line->new([300, 300], [300, 100]);
my $r = $a->intersection_infinite($b);
is_deeply $r->pp, [300, 0], 'intersection_infinite';
}
__END__