Fixed broken command line scaling. Regression test was in previous commit. #1889

This commit is contained in:
Alessandro Ranellucci 2014-04-05 11:22:05 +02:00
parent e9e23119fc
commit 20df1023a6

View File

@ -25,20 +25,11 @@ has 'fill_maker' => (is => 'lazy');
has '_state' => (is => 'ro', default => sub { Slic3r::Print::State->new }); has '_state' => (is => 'ro', default => sub { Slic3r::Print::State->new });
sub BUILD { sub BUILD {
my $self = shift; my ($self) = @_;
# translate meshes so that we work with smaller coordinates # Compute the translation to be applied to our meshes so that we work with smaller coordinates
{ {
# compute the bounding box of the supplied meshes my $bb = $self->model_object->bounding_box;
my @meshes = map $self->model_object->volumes->[$_]->mesh,
map @$_,
grep defined $_,
@{$self->region_volumes};
my $bb = @meshes
? $meshes[0]->bounding_box
: Slic3r::Geometry::BoundingBoxf3->new;
$bb->merge($_->bounding_box) for @meshes[1..$#meshes];
# Translate meshes so that our toolpath generation algorithms work with smaller # Translate meshes so that our toolpath generation algorithms work with smaller
# XY coordinates; this translation is an optimization and not strictly required. # XY coordinates; this translation is an optimization and not strictly required.
@ -54,7 +45,7 @@ sub BUILD {
$scaled_bb->scale(1 / &Slic3r::SCALING_FACTOR); $scaled_bb->scale(1 / &Slic3r::SCALING_FACTOR);
$self->size($scaled_bb->size); $self->size($scaled_bb->size);
} }
} }
sub _build_fill_maker { sub _build_fill_maker {
my $self = shift; my $self = shift;