From 6742735596eb342d8166ce00aa370cf0fba15c1f Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 13 Aug 2018 16:16:37 +0200 Subject: [PATCH] Better fix for minimum z of object to lay on the bed after rotations --- xs/src/libslic3r/Model.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp index bceeea258..f9936537f 100644 --- a/xs/src/libslic3r/Model.cpp +++ b/xs/src/libslic3r/Model.cpp @@ -771,21 +771,12 @@ void ModelObject::scale(const Pointf3 &versor) void ModelObject::rotate(float angle, const Axis &axis) { - float min_z = FLT_MAX; for (ModelVolume *v : this->volumes) { v->mesh.rotate(angle, axis); - min_z = std::min(min_z, v->mesh.stl.stats.min.z); } - if (min_z != 0.0f) - { - // translate the object so that its minimum z lays on the bed - for (ModelVolume *v : this->volumes) - { - v->mesh.translate(0.0f, 0.0f, -min_z); - } - } + center_around_origin(); this->origin_translation = Pointf3(0, 0, 0); this->invalidate_bounding_box();