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>2014-08-03 17:03:11 +0400
committerAlessandro Ranellucci <aar@cpan.org>2014-08-03 17:03:47 +0400
commit30fa055995fc0cb63bdd869f291e1873af9a3ad0 (patch)
treef8d86c4b894d41fed06078d5e167e562322ff3a3 /t/thin.t
parente897fbbd51abd54af2b79f904c3becd28fc07dd8 (diff)
Bugfix: medial axis missed some segments. #2144
Diffstat (limited to 't/thin.t')
-rw-r--r--t/thin.t16
1 files changed, 14 insertions, 2 deletions
diff --git a/t/thin.t b/t/thin.t
index e02e1b33d..49a6ef427 100644
--- a/t/thin.t
+++ b/t/thin.t
@@ -1,4 +1,4 @@
-use Test::More tests => 13;
+use Test::More tests => 14;
use strict;
use warnings;
@@ -8,7 +8,7 @@ BEGIN {
}
use Slic3r;
-use List::Util qw(first);
+use List::Util qw(first sum);
use Slic3r::Geometry qw(epsilon scale unscale scaled_epsilon Y);
use Slic3r::Test;
@@ -121,4 +121,16 @@ if (0) {
ok $len > 80*2 && $len < 100*2, 'medial axis has reasonable length';
}
+{
+ my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new(
+ [-203064906,-51459966],[-219312231,-51459966],[-219335477,-51459962],[-219376095,-51459962],[-219412047,-51459966],
+ [-219572094,-51459966],[-219624814,-51459962],[-219642183,-51459962],[-219656665,-51459966],[-220815482,-51459966],
+ [-220815482,-37738966],[-221117540,-37738966],[-221117540,-51762024],[-203064906,-51762024],
+ ));
+ my $polylines = $expolygon->medial_axis(819998, 102499.75);
+
+ my $perimeter = $expolygon->contour->split_at_first_point->length;
+ ok sum(map $_->length, @$polylines) > $perimeter/2/4*3, 'medial axis has a reasonable length';
+}
+
__END__