mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 00:40:37 +08:00
add public trafo to instance
This commit is contained in:
parent
5f9742599e
commit
1bd679dcba
@ -1186,7 +1186,8 @@ ModelInstance::transform_mesh(TriangleMesh* mesh, bool dont_translate) const
|
|||||||
|
|
||||||
TransformationMatrix ModelInstance::get_trafo_matrix(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));
|
trafo.applyLeft(TransformationMatrix::mat_scale(this->scaling_factor));
|
||||||
if(!dont_translate)
|
if(!dont_translate)
|
||||||
{
|
{
|
||||||
|
@ -589,6 +589,7 @@ class ModelInstance
|
|||||||
double rotation; ///< Rotation around the Z axis, in radians around mesh center point.
|
double rotation; ///< Rotation around the Z axis, in radians around mesh center point.
|
||||||
double scaling_factor; ///< uniform scaling factor.
|
double scaling_factor; ///< uniform scaling factor.
|
||||||
Pointf offset; ///< offset in unscaled coordinates.
|
Pointf offset; ///< offset in unscaled coordinates.
|
||||||
|
TransformationMatrix additional_trafo; ///< 3mf instance transformation cannot be completely represented by the other properties
|
||||||
|
|
||||||
/// Get the owning ModelObject
|
/// Get the owning ModelObject
|
||||||
/// \return ModelObject* pointer to the owner ModelObject
|
/// \return ModelObject* pointer to the owner ModelObject
|
||||||
|
Loading…
x
Reference in New Issue
Block a user