Vous suivez désormais cette soumission
- Les mises à jour seront visibles dans votre flux de contenu suivi
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails
Ray/triangle intersection using the algorithm proposed by Möller and
Trumbore (1997), implemented as highly vectorized MATLAB code.
The algorithm can work with one and two sided surfaces, as well as, with
infinite lines, rays (lines bounded on one side) and segments (lines bounded on
both sides).
Input (all arrays in in Nx3, where N is number of vertices or rays):
orig : ray's origin
dir : ray's direction
vert0, vert1, vert2: vertices of the triangle
Output:
Intersect - boolean array of length N
t - distance from the ray origin to the intersection point in |dir|
u,v - barycentric coordinates of the intersection point units
xcoor - carthesian coordinates of the intersection point
In addition PointInsideVolume is 3D equivalent to 2D inpolygon function and can test if
array of points is inside or outside any volume defined by the surface grid.
Citation pour cette source
Jaroslaw Tuszynski (2026). Triangle/Ray Intersection (https://fr.mathworks.com/matlabcentral/fileexchange/33073-triangle-ray-intersection), MATLAB Central File Exchange. Extrait(e) le .
Remerciements
Inspiré par : Ray/Triangle Intersection
A inspiré : in_polyhedron, RayShapeArticle_FEX.zip, CheckOutwardNormals
Informations générales
- Version 1.7 (309 ko)
Compatibilité avec les versions de MATLAB
- Compatible avec toutes les versions
Plateformes compatibles
- Windows
- macOS
- Linux
| Version | Publié le | Notes de version | Action |
|---|---|---|---|
| 1.7 | small corrections to the interface |
|
|
| 1.6.0.0 | Minimal changes suggested by Igor in Comments and Ratings |
||
| 1.5.0.0 | correct description: no symbolic toolbox is needed
|
||
| 1.4.0.0 | documentation improvements and typo correction |
||
| 1.2.0.0 | correct treatment of 3x3 arrays as suggested by Andreas Weber |
||
| 1.1.0.0 | Improvements to border handling |
||
| 1.0.0.0 |
