mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
More files for convex_hull
This commit is contained in:
parent
4577f0725c
commit
5309e3ef22
4 changed files with 103 additions and 0 deletions
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__
|
Loading…
Add table
Add a link
Reference in a new issue