mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-30 16:42:43 +00:00
Fix overflow in Point::ccw() affecting convex hull generation. Includes regression test
This commit is contained in:
@@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 9;
|
||||
use Test::More tests => 10;
|
||||
|
||||
my $point = Slic3r::Point->new(10, 15);
|
||||
is_deeply [ @$point ], [10, 15], 'point roundtrip';
|
||||
@@ -39,4 +39,11 @@ ok !$point->coincides_with($point2), 'coincides_with';
|
||||
is $point->distance_to_line($line), 16671685, 'distance_to_line() does not overflow';
|
||||
}
|
||||
|
||||
{
|
||||
my $p0 = Slic3r::Point->new(76975850,89989996);
|
||||
my $p1 = Slic3r::Point->new(76989990,109989991);
|
||||
my $p2 = Slic3r::Point->new(76989987,89989994);
|
||||
ok $p0->ccw($p1, $p2) < 0, 'ccw() does not overflow';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
||||
Reference in New Issue
Block a user