Inpolygon input with faces and vertices?

Hi,
from an external toolbox (<http://mtex-toolbox.github.io/>) I got a output of polygons (containing holes in general) defined by faces and matrices, which can be plotted using the "patch(S)" polygon plot (see MATLAB documentation of "patch" for more details).
For my own purposes I need to check if a specific coordinate is inside the polygon (such as in the "inpolygon" function). Unfortunatally, inpolygon only supports the input of vertices alone.
There is a the "poly2fv" which converts the polygonal representation into the faces and vertices representation, exactly the inverse from what I need.
Is there maybe an inverse of "poly2fv" in some way or does somebody knows about a function similiar to "inpolygon" which supports the vertices and faces input?

답변 (1개)

Rik
Rik 2017년 3월 22일

0 개 추천

I had 3D meshes without holes, but this FEX submission may do what you need. Below the surface it generates a binary 3D matrix (with the pixels inside the mesh being true). I recommend setting heavytest to something like 5.

카테고리

도움말 센터File Exchange에서 Polygonal Shapes에 대해 자세히 알아보기

태그

질문:

2017년 3월 20일

답변:

Rik
2017년 3월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by