Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with auto orient a scaled object. #3904

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading