diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2018-09-20 16:00:40 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2018-09-20 16:00:40 +0300 |
commit | 07274589a35948e135ccb2eed59626a41c61444b (patch) | |
tree | 0fdf23da7bef8530237a5e001c95ce1e639cf012 /xs/src/libslic3r/Format/3mf.cpp | |
parent | f1e0dc2dd714c9afae5d978e633646c0db8a7c57 (diff) |
1st installment of ModelInstance 3D rotation components
Diffstat (limited to 'xs/src/libslic3r/Format/3mf.cpp')
-rw-r--r-- | xs/src/libslic3r/Format/3mf.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xs/src/libslic3r/Format/3mf.cpp b/xs/src/libslic3r/Format/3mf.cpp index 43c99f19f..8a9d6870d 100644 --- a/xs/src/libslic3r/Format/3mf.cpp +++ b/xs/src/libslic3r/Format/3mf.cpp @@ -1283,6 +1283,9 @@ namespace Slic3r { transform(1, 0) * inv_sx, transform(1, 1) * inv_sy, transform(1, 2) * inv_sz, transform(2, 0) * inv_sx, transform(2, 1) * inv_sy, transform(2, 2) * inv_sz; +#if ENABLE_MODELINSTANCE_3D_ROTATION + Vec3d rotation = m3x3.eulerAngles(0, 1, 2); +#else Eigen::AngleAxisd rotation; rotation.fromRotationMatrix(m3x3); @@ -1291,6 +1294,7 @@ namespace Slic3r { return; double angle_z = (rotation.axis() == Vec3d::UnitZ()) ? rotation.angle() : -rotation.angle(); +#endif // ENABLE_MODELINSTANCE_3D_ROTATION #if ENABLE_MODELINSTANCE_3D_OFFSET instance.set_offset(offset); @@ -1299,7 +1303,11 @@ namespace Slic3r { instance.offset(1) = offset_y; #endif // ENABLE_MODELINSTANCE_3D_OFFSET instance.scaling_factor = sx; +#if ENABLE_MODELINSTANCE_3D_ROTATION + instance.set_rotation(rotation); +#else instance.rotation = angle_z; +#endif // ENABLE_MODELINSTANCE_3D_ROTATION } bool _3MF_Importer::_handle_start_config(const char** attributes, unsigned int num_attributes) |