Add a (failing) test for slicing at the same height of a horizontal surface attached to a volume. In this case, the loop isn't completed. #1672
This commit is contained in:
parent
3637ca39df
commit
b0a7baa454
2 changed files with 12 additions and 1 deletions
|
@ -18,6 +18,7 @@ $ARGV[0] or usage(1);
|
||||||
|
|
||||||
if (-e $ARGV[0]) {
|
if (-e $ARGV[0]) {
|
||||||
my $model = Slic3r::Format::STL->read_file($ARGV[0]);
|
my $model = Slic3r::Format::STL->read_file($ARGV[0]);
|
||||||
|
$model->objects->[0]->add_instance(offset => [0,0]);
|
||||||
my $mesh = $model->mesh;
|
my $mesh = $model->mesh;
|
||||||
$mesh->repair;
|
$mesh->repair;
|
||||||
printf "VERTICES = %s\n", join ',', map "[$_->[0],$_->[1],$_->[2]]", @{$mesh->vertices};
|
printf "VERTICES = %s\n", join ',', map "[$_->[0],$_->[1],$_->[2]]", @{$mesh->vertices};
|
||||||
|
|
|
@ -4,7 +4,7 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Slic3r::XS;
|
use Slic3r::XS;
|
||||||
use Test::More tests => 41;
|
use Test::More tests => 42;
|
||||||
|
|
||||||
is Slic3r::TriangleMesh::hello_world(), 'Hello world!',
|
is Slic3r::TriangleMesh::hello_world(), 'Hello world!',
|
||||||
'hello world';
|
'hello world';
|
||||||
|
@ -88,4 +88,14 @@ my $cube = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
my $m = Slic3r::TriangleMesh->new;
|
||||||
|
$m->ReadFromPerl(
|
||||||
|
[ [0,0,0],[0,0,20],[0,5,0],[0,5,20],[50,0,0],[50,0,20],[15,5,0],[35,5,0],[15,20,0],[50,5,0],[35,20,0],[15,5,10],[50,5,20],[35,5,10],[35,20,10],[15,20,10] ],
|
||||||
|
[ [0,1,2],[2,1,3],[1,0,4],[5,1,4],[0,2,4],[4,2,6],[7,6,8],[4,6,7],[9,4,7],[7,8,10],[2,3,6],[11,3,12],[7,12,9],[13,12,7],[6,3,11],[11,12,13],[3,1,5],[12,3,5],[5,4,9],[12,5,9],[13,7,10],[14,13,10],[8,15,10],[10,15,14],[6,11,8],[8,11,15],[15,11,13],[14,15,13] ],
|
||||||
|
);
|
||||||
|
$m->repair;
|
||||||
|
my $slices = $m->slice([ 5, 10 ]);
|
||||||
|
is $slices->[0][0]->area, $slices->[1][0]->area, 'slicing a tangent plane includes its area';
|
||||||
|
}
|
||||||
__END__
|
__END__
|
||||||
|
|
Loading…
Add table
Reference in a new issue