mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Avoid using auto as type of Eigen expressions. (#8577)
According to https://eigen.tuxfamily.org/dox/TopicPitfalls.html one should just avoid using `auto` as the type of an Eigen expression. This PR fixes most of them I could found in the project. There might be cases that I missed, and I might update those later if I noticed. This should prevent issues like #7741 and hopefully fix some mysterious crashes happened inside Eigen calls.
This commit is contained in:
@@ -596,7 +596,7 @@ Transform3d get_volume_transformation(
|
||||
std::optional<float> current_angle,
|
||||
const std::optional<double> &up_limit)
|
||||
{
|
||||
auto world_linear = world.linear();
|
||||
auto world_linear = world.linear().eval();
|
||||
// Calculate offset: transformation to wanted position
|
||||
{
|
||||
// Reset skew of the text Z axis:
|
||||
@@ -609,7 +609,7 @@ Transform3d get_volume_transformation(
|
||||
Vec3d text_z_world = world_linear.col(2); // world_linear * Vec3d::UnitZ()
|
||||
auto z_rotation = Eigen::Quaternion<double, Eigen::DontAlign>::FromTwoVectors(text_z_world, world_dir);
|
||||
Transform3d world_new = z_rotation * world;
|
||||
auto world_new_linear = world_new.linear();
|
||||
auto world_new_linear = world_new.linear().eval();
|
||||
|
||||
// Fix direction of up vector to zero initial rotation
|
||||
if(up_limit.has_value()){
|
||||
|
||||
Reference in New Issue
Block a user