mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-07 07:29:06 +08:00
Test shortest path algorithm
This commit is contained in:
parent
accc598eb5
commit
3a2ca92ec3
13
t/fill.t
13
t/fill.t
@ -2,7 +2,7 @@ use Test::More;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
plan tests => 4;
|
||||
plan tests => 5;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
@ -41,4 +41,15 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
my $collection = Slic3r::Polyline::Collection->new(polylines => [
|
||||
Slic3r::Polyline->new([0,15], [0,18], [0,20]),
|
||||
Slic3r::Polyline->new([0,10], [0,8], [0,5]),
|
||||
]);
|
||||
is_deeply
|
||||
[ map $_->[Y], map @$_, $collection->shortest_path(Slic3r::Point->new(0,30)) ],
|
||||
[20, 18, 15, 10, 8, 5],
|
||||
'shortest path';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
Loading…
x
Reference in New Issue
Block a user