Fix of Place on face:

1) Decreased "gimbal lock" epsilon 10x
2) Got rid of unnecessary back and forth conversions which led to numerical inacurracies

This should fix issues ,  and 
This commit is contained in:
Vojtech Bubnik 2020-12-08 07:59:25 +01:00 committed by Lukas Matena
parent fe4f1b15c6
commit 2d6b694261
2 changed files with 9 additions and 36 deletions
src/libslic3r

View file

@ -1223,7 +1223,7 @@ Vec3d extract_euler_angles(const Eigen::Matrix<double, 3, 3, Eigen::DontAlign>&
// reference: http://www.gregslabaugh.net/publications/euler.pdf
Vec3d angles1 = Vec3d::Zero();
Vec3d angles2 = Vec3d::Zero();
if (is_approx(std::abs(rotation_matrix(2, 0)), 1.0))
if (std::abs(std::abs(rotation_matrix(2, 0)) - 1.0) < 1e-5)
{
angles1(2) = 0.0;
if (rotation_matrix(2, 0) < 0.0) // == -1.0