<p>I'm searching for an efficient data structure and algorithm to compute the minimum distance between a ray and a set of meshes in 3D.</p>
<p>What I expect as a result are the coordinates of the nearest point on the nearest mesh.</p>
<p>I'm interested in the general case where the (infinite) ray is not intersecting with any mesh, but I'd expect if it's actually intersecting to get as a result the nearest intersecting point.</p>
<p>For efficiency purpose, I'm willing to set up some accelerating data structure with the list of meshes (and to simplify / decompose those as convex hulls if this is an algorithm expectation), instead of iterating on meshes and their components.</p>

CC BY-SA 4.0
2023-09-04T12:17:56.340Z
@YvesDaoust have in mind, that finding the closest bounding sphere does not meaning finding the closest object... A ray can hit the bounding sphere of object1 and miss the bounding sphere of object2 while a face of object2 is closer to the ray than all faces of object1...
Thomas
CC BY-SA 4.0
2023-09-04T13:28:38.453Z
with closer I mean the minimum distance of a face (triangle) and the line (ray)
Thomas
<3d><computational-geometry><mesh><ray>
How to find point on mesh at a minimum distance from ray
oparisy
# How to find point on mesh at a minimum distance from ray

(Asked by: username_0 on 2023-09-03)

I'm searching for an efficient data structure and algorithm to compute the minimum distance between a ray and a set of meshes in 3D.

What I expect as a result are the coordinates of the nearest point on the nearest mesh.

I'm interested in the general case where the (infinite) ray is not intersecting with any mesh, but I'd expect if it's actually intersecting to get as a result the nearest intersecting point.

For efficiency purpose, I'm willing to set up some accelerating data structure with the list of meshes (and to simplify / decompose those as convex hulls if this is an algorithm expectation), instead of iterating on meshes and their components.

**Tags:** 3d, computational-geometry, mesh, ray

> **Comments:**
> **username_1**: @YvesDaoust have in mind, that finding the closest bounding sphere does not meaning finding the closest object... A ray can hit the bounding sphere of object1 and miss the bounding sphere of object2 while a face of object2 is closer to the ray than all faces of object1...  
> **username_1**: with closer I mean the minimum distance of a face (triangle) and the line (ray)  

---

## 0 answers

