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
path: root/t/thin.t
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2015-05-13 21:47:26 +0300
committerAlessandro Ranellucci <aar@cpan.org>2015-05-13 21:50:30 +0300
commit97211f35e7985a4835b49f08f24a2b8d6d931203 (patch)
tree127844070a8804af70c5c1bc8c8ca13aca12a568 /t/thin.t
parent1dc63071ed8ff58fae63e5f38fe8633150d107db (diff)
More robust medial axis pruning. #2800
Diffstat (limited to 't/thin.t')
-rw-r--r--t/thin.t13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/thin.t b/t/thin.t
index 49a6ef427..950c4ee75 100644
--- a/t/thin.t
+++ b/t/thin.t
@@ -1,4 +1,4 @@
-use Test::More tests => 14;
+use Test::More tests => 16;
use strict;
use warnings;
@@ -133,4 +133,15 @@ if (0) {
ok sum(map $_->length, @$polylines) > $perimeter/2/4*3, 'medial axis has a reasonable length';
}
+{
+ my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new_scale(
+ [50, 100],
+ [300, 102],
+ [50, 104],
+ ));
+ my $res = $expolygon->medial_axis(scale 4, scale 0.5);
+ is scalar(@$res), 1, 'medial axis of a narrow triangle is a single line';
+ ok unscale($res->[0]->length) >= (200-100 - (120-100)) - epsilon, 'medial axis has reasonable length';
+}
+
__END__