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-03-08 14:36:48 +0400
committerAlessandro Ranellucci <aar@cpan.org>2014-03-08 14:36:48 +0400
commit33da6adc3c9d7b8128830e4f9e6beff9c191956a (patch)
tree2d69c56e610cdf09769ffd18f7e0e7c61109a387 /t/thin.t
parent04d80ca392cdba61084785422fac72110521c684 (diff)
Better pruning
Diffstat (limited to 't/thin.t')
-rw-r--r--t/thin.t19
1 files changed, 17 insertions, 2 deletions
diff --git a/t/thin.t b/t/thin.t
index bf048868f..d11bcc41a 100644
--- a/t/thin.t
+++ b/t/thin.t
@@ -11,7 +11,7 @@ use Slic3r;
use List::Util qw(first);
use Slic3r::Geometry qw(epsilon scale unscale);
use Slic3r::Test;
-
+goto TTT;
{
my $config = Slic3r::Config->new_from_defaults;
$config->set('layer_height', 0.2);
@@ -65,7 +65,7 @@ use Slic3r::Test;
'medial axis loop has reasonable length';
}
-{
+TTT: {
my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new_scale(
[100, 100],
[120, 100],
@@ -75,6 +75,21 @@ use Slic3r::Test;
my $res = $expolygon->medial_axis(scale 10);
is scalar(@$res), 1, 'medial axis of a narrow rectangle is a single line';
ok unscale($res->[0]->length) >= (200-100 - (120-100)) - epsilon, 'medial axis has reasonable length';
+
+ $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new_scale(
+ [100, 100],
+ [120, 100],
+ [120, 200],
+ [105, 200], # extra point in the short side
+ [100, 200],
+ ));
+ my $res2 = $expolygon->medial_axis(scale 10);
+ use Slic3r::SVG;
+ Slic3r::SVG::output(
+ "thin.svg",
+ expolygons => [$expolygon],
+ polylines => $res2,
+ );
}
{