Methods Transformation::get_scaling_factor() and Transformation::get_scaling_factor_matrix() modified to use TransformationSVD

This commit is contained in:
enricoturri1966 2023-02-08 14:08:51 +01:00
parent b182675e35
commit d6693ea956

View File

@ -539,17 +539,14 @@ void Transformation::set_rotation(Axis axis, double rotation)
#if ENABLE_WORLD_COORDINATE
Vec3d Transformation::get_scaling_factor() const
{
const Transform3d scale = extract_scale(m_matrix);
return { std::abs(scale(0, 0)), std::abs(scale(1, 1)), std::abs(scale(2, 2)) };
const TransformationSVD svd(*this);
return { svd.s(0, 0), svd.s(1, 1), svd.s(2, 2) };
}
Transform3d Transformation::get_scaling_factor_matrix() const
{
Transform3d scale = extract_scale(m_matrix);
scale(0, 0) = std::abs(scale(0, 0));
scale(1, 1) = std::abs(scale(1, 1));
scale(2, 2) = std::abs(scale(2, 2));
return scale;
const TransformationSVD svd(*this);
return Transform3d(svd.s);
}
#endif // ENABLE_WORLD_COORDINATE