0

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.

simonet
  • 295
  • 1
  • 14

1 Answers1

0

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>

mgimeno
  • 726
  • 1
  • 4
  • 7
  • Thanks for your suggestion. I read the reference page that you linked at but was not able to understand if I am allowed to use the `CGAL::Exact_predicates_inexact_constructions_kernel` that I use for computing the convex hull. What kernel should I use? – simonet Oct 29 '18 at 07:41
  • No, you should use `CGAL::CGAL::Exact_predicates_exact_constructions_kernel`. If needed, you can easily switch from one from another with `CGAL::copy_face_graph`. – mgimeno Oct 29 '18 at 13:34