Skip to content

Commit

Permalink
Properly extract rotation matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Noisyfox committed Feb 19, 2024
1 parent 7e78f0d commit fad15c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libslic3r/Geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ Vec3d extract_euler_angles(const Transform3d& transform)

void rotation_from_two_vectors(Vec3d from, Vec3d to, Vec3d& rotation_axis, double& phi, Matrix3d* rotation_matrix)
{
const Matrix3d m = Transform3d(Eigen::Quaterniond().setFromTwoVectors(from, to)).matrix().block<3, 3>(0, 0);
const Matrix3d m = Eigen::Quaterniond().setFromTwoVectors(from, to).toRotationMatrix();
const Eigen::AngleAxisd aa(m);
rotation_axis = aa.axis();
phi = aa.angle();
Expand Down

0 comments on commit fad15c0

Please sign in to comment.