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?

Respuestas (1)

Rik
Rik el 22 de Mzo. de 2017

0 votos

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.

Categorías

Etiquetas

Preguntada:

el 20 de Mzo. de 2017

Respondida:

Rik
el 22 de Mzo. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by