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/loops.t
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2012-12-30 20:57:30 +0400
committerAlessandro Ranellucci <aar@cpan.org>2012-12-30 20:57:30 +0400
commit141a8d39898b3b933a422b4b6f70201f356aed54 (patch)
tree0f12d5a4319f575557a2a8cece52b31cdd204631 /t/loops.t
parent6e6bc746367b4f50dfdac108ce067ac94ff31a30 (diff)
Bugfix: some holes being closed incorrectly. #858
Diffstat (limited to 't/loops.t')
-rw-r--r--t/loops.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/loops.t b/t/loops.t
index c36505e4e..d0340b200 100644
--- a/t/loops.t
+++ b/t/loops.t
@@ -13,6 +13,12 @@ use Slic3r;
use Slic3r::Test;
{
+ # We only need to slice at one height, so we'll build a non-manifold mesh
+ # that still produces complete loops at that height. Triangular walls are
+ # enough for this purpose.
+ # Basically we want to check what happens when three concentric loops happen
+ # to be at the same height, the two external ones being ccw and the other being
+ # a hole, thus cw.
my (@vertices, @facets) = ();
Slic3r::Test::add_facet($_, \@vertices, \@facets) for
# external surface below the slicing Z
@@ -39,7 +45,7 @@ use Slic3r::Test;
is scalar(@$loops), 3, 'correct number of loops detected';
is scalar(grep $_->is_counter_clockwise, @$loops), 2, 'correct number of ccw loops detected';
- my @surfaces = Slic3r::Layer::Region::_merge_loops($loops);
+ my @surfaces = Slic3r::Layer::Region::_merge_loops($loops, 0);
is scalar(@surfaces), 1, 'one surface detected';
is scalar(@{$surfaces[0]->expolygon})-1, 1, 'surface has one hole';
}