From 1bd679dcba54af16393b078a5bb21dd9c83e625d Mon Sep 17 00:00:00 2001 From: Michael Kirsch Date: Sat, 6 Jul 2019 21:37:58 +0200 Subject: [PATCH] add public trafo to instance --- xs/src/libslic3r/Model.cpp | 3 ++- xs/src/libslic3r/Model.hpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp index 674f47fa5..12414f866 100644 --- a/xs/src/libslic3r/Model.cpp +++ b/xs/src/libslic3r/Model.cpp @@ -1186,7 +1186,8 @@ ModelInstance::transform_mesh(TriangleMesh* mesh, bool dont_translate) const TransformationMatrix ModelInstance::get_trafo_matrix(bool dont_translate) const { - TransformationMatrix trafo = TransformationMatrix::mat_rotation(this->rotation, Axis::Z); + TransformationMatrix trafo = this->additional_trafo; + trafo.applyLeft(TransformationMatrix::mat_rotation(this->rotation, Axis::Z)); trafo.applyLeft(TransformationMatrix::mat_scale(this->scaling_factor)); if(!dont_translate) { diff --git a/xs/src/libslic3r/Model.hpp b/xs/src/libslic3r/Model.hpp index 56645e3f5..80734acde 100644 --- a/xs/src/libslic3r/Model.hpp +++ b/xs/src/libslic3r/Model.hpp @@ -589,6 +589,7 @@ class ModelInstance double rotation; ///< Rotation around the Z axis, in radians around mesh center point. double scaling_factor; ///< uniform scaling factor. Pointf offset; ///< offset in unscaled coordinates. + TransformationMatrix additional_trafo; ///< 3mf instance transformation cannot be completely represented by the other properties /// Get the owning ModelObject /// \return ModelObject* pointer to the owner ModelObject