Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-07-25 12:34:42 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-07-25 12:34:42 +0300
commitd6f03a2f52fcd952976dd540b424afa5f480627f (patch)
tree1ee8232aa5d3862bda8cd4a0906dba9bae1e11e5 /src/slic3r/GUI/3DBed.cpp
parentbc680b8376294955fdeb01e5d6838aa332e68de0 (diff)
Bed model placed into the scene so that its origin goes into shape center
Diffstat (limited to 'src/slic3r/GUI/3DBed.cpp')
-rw-r--r--src/slic3r/GUI/3DBed.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp
index ca48f7c37..a402fa82d 100644
--- a/src/slic3r/GUI/3DBed.cpp
+++ b/src/slic3r/GUI/3DBed.cpp
@@ -558,8 +558,10 @@ void Bed3D::render_model(const std::string& filename) const
if ((m_model.get_filename() != filename) && m_model.init_from_file(filename))
{
- // move the model a bit down to avoid z-fighting with the texture quad
- m_model.set_offset(-0.03 * Vec3d::UnitZ());
+ // move the model so that its origin (0.0, 0.0, 0.0) goes into the bed shape center and a bit down to avoid z-fighting with the texture quad
+ Vec3d shift = m_bounding_box.center();
+ shift(2) = -0.03;
+ m_model.set_offset(shift);
// update extended bounding box
calc_bounding_boxes();