diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 08e70964e..6c350e7b4 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -837,13 +837,10 @@ ModelInstance* ModelObject::add_instance(const ModelInstance &other) return i; } -ModelInstance* ModelObject::add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation, const Vec3d &mirror) +ModelInstance* ModelObject::add_instance(const Geometry::Transformation& trafo) { - auto *instance = add_instance(); - instance->set_offset(offset); - instance->set_scaling_factor(scaling_factor); - instance->set_rotation(rotation); - instance->set_mirror(mirror); + ModelInstance* instance = add_instance(); + instance->set_transformation(trafo); return instance; } diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index 60746f10b..55aceeeb2 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -392,7 +392,7 @@ public: ModelInstance* add_instance(); ModelInstance* add_instance(const ModelInstance &instance); - ModelInstance* add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation, const Vec3d &mirror); + ModelInstance* add_instance(const Geometry::Transformation& trafo); void delete_instance(size_t idx); void delete_last_instance(); void clear_instances(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c3a2dcda0..9e1638cae 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6070,7 +6070,9 @@ void Plater::increase_instances(size_t num, int obj_idx/* = -1*/) double offset = offset_base; for (size_t i = 0; i < num; i++, offset += offset_base) { Vec3d offset_vec = model_instance->get_offset() + Vec3d(offset, offset, 0.0); - model_object->add_instance(offset_vec, model_instance->get_scaling_factor(), model_instance->get_rotation(), model_instance->get_mirror()); + Geometry::Transformation trafo = model_instance->get_transformation(); + trafo.set_offset(offset_vec); + model_object->add_instance(trafo); // p->print.get_object(obj_idx)->add_copy(Slic3r::to_2d(offset_vec)); }