mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-23 01:49:17 +00:00
fix: materialize Eigen cast expression before passing to distance_to_squared
Eigen's .cast<T>() returns a lazy CwiseUnaryOp expression, not a materialized Matrix. The distance_to_squared overload taking a nearest_point output parameter expects a concrete Eigen::Matrix, so template deduction fails on clang-cl. Materialize the cast into a local Vec variable before passing it. MSVC accepted the expression directly; clang-cl correctly rejects it.
This commit is contained in:
@@ -32,7 +32,8 @@ namespace AABBTreeLines {
|
||||
{
|
||||
Vec<LineType::Dim, typename LineType::Scalar> nearest_point;
|
||||
const LineType& line = lines[primitive_index];
|
||||
squared_distance = line_alg::distance_to_squared(line, origin.template cast<typename LineType::Scalar>(), &nearest_point);
|
||||
const Vec<LineType::Dim, typename LineType::Scalar> origin_cast = origin.template cast<typename LineType::Scalar>();
|
||||
squared_distance = line_alg::distance_to_squared(line, origin_cast, &nearest_point);
|
||||
return nearest_point.template cast<ScalarType>();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user