Trying to fix transformation assembly problem for arrange polyogon

This commit is contained in:
tamasmeszaros 2023-04-03 16:02:26 +02:00
parent 03608580c0
commit 6831b7094a
2 changed files with 17 additions and 9 deletions

View file

@ -1170,9 +1170,16 @@ public:
void apply_arrange_result(const Vec2d& offs, double rotation)
{
// write the transformation data into the model instance
set_rotation(Z, rotation);
set_offset(X, unscale<double>(offs(X)));
set_offset(Y, unscale<double>(offs(Y)));
// set_rotation(Z, rotation);
// set_offset(X, unscale<double>(offs(X)));
// set_offset(Y, unscale<double>(offs(Y)));
auto trafo = get_transformation().get_matrix();
trafo.translate(to_3d(unscaled(offs), 0.));
trafo.rotate(Eigen::AngleAxisd(rotation, Vec3d::UnitZ()));
m_transformation.set_matrix(trafo);
// set_rotation(Z, get_rotation().z() + rotation);
// set_offset(get_offset() + to_3d(unscaled(offs), 0.));
this->object->invalidate_bounding_box();
}