Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2014-05-26 13:50:42 +0400
committerAlessandro Ranellucci <aar@cpan.org>2014-05-26 13:50:42 +0400
commitabdf6531f1cc3ca84f8d8f8411fead98754f4675 (patch)
tree0230bf0f6e68a7cf9ce74131624d7803b9378e75 /t/geometry.t
parent7ea09a007112bbd09447df94fe62efd7deb4eecd (diff)
Bugfix: wrong logic for concave_points() and convex_points()
Diffstat (limited to 't/geometry.t')
-rw-r--r--t/geometry.t26
1 files changed, 25 insertions, 1 deletions
diff --git a/t/geometry.t b/t/geometry.t
index 7ff2a2aac..a9326782b 100644
--- a/t/geometry.t
+++ b/t/geometry.t
@@ -2,7 +2,7 @@ use Test::More;
use strict;
use warnings;
-plan tests => 29;
+plan tests => 33;
BEGIN {
use FindBin;
@@ -189,3 +189,27 @@ my $polygons = [
}
#==========================================================
+
+{
+ my $square = Slic3r::Polygon->new(
+ [150,100],
+ [200,100],
+ [200,200],
+ [100,200],
+ [100,100],
+ );
+ is scalar(@{$square->concave_points(PI*4/3)}), 0, 'no concave vertices detected in convex polygon';
+ is scalar(@{$square->convex_points(PI*2/3)}), 4, 'four convex vertices detected in square';
+}
+
+{
+ my $square = Slic3r::Polygon->new(
+ [200,200],
+ [100,200],
+ [100,100],
+ [150,100],
+ [200,100],
+ );
+ is scalar(@{$square->concave_points(PI*4/3)}), 0, 'no concave vertices detected in convex polygon';
+ is scalar(@{$square->convex_points(PI*2/3)}), 4, 'four convex vertices detected in square';
+}