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

Conflicts:

	xs/t/01_trianglemesh.t
stable
Alessandro Ranellucci 2014-01-13 00:06:16 +01:00
parent fd6b78f7f2
commit a712284afb
2 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,7 @@ $ARGV[0] or usage(1);
if (-e $ARGV[0]) {
my $model = Slic3r::Format::STL->read_file($ARGV[0]);
$model->objects->[0]->add_instance(offset => [0,0]);
my $mesh = $model->mesh;
$mesh->repair;
printf "VERTICES = %s\n", join ',', map "[$_->[0],$_->[1],$_->[2]]", @{$mesh->vertices};

View File

@ -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__