Ported point_along_segment(), Polyline::length(), Polyline::clip_end() to XS

This commit is contained in:
Alessandro Ranellucci 2013-10-27 22:57:25 +01:00
parent 26a18a2a52
commit 29b83517cb
12 changed files with 64 additions and 57 deletions

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 5;
use Test::More tests => 6;
my $points = [
[100, 100],
@ -28,4 +28,10 @@ is_deeply [ map $_->pp, @$lines ], [
$polyline->append_polyline($polyline->clone);
is_deeply $polyline->pp, [ @$points, @$points ], 'append_polyline';
{
my $len = $polyline->length;
$polyline->clip_end($len/3);
ok abs($polyline->length - ($len-($len/3))) < 1, 'clip_end';
}
__END__