meshcgalpolyhedranon-convex

Determining concavities of a non-convex polyhedron


Suppose to have a non-convex 3D polyhedron P, expressed as a mesh. What is the best algorithm for determining the set of all its concavities?

A first, maybe trivial, answer I thought could be to compute the convex hull C of the polyhedron P, and then to divide the insiemistic difference C - P into connected components. Could I be on the right direction? If yes, how do you compute the "difference" between meshes? Are there some CGAL functions I can use for "subtracting" meshes and getting the connected components.


Solution

  • Yes you can, you should look into the Nef_polyhedron_3 : https://doc.cgal.org/latest/Nef_3/classCGAL_1_1Nef__polyhedron__3.html

    Basically you convert your mesh and its convex_hull mesh to nef. From there you get acces to Boolean Operations, including the Difference. So you can get what you want, and then convert it back to Polyhedron. <code>input non convex mesh</code> <code>input mesh and its convex hull</code> <code>result of the difference</code>