0

I am doing some boolean operation on Nef polyhedra converted from regular polyhedra. After doing the boolean operation I want to convert the resulting Nef polyhedra into regular polyhedra. However it seems that Nef polyhedra only support if the result is a single volume. Some boolean operations however result in multiple volumes. Is there a way to split the Nef polyhedron into into the discrete volumes it contains and convert these back to regular polyhedra separately? Alternatively is there some more appropriate approach?

I have found the Nef_polyhedron_3::Volume and the corresponding iterator, but i have not been able to identify a way to utilize these to split up the Nef Polyhedron.

Edit:

I finally got around to properly look at this. The code provided worked almost out of the box. I ran in to a few issues that were pretty easily solved. First, i implemented BuildPolyhedronFromShell outside the Nef_polyhedron class as i would like to keep my CGAl Implementation as clean as possible. It was however necessary to make Nef_polyhedron_3::Triangulation_handler2 public, as it is used in BuildPolyhedronFromShell.

Additionally the code initially create shells with inward facing normals. This was fixed by changing Halffacet_const_handle f = opposite_facet->twin(); to Halffacet_const_handle f = opposite_facet; I don't know if this solves the problem in the general case, but i works for the cases i tried.

Thank you for the help.

Taus
  • 344
  • 2
  • 15
  • 1
    I've added the function `convert_all_inner_shells_to_polyhedrons()` in the following [branch](https://github.com/sloriot/cgal/tree/Nef_3-add_function-sloriot). – sloriot Oct 01 '15 at 08:22
  • I am unable to find the function in that branch. Additionally it seems that specific branch had its last commit 3 years ago. Is this a feature that was discarded? – Taus Oct 01 '15 at 09:11
  • 1
    The new functionality are in the last two commits of the branch. It is not discarded, just delayed due to the lack of interest. – sloriot Oct 01 '15 at 12:54

0 Answers0