diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2015-05-13 21:47:26 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2015-05-13 21:50:30 +0300 |
commit | 97211f35e7985a4835b49f08f24a2b8d6d931203 (patch) | |
tree | 127844070a8804af70c5c1bc8c8ca13aca12a568 /t/thin.t | |
parent | 1dc63071ed8ff58fae63e5f38fe8633150d107db (diff) |
More robust medial axis pruning. #2800
Diffstat (limited to 't/thin.t')
-rw-r--r-- | t/thin.t | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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__ |