From 5a707a66b974597c3db169c557e3771f9334c403 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Wed, 23 Jan 2019 17:24:56 +0100 Subject: [PATCH] Adjustment of the offset from the print bed STLs to their textures. Changed the MK2.5 bed from MK2 to MK3. --- src/slic3r/GUI/GLCanvas3D.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 1a6c3b5b0..63b9864b7 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -513,15 +513,14 @@ GLCanvas3D::Bed::EType GLCanvas3D::Bed::_detect_type() const { if ((curr->vendor != nullptr) && (curr->vendor->name == "Prusa Research")) { - if (boost::contains(curr->name, "MK2")) - { - type = MK2; - break; - } - else if (boost::contains(curr->name, "MK3")) + if (boost::contains(curr->name, "MK3") || boost::contains(curr->name, "MK2.5")) { type = MK3; break; + } else if (boost::contains(curr->name, "MK2")) + { + type = MK2; + break; } } } @@ -590,8 +589,14 @@ void GLCanvas3D::Bed::_render_prusa(const std::string &key, float theta) const if (theta <= 90.0f) { filename = model_path + "_bed.stl"; - if ((m_model.get_filename() != filename) && m_model.init_from_file(filename, useVBOs)) - m_model.center_around(m_bounding_box.center() - Vec3d(0.0, 0.0, 0.1 + 0.5 * m_model.get_bounding_box().size()(2))); + 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)); + if (key == "mk2") + offset.y() += 15. / 2.; + else if (key == "mk3") + offset += Vec3d(0., (19. - 8.) / 2., 2.); + m_model.center_around(offset); + } if (!m_model.get_filename().empty()) {