From 086ec4af9c4925c7bf5cac9f91b84fd46938ce11 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 2 Jun 2013 19:32:53 +0200 Subject: [PATCH] Fixed yet one more regression in Quick Slice caused by recent Model refactoring. #1208 --- lib/Slic3r/Print.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 84a208ea0..642891419 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -121,7 +121,8 @@ sub add_model { # we ignore the per-instance rotation currently and only # consider the first one - $mesh->rotate($object->instances->[0]->rotation, $mesh->center); + $mesh->rotate($object->instances->[0]->rotation, $mesh->center) + if @{ $object->instances // [] }; $mesh->scale(1 / &Slic3r::SCALING_FACTOR); } @@ -139,7 +140,9 @@ sub add_model { print => $self, meshes => [ @meshes ], copies => [ - map [ (scale $_->offset->[X]) + $extents[X][MIN], (scale $_->offset->[Y]) + $extents[Y][MIN] ], @{$object->instances}, + $object->instances + ? (map [ (scale $_->offset->[X]) + $extents[X][MIN], (scale $_->offset->[Y]) + $extents[Y][MIN] ], @{$object->instances}) + : [0,0], ], size => [ map $extents[$_][MAX] - $extents[$_][MIN], (X,Y,Z) ], input_file => $object->input_file,