Skip to content Skip to sidebar Skip to footer

How To Determine Whether A Point Is Inside Or Outside A 3d Model Computationally

I have a .obj and .ply file of a 3D model. What I want to do is read this 3D model file and see if a list of 3D coordinates are either inside or outside the 3D model space. For exa

Solution 1:

Cast a ray from the 3D point along X-axis and check how many intersections with outer object you find.

Depending on the intersection number on each axis (even or odd) you can understand if your point is inside or outside.

You may want to repeat on Y and Z axes to improve the result (sometimes your ray is coincident with planar faces and intersection number is not reliable).

Solution 2:

Converting my comment into an answer for future readers.

You can use a Convex Hull library to check whether a point is inside the hull. Most libraries use signed distance function to determine whether the point is inside. trimesh is one of the libraries that implements this feature.

Post a Comment for "How To Determine Whether A Point Is Inside Or Outside A 3d Model Computationally"