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,

回答 (1 件)

Matt J
Matt J 2013 年 2 月 19 日

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)

1 件のコメント

zheng
zheng 2013 年 2 月 19 日
Thanks, I will look into it~

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2013 年 2 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by