mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 12:41:18 -07:00
Fix overflow in distance_to(Line*). It was affecting Douglas-Peucker causing massive loss of geometry. Includes regression test and a couple wkt() implementations
This commit is contained in:
parent
3a3e53b59b
commit
0d7f0705f0
6 changed files with 35 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 8;
|
||||
use Test::More tests => 9;
|
||||
|
||||
my $point = Slic3r::Point->new(10, 15);
|
||||
is_deeply [ @$point ], [10, 15], 'point roundtrip';
|
||||
|
|
@ -30,4 +30,13 @@ ok !$point->coincides_with($point2), 'coincides_with';
|
|||
ok $nearest->coincides_with($point2), 'nearest_point';
|
||||
}
|
||||
|
||||
{
|
||||
my $line = Slic3r::Line->new(
|
||||
[18335846,18335845],
|
||||
[18335846,1664160],
|
||||
);
|
||||
$point = Slic3r::Point->new(1664161,18335848);
|
||||
is $point->distance_to_line($line), 16671685, 'distance_to_line() does not overflow';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue