11#pragma once
22
33#include " compas.hpp"
4- #include < igl/Hit.h>
54#include < igl/ray_mesh_intersect.h>
6- #include < igl/readOFF.h>
5+ #include < igl/Hit.h>
6+ #include < Eigen/Core>
7+
8+ /* *
9+ * Compute intersection between a single ray and a mesh.
10+ *
11+ * @param point Origin point of the ray
12+ * @param direction Direction vector of the ray
13+ * @param V #V x 3 matrix of vertex coordinates
14+ * @param F #F x 3 matrix of triangle indices
15+ * @return Vector of intersection hits, each containing (face_id, u, v, t) where:
16+ * - face_id: index of intersected face
17+ * - u, v: barycentric coordinates of hit point
18+ * - t: ray parameter at intersection
19+ */
20+ std::vector<std::tuple<int , float , float , float >>
21+ intersection_ray_mesh (const Eigen::Vector3d& point, const Eigen::Vector3d& direction,
22+ const compas::RowMatrixXd& V, const compas::RowMatrixXi& F);
23+
24+ /* *
25+ * Compute intersections between multiple rays and a mesh.
26+ *
27+ * @param points #R x 3 matrix of ray origin points
28+ * @param directions #R x 3 matrix of ray direction vectors
29+ * @param V #V x 3 matrix of vertex coordinates
30+ * @param F #F x 3 matrix of triangle indices
31+ * @return Vector of intersection hits per ray, each hit containing (face_id, u, v, t)
32+ */
33+ std::vector<std::vector<std::tuple<int , float , float , float >>>
34+ intersection_rays_mesh (const compas::RowMatrixXd& points,
35+ const compas::RowMatrixXd& directions,
36+ const compas::RowMatrixXd& V,
37+ const compas::RowMatrixXi& F);
0 commit comments