mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-10 15:25:18 -06:00
Bugfix: a bug in Polyline::split_at() caused random loss of perimeter segments. #2495
This commit is contained in:
parent
a6f3e6bfdb
commit
6776d6bc00
5 changed files with 31 additions and 4 deletions
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 16;
|
||||
use Test::More tests => 18;
|
||||
|
||||
my $points = [
|
||||
[100, 100],
|
||||
|
@ -79,4 +79,13 @@ is_deeply $polyline->pp, [ @$points, @$points ], 'append_polyline';
|
|||
ok $p2->first_point->coincides_with($point), 'split_at';
|
||||
}
|
||||
|
||||
{
|
||||
my $polyline = Slic3r::Polyline->new(@$points[0,1,2,0]);
|
||||
my $p1 = Slic3r::Polyline->new;
|
||||
my $p2 = Slic3r::Polyline->new;
|
||||
$polyline->split_at($polyline->first_point, $p1, $p2);
|
||||
is scalar(@$p1), 1, 'split_at';
|
||||
is scalar(@$p2), 4, 'split_at';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue