mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-20 23:31:13 -06:00
Ported point_along_segment(), Polyline::length(), Polyline::clip_end() to XS
This commit is contained in:
parent
26a18a2a52
commit
29b83517cb
12 changed files with 64 additions and 57 deletions
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 5;
|
||||
use Test::More tests => 6;
|
||||
|
||||
my $points = [
|
||||
[100, 100],
|
||||
|
@ -28,4 +28,10 @@ is_deeply [ map $_->pp, @$lines ], [
|
|||
$polyline->append_polyline($polyline->clone);
|
||||
is_deeply $polyline->pp, [ @$points, @$points ], 'append_polyline';
|
||||
|
||||
{
|
||||
my $len = $polyline->length;
|
||||
$polyline->clip_end($len/3);
|
||||
ok abs($polyline->length - ($len-($len/3))) < 1, 'clip_end';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue