From 57a9486692ad728f7901256b5ec0597436afe846 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 14 Jun 2014 22:51:57 +0200 Subject: [PATCH] Apply transform to meshes before displaying the 3D preview canvas --- lib/Slic3r/GUI/PreviewCanvas.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/GUI/PreviewCanvas.pm b/lib/Slic3r/GUI/PreviewCanvas.pm index d6d61de2f..22cb80d4b 100644 --- a/lib/Slic3r/GUI/PreviewCanvas.pm +++ b/lib/Slic3r/GUI/PreviewCanvas.pm @@ -77,7 +77,7 @@ sub new { sub load_object { my ($self, $object) = @_; - my $bb = $object->raw_mesh->bounding_box; + my $bb = $object->instance_bounding_box; my $center = $bb->center; $self->object_shift(Slic3r::Pointf3->new(-$center->x, -$center->y, -$bb->z_min)); #,, $bb->translate(@{ $self->object_shift }); @@ -91,6 +91,7 @@ sub load_object { my @volumes = sort { ($a->modifier // 0) <=> ($b->modifier // 0) } @{$object->volumes}; foreach my $volume (@volumes) { my $mesh = $volume->mesh->clone; + $object->instances->[0]->transform_mesh($mesh); $mesh->translate(@{ $self->object_shift }); my $material_id = $volume->material_id // '_';