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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2018-09-06 09:56:33 +0300
committerEnrico Turri <enricoturri@seznam.cz>2018-09-06 09:56:33 +0300
commitb9287d51dd89c0fdec8dcea398285055e13e71ce (patch)
treeb1d8f0cc395b9c59141be47a493a50fc9a19cc74 /xs
parent677dad06695d7954fcabd681cca1975fb1a6e4d5 (diff)
Tweaks to ModelObject::center_around_origin()
Diffstat (limited to 'xs')
-rw-r--r--xs/src/libslic3r/Model.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp
index 6ad8ebb49..93f0152c8 100644
--- a/xs/src/libslic3r/Model.cpp
+++ b/xs/src/libslic3r/Model.cpp
@@ -669,10 +669,9 @@ void ModelObject::center_around_origin()
if (! v->modifier)
bb.merge(v->mesh.bounding_box());
- // First align to origin on XYZ, then center it on XY.
- Vec3d size = bb.size();
- size(2) = 0.0;
- Vec3d shift = -bb.min - 0.5 * size;
+ // Shift is the vector from the center of the bottom face of the bounding box to the origin
+ Vec3d shift = -bb.center();
+ shift(2) = -bb.min(2);
this->translate(shift);
this->origin_translation += shift;