add public trafo to instance

This commit is contained in:
Michael Kirsch 2019-07-06 21:37:58 +02:00 committed by Joseph Lenox
parent 5f9742599e
commit 1bd679dcba
2 changed files with 3 additions and 1 deletions

View File

@ -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)
{

View File

@ -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