Refactoring, new bounding_box_3D function

This commit is contained in:
Alessandro Ranellucci 2012-09-22 16:10:24 +02:00
parent 35e449e891
commit b5672de3ca
2 changed files with 16 additions and 9 deletions

View file

@ -381,14 +381,7 @@ sub duplicate {
sub extents {
my $self = shift;
my @extents = (map [undef, undef], X,Y,Z);
foreach my $vertex (@{$self->vertices}) {
for (X,Y,Z) {
$extents[$_][MIN] = $vertex->[$_] if !defined $extents[$_][MIN] || $vertex->[$_] < $extents[$_][MIN];
$extents[$_][MAX] = $vertex->[$_] if !defined $extents[$_][MAX] || $vertex->[$_] > $extents[$_][MAX];
}
}
return @extents;
return Slic3r::Geometry::bounding_box_3D($self->vertices);
}
sub size {