Extend medial axis endpoints to fill the entire length. Includes fix for a minor memory leak caused by usage of old signature for Line::point_at()
This commit is contained in:
parent
52de292a48
commit
ed8a2f7330
8 changed files with 54 additions and 10 deletions
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 7;
|
||||
use Test::More tests => 10;
|
||||
|
||||
my $points = [
|
||||
[100, 100],
|
||||
|
@ -42,4 +42,13 @@ is_deeply $polyline->pp, [ @$points, @$points ], 'append_polyline';
|
|||
is_deeply $polyline->pp, [ [0, 0], [50, 50], [125, -25], [150, 50] ], 'Douglas-Peucker';
|
||||
}
|
||||
|
||||
{
|
||||
my $polyline = Slic3r::Polyline->new(@$points);
|
||||
is $polyline->length, 100*2, 'length';
|
||||
$polyline->extend_end(50);
|
||||
is $polyline->length, 100*2 + 50, 'extend_end';
|
||||
$polyline->extend_start(50);
|
||||
is $polyline->length, 100*2 + 50 + 50, 'extend_start';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue