diff options
author | bubnikv <bubnikv@gmail.com> | 2018-12-12 12:02:01 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-12-12 12:02:01 +0300 |
commit | 5ea8df0ca0f1bdfc044ead423a54f5ddb48b7414 (patch) | |
tree | 187db4803d0f9e429079fbab879b73275bef8ace /xs/t | |
parent | e1ca861ee6bd0cafc42d2ef09368a85279a335f2 (diff) |
Manual merge of the TriangleMesh.cpp from the stable branch.
Diffstat (limited to 'xs/t')
-rw-r--r-- | xs/t/01_trianglemesh.t | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xs/t/01_trianglemesh.t b/xs/t/01_trianglemesh.t index fd57cf805..4013a1f83 100644 --- a/xs/t/01_trianglemesh.t +++ b/xs/t/01_trianglemesh.t @@ -79,7 +79,9 @@ my $cube = { my $m = Slic3r::TriangleMesh->new; $m->ReadFromPerl($cube->{vertices}, $cube->{facets}); $m->repair; - my @z = (0,2,4,8,6,8,10,12,14,16,18,20); + # The slice at zero height does not belong to the mesh, the slicing considers the vertical structures to be + # open intervals at the bottom end, closed at the top end. + my @z = (0.0001,2,4,8,6,8,10,12,14,16,18,20); my $result = $m->slice(\@z); my $SCALING_FACTOR = 0.000001; for my $i (0..$#z) { @@ -105,7 +107,9 @@ my $cube = { # this second test also checks that performing a second slice on a mesh after # a transformation works properly (shared_vertices is correctly invalidated); # at Z = -10 we have a bottom horizontal surface - my $slices = $m->slice([ -5, -10 ]); + # (The slice at zero height does not belong to the mesh, the slicing considers the vertical structures to be + # open intervals at the bottom end, closed at the top end, so the Z = -10 is shifted a bit up to get a valid slice). + my $slices = $m->slice([ -5, -10+0.00001 ]); is $slices->[0][0]->area, $slices->[1][0]->area, 'slicing a bottom tangent plane includes its area'; } } |