Skip to content

Commit

Permalink
Fix issue with auto orient a scaled object. (#3904)
Browse files Browse the repository at this point in the history
Partly revert 73ab032
  • Loading branch information
Noisyfox authored and SoftFever committed Feb 15, 2024
1 parent 989fab0 commit 8a42aed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libslic3r/Model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,10 @@ class ModelInstance final : public ObjectBase

// BBS
void rotate(Matrix3d rotation_matrix) {
const Geometry::Transformation& old_inst_trafo = get_transformation();
set_transformation(Geometry::Transformation{old_inst_trafo.get_offset_matrix() * rotation_matrix * old_inst_trafo.get_matrix_no_offset()});
auto R = m_transformation.get_rotation_matrix().matrix().block<3, 3>(0, 0);
auto R_new = rotation_matrix * R;
auto euler_angles = Geometry::extract_euler_angles(R_new);
set_rotation(euler_angles);
}

Vec3d get_scaling_factor() const { return m_transformation.get_scaling_factor(); }
Expand Down

0 comments on commit 8a42aed

Please sign in to comment.