Honor duplication options for SVG export

This commit is contained in:
Alessandro Ranellucci 2012-04-11 17:46:36 +02:00
parent e5abb0b9df
commit 0b29ad123e

View file

@ -187,9 +187,14 @@ EOF
printf $fh qq{ <g id="layer%d" slic3r:z="%s">\n}, $layer->id, unscale $layer->slice_z; printf $fh qq{ <g id="layer%d" slic3r:z="%s">\n}, $layer->id, unscale $layer->slice_z;
# sort slices so that the outermost ones come first # 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}; my @slices = sort { $a->expolygon->contour->encloses_point($b->expolygon->contour->[0]) ? 0 : 1 } @{$layer->slices};
foreach my $copy (@{$print->copies}) {
foreach my $slice (@slices) { foreach my $slice (@slices) {
$print_polygon->($slice->expolygon->contour, 'contour'); my $expolygon = $slice->expolygon->clone;
$print_polygon->($_, 'hole') for $slice->expolygon->holes; $expolygon->translate(@$copy);
$print_polygon->($expolygon->contour, 'contour');
$print_polygon->($_, 'hole') for $expolygon->holes;
}
} }
print $fh qq{ </g>\n}; print $fh qq{ </g>\n};
} }