convex_decomposition_3 fails for on trivial concave Nef3 polyhedron
Issue Details
Using the convex_decomposition_3 example at https://doc.cgal.org/latest/Convex_decomposition_3/Convex_decomposition_3_2list_of_convex_parts_8cpp-example.html, the decomposition fails for a relatively trivial concave Nef3 polyhedron:
$ ./decompose < issue.nef3
CGAL::Polyhedron_incremental_builder_3<HDS>::
add_vertex_to_facet(): vertex index 41 is out-of-range [0,15].
decomposition into 9 convex parts
The error causes one of the decomposed volumes to be empty. It seems to be the large center cuboid that fails.
Design was initially created using this OpenSCAD script:
difference() {
cube([10,10,8], center=true);
cube([8,8,10], center=true);
}
cube([12, 12, 4], center=true);
Source Code
https://doc.cgal.org/latest/Convex_decomposition_3/Convex_decomposition_3_2list_of_convex_parts_8cpp-example.html
Environment
- Operating system: macOS 13.6 M1, but issue seems to be present across OSes
- Compiler: clang15 (Xcode 15.2)
- Release or debug mode: Release mode
- CGAL version: 5.6.1 and 5.5 tested
- Boost version: 1.81.0
Any chance you'd have the input mesh as OFF ?
OFF file (exported from OpenSCAD). It seems to exhibit the same issue: issue2841.off.txt
https://github.com/CGAL/cgal/pull/8442 should fix the issue.