From 1f35a3f6aaa7c8f3b461f1bdfc6124e04e7c5f43 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 11 Jun 2012 13:50:38 +0200 Subject: [PATCH] Fixed regression preventing SVG export to work properly. #428 --- lib/Slic3r/Print.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 70ac75b93..97a8cb921 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -363,12 +363,11 @@ EOF my @layers = map $_->layers->[$layer_id], @{$self->objects}; printf $fh qq{ \n}, $layer_id, unscale +(grep defined $_, @layers)[0]->slice_z; - for my $obj_idx (0 .. $#layers) { - my $layer = $layers[$layer_id] or next; + for my $obj_idx (0 .. $#{$self->objects}) { + my $layer = $self->objects->[$obj_idx]->layers->[$layer_id] or next; # sort slices so that the outermost ones come first my @slices = sort { $a->expolygon->contour->encloses_point($b->expolygon->contour->[0]) ? 0 : 1 } @{$layer->slices}; - foreach my $copy (@{$self->copies->[$obj_idx]}) { foreach my $slice (@slices) { my $expolygon = $slice->expolygon->clone;