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/stl.t
diff options
context:
space:
mode:
Diffstat (limited to 't/stl.t')
-rw-r--r--t/stl.t11
1 files changed, 9 insertions, 2 deletions
diff --git a/t/stl.t b/t/stl.t
index 901d8c33e..84b4a27dd 100644
--- a/t/stl.t
+++ b/t/stl.t
@@ -1,6 +1,6 @@
use Test::More;
-plan tests => 7;
+plan tests => 11;
BEGIN {
use FindBin;
@@ -28,10 +28,17 @@ is_deeply lines(28, 20, 30), [ ], 'lower vertex on la
is_deeply lines(24, 10, 16), [ [ [4, 4], [2, 6] ] ], 'two edges intersect';
is_deeply lines(24, 10, 20), [ [ [4, 4], [1, 9] ] ], 'one vertex on plane and one edge intersects';
+my @lower = $stl->intersect_facet(vertices(22, 20, 20), $z, $dz);
+my @upper = $stl->intersect_facet(vertices(20, 20, 10), $z, $dz);
+isa_ok $lower[0], 'Slic3r::Line::FacetEdge', 'bottom edge on layer';
+isa_ok $upper[0], 'Slic3r::Line::FacetEdge', 'upper edge on layer';
+is $lower[0]->edge_type, 'bottom', 'lower edge is detected as bottom';
+is $upper[0]->edge_type, 'top', 'upper edge is detected as top';
+
sub vertices {
[ map [ @{$points[$_]}, $_[$_] ], 0..2 ]
}
sub lines {
- [ map [ map ref $_ eq 'Slic3r::Point' ? $_->p : [ map sprintf('%.0f', $_), @$_ ], @$_ ], $stl->intersect_facet(vertices(@_), $z, $dz) ];
+ [ map [ map ref $_ eq 'Slic3r::Point' ? $_->p : [ map sprintf('%.0f', $_), @$_ ], @$_ ], map $_->p, $stl->intersect_facet(vertices(@_), $z, $dz) ];
}