diff --git a/src/libslic3r/MTUtils.hpp b/src/libslic3r/MTUtils.hpp index e60918fab6..ab99ea5f68 100644 --- a/src/libslic3r/MTUtils.hpp +++ b/src/libslic3r/MTUtils.hpp @@ -47,7 +47,7 @@ private: public: // Forwarded constructor template - inline CachedObject(Setter fn, Args &&... args) + inline CachedObject(Setter &&fn, Args &&... args) : m_obj(std::forward(args)...), m_valid(false), m_setter(fn) {} @@ -55,7 +55,7 @@ public: // the next retrieval (Setter will be called). The data that is used in // the setter function should be guarded as well during modification so // the modification has to take place in fn. - inline void invalidate(std::function fn) + template void invalidate(Fn &&fn) { std::lock_guard lck(m_lck); fn(); diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 004f7d5550..1bc5489145 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -138,14 +138,14 @@ Transform3d SLAPrint::sla_trafo(const ModelObject &model_object) const offset(1) = 0.; rotation(2) = 0.; - offset(Z) *= corr(Z); + offset.z() *= corr.z(); auto trafo = Transform3d::Identity(); trafo.translate(offset); trafo.scale(corr); - trafo.rotate(Eigen::AngleAxisd(rotation(2), Vec3d::UnitZ())); - trafo.rotate(Eigen::AngleAxisd(rotation(1), Vec3d::UnitY())); - trafo.rotate(Eigen::AngleAxisd(rotation(0), Vec3d::UnitX())); + trafo.rotate(Eigen::AngleAxisd(rotation.z(), Vec3d::UnitZ())); + trafo.rotate(Eigen::AngleAxisd(rotation.y(), Vec3d::UnitY())); + trafo.rotate(Eigen::AngleAxisd(rotation.x(), Vec3d::UnitX())); trafo.scale(model_instance.get_scaling_factor()); trafo.scale(model_instance.get_mirror());