Updated 20 Aug 2018
Tests if points are inside of triangulated volume. There are NO assumptions about orientation of the face normals. The code uses simple algorithm, is fully documented and optimized for speed.
Jaroslaw Tuszynski (2023). in_polyhedron (https://www.mathworks.com/matlabcentral/fileexchange/48041-in_polyhedron), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
- MATLAB > Graphics > 2-D and 3-D Plots > Surfaces, Volumes, and Polygons > Surface and Mesh Plots >
- MATLAB > Mathematics > Computational Geometry > Triangulation Representation >
Inspired by: Triangle/Ray Intersection, inpolyhedron - are points inside a triangulated volume?
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
improve test for points on the surface
fixed case when test points are the same as the grid points