From bf464572a0e8c8bf0bb84af788e2587a8a8857d3 Mon Sep 17 00:00:00 2001 From: Michael Kirsch Date: Sun, 7 Apr 2019 00:10:26 +0200 Subject: [PATCH] change geometric operations to alter trafo --- xs/src/libslic3r/Model.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp index abd837b74..4a2d60340 100644 --- a/xs/src/libslic3r/Model.cpp +++ b/xs/src/libslic3r/Model.cpp @@ -615,7 +615,7 @@ ModelObject::mesh() const TriangleMesh m(raw_mesh); (*i)->transform_mesh(&m); mesh.merge(m); - } + } return mesh; } @@ -730,7 +730,7 @@ void ModelObject::translate(coordf_t x, coordf_t y, coordf_t z) { for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) { - (*v)->mesh.translate(x, y, z); + (*v)->trafo.translate(x, y, z); } if (this->_bounding_box_valid) this->_bounding_box.translate(x, y, z); } @@ -746,7 +746,7 @@ ModelObject::scale(const Pointf3 &versor) { if (versor.x == 1 && versor.y == 1 && versor.z == 1) return; for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) { - (*v)->mesh.scale(versor); + (*v)->trafo.scale(versor.x, versor.y, versor.z); } // reset origin translation since it doesn't make sense anymore @@ -773,7 +773,7 @@ ModelObject::rotate(float angle, const Axis &axis) { if (angle == 0) return; for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) { - (*v)->mesh.rotate(angle, axis); + (*v)->trafo.rotate(angle, axis); } this->origin_translation = Pointf3(0,0,0); this->invalidate_bounding_box(); @@ -783,7 +783,7 @@ void ModelObject::mirror(const Axis &axis) { for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) { - (*v)->mesh.mirror(axis); + (*v)->trafo.mirror(axis); } this->origin_translation = Pointf3(0,0,0); this->invalidate_bounding_box();