Find points in 3D polygon using inhull

I have series of points (a 344*3 matrix)forming a 3D polygon. It's actually providing an surface for my desired area.
When I pick up a point by myself within the polygon and test with inhull.m, it always returns me 0. When I check with convhulln function, it seems like it only checking the surface, not the entire thing.
Does anyone know how to fix this problem? Is there a guide I need to follow to form the polygon matrix that checking by the inhull.m?
Thanks,

Answers (1)

inhull isn't a MATLAB stock function, so hard to comment on its behavior. However, since it's a convex polyhedron, you could use VERT2LCON
[A,b]=vert2lcon(points);
is_inside = all(A*x<=b)

Categories

Find more on Computational Geometry in Help Center and File Exchange

Tags

Asked:

on 19 Feb 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!