Ported simplify() to XS and removed dependency on Boost::Geometry::Utils

This commit is contained in:
Alessandro Ranellucci 2013-11-22 16:01:50 +01:00
parent df8d889481
commit 132d170f73
8 changed files with 25 additions and 12 deletions

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 6;
use Test::More tests => 7;
my $points = [
[100, 100],
@ -34,4 +34,12 @@ is_deeply $polyline->pp, [ @$points, @$points ], 'append_polyline';
ok abs($polyline->length - ($len-($len/3))) < 1, 'clip_end';
}
{
my $polyline = Slic3r::Polyline->new(
[0,0], [50,50], [100,0], [125,-25], [150,50],
);
$polyline->simplify(25);
is_deeply $polyline->pp, [ [0, 0], [50, 50], [125, -25], [150, 50] ], 'Douglas-Peucker';
}
__END__