mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-05 17:17:42 +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:
@@ -149,7 +149,7 @@ std::optional<RaycastManager::Hit> RaycastManager::first_hit(const Vec3d& point,
|
||||
// NOTE: Anisotropic transformation of normal is not perpendiculat to triangle
|
||||
const Vec3i32 tri = hit_mesh->indices(hit_face);
|
||||
std::array<Vec3d,3> pts;
|
||||
auto tr = hit_tramsformation->linear();
|
||||
auto tr = hit_tramsformation->linear().eval();
|
||||
for (int i = 0; i < 3; ++i)
|
||||
pts[i] = tr * hit_mesh->vertices(tri[i]).cast<double>();
|
||||
Vec3d normal_world = (pts[1] - pts[0]).cross(pts[2] - pts[1]);
|
||||
|
||||
Reference in New Issue
Block a user