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?

Answers (1)

Rik
Rik on 22 Mar 2017
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.

Categories

Tags

Asked:

on 20 Mar 2017

Answered:

Rik
on 22 Mar 2017

Community Treasure Hunt

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

Start Hunting!