Enforce seam alignment and blend in spiral vase. #2023

This commit is contained in:
Alessandro Ranellucci 2014-05-22 12:28:12 +02:00
parent 254ab29a97
commit f2c5e799b1
17 changed files with 174 additions and 33 deletions

View file

@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 10;
use Test::More tests => 14;
my $points = [
[100, 100],
@ -51,4 +51,16 @@ is_deeply $polyline->pp, [ @$points, @$points ], 'append_polyline';
is $polyline->length, 100*2 + 50 + 50, 'extend_start';
}
{
my $polyline = Slic3r::Polyline->new(@$points);
my $p1 = Slic3r::Polyline->new;
my $p2 = Slic3r::Polyline->new;
my $point = Slic3r::Point->new(150, 100);
$polyline->split_at($point, $p1, $p2);
is scalar(@$p1), 2, 'split_at';
is scalar(@$p2), 3, 'split_at';
ok $p1->last_point->coincides_with($point), 'split_at';
ok $p2->first_point->coincides_with($point), 'split_at';
}
__END__