CGAL_Build_PolySet build until manifold (then begin new surface)
Hi Clifford and Marius,
Pulling on some threads in the code, I've found that import_stl builds a PolySet, which in turn calls render_cgal_nef_polyhedron, which instantiates CGAL_Build_PolySet, which ultimately makes use of CGAL::Polyhedron_incremental_builder_3 functions.
Scanning through CGAL/Polyhedron_incremental_builder_3.h, I noticed a few class functions that could prove useful for tightening up the import code:
- test_facet --> calls test_facet_indices: appears to test if a facet can be inserted without creating non-manifoldness in the surface.
- check_unconnected_vertices/remove_unconnected_vertices: identify and handle incomplete geometry.
The "test_facet" functions might be useful for adding facets until a manifold condition or the end of imported geometry is reached. Roughly in pseudo code:
Depending on how greatly unconnected vertices interfere with CGAL/CSG operations further down the line, the check_/remove_unconnected_vertices may be useful to use at the end of import to clean up, identify, debug, and perhaps fix incomplete geometry.
"The future is already here. It's just not very evenly distributed" -- William Gibson