From 29137d1b3c2d64cf74bc21fb3c975309e35bcb7e Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 8 Feb 2019 10:19:07 +0100 Subject: [PATCH] Fixed z offset of printbed models --- src/slic3r/GUI/GLCanvas3D.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 4a9faaaff..8facf3879 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -656,11 +656,17 @@ void GLCanvas3D::Bed::_render_prusa(const std::string &key, float theta) const { filename = model_path + "_bed.stl"; if ((m_model.get_filename() != filename) && m_model.init_from_file(filename, useVBOs)) { - Vec3d offset = m_bounding_box.center() - Vec3d(0.0, 0.0, 0.1 + 0.5 * m_model.get_bounding_box().size()(2)); + Vec3d offset = m_bounding_box.center() - Vec3d(0.0, 0.0, 0.5 * m_model.get_bounding_box().size()(2)); if (key == "mk2") - offset.y() += 15. / 2.; + // hardcoded value to match the stl model + offset += Vec3d(0.0, 7.5, -0.03); else if (key == "mk3") - offset += Vec3d(0., (19. - 8.) / 2., 2.); + // hardcoded value to match the stl model + offset += Vec3d(0.0, 5.5, 2.43); + else if (key == "sl1") + // hardcoded value to match the stl model + offset += Vec3d(0.0, 0.0, -0.03); + m_model.center_around(offset); }