Fixed missing mirror transform data when increasing instances count
This commit is contained in:
parent
98fa9c4c38
commit
474e06ac85
3 changed files with 4 additions and 3 deletions
|
@ -719,12 +719,13 @@ ModelInstance* ModelObject::add_instance(const ModelInstance &other)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelInstance* ModelObject::add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation)
|
ModelInstance* ModelObject::add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation, const Vec3d &mirror)
|
||||||
{
|
{
|
||||||
auto *instance = add_instance();
|
auto *instance = add_instance();
|
||||||
instance->set_offset(offset);
|
instance->set_offset(offset);
|
||||||
instance->set_scaling_factor(scaling_factor);
|
instance->set_scaling_factor(scaling_factor);
|
||||||
instance->set_rotation(rotation);
|
instance->set_rotation(rotation);
|
||||||
|
instance->set_mirror(mirror);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -200,7 +200,7 @@ public:
|
||||||
|
|
||||||
ModelInstance* add_instance();
|
ModelInstance* add_instance();
|
||||||
ModelInstance* add_instance(const ModelInstance &instance);
|
ModelInstance* add_instance(const ModelInstance &instance);
|
||||||
ModelInstance* add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation);
|
ModelInstance* add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation, const Vec3d &mirror);
|
||||||
void delete_instance(size_t idx);
|
void delete_instance(size_t idx);
|
||||||
void delete_last_instance();
|
void delete_last_instance();
|
||||||
void clear_instances();
|
void clear_instances();
|
||||||
|
|
|
@ -2628,7 +2628,7 @@ void Plater::increase_instances(size_t num)
|
||||||
float offset = 10.0;
|
float offset = 10.0;
|
||||||
for (size_t i = 0; i < num; i++, offset += 10.0) {
|
for (size_t i = 0; i < num; i++, offset += 10.0) {
|
||||||
Vec3d offset_vec = model_instance->get_offset() + Vec3d(offset, offset, 0.0);
|
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_object->add_instance(offset_vec, model_instance->get_scaling_factor(), model_instance->get_rotation(), model_instance->get_mirror());
|
||||||
// p->print.get_object(obj_idx)->add_copy(Slic3r::to_2d(offset_vec));
|
// p->print.get_object(obj_idx)->add_copy(Slic3r::to_2d(offset_vec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue