mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 19:12:38 -07:00
SLA gizmo no more uses IGL code directly, all was moved to the new MeshRaycaster class
This commit is contained in:
@@ -240,11 +240,27 @@ std::vector<unsigned> MeshRaycaster::get_unobscured_idxs(const Geometry::Transfo
|
||||
if (! is_obscured)
|
||||
out.push_back(i);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Vec3f MeshRaycaster::get_closest_point(const Vec3f& point, Vec3f* normal) const
|
||||
{
|
||||
int idx = 0;
|
||||
Eigen::Matrix<float, 1, 3> closest_point;
|
||||
m_AABB_wrapper->m_AABB.squared_distance(
|
||||
AABBWrapper::MapMatrixXfUnaligned(m_mesh->its.vertices.front().data(), m_mesh->its.vertices.size(), 3),
|
||||
AABBWrapper::MapMatrixXiUnaligned(m_mesh->its.indices.front().data(), m_mesh->its.indices.size(), 3),
|
||||
point, idx, closest_point);
|
||||
if (normal) {
|
||||
igl::Hit imag_hit;
|
||||
imag_hit.id = idx;
|
||||
*normal = m_AABB_wrapper->get_hit_normal(imag_hit);
|
||||
}
|
||||
return closest_point;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
Reference in New Issue
Block a user