mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-30 08:32:42 +00:00
More files for convex_hull
This commit is contained in:
22
xs/t/14_geometry.t
Normal file
22
xs/t/14_geometry.t
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 2;
|
||||
|
||||
{
|
||||
my @points = (
|
||||
Slic3r::Point->new(100,100),
|
||||
Slic3r::Point->new(100,200),
|
||||
Slic3r::Point->new(200,200),
|
||||
Slic3r::Point->new(200,100),
|
||||
Slic3r::Point->new(150,150),
|
||||
);
|
||||
my $hull = Slic3r::Geometry::convex_hull(\@points);
|
||||
isa_ok $hull, 'Slic3r::Polygon', 'convex_hull returns a Polygon';
|
||||
is scalar(@$hull), 4, 'convex_hull returns the correct number of points';
|
||||
}
|
||||
|
||||
__END__
|
||||
Reference in New Issue
Block a user