Issue with Boolean Operations on Solids Containing Coincident Triangles (CGAL 6.0.2).
Dear CGAL Team,
I am encountering a problem when performing Boolean operations on two triangulated, watertight solids using CGAL 6.0.2. Both meshes are valid and load correctly, but the Boolean operation fails at runtime with the following assertion:
CGAL error: assertion violation! Expression : insert_ok || mesh_to_vertex_to_node_id[&tm][target(h,tm)]==node_id File : CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h Line : 768
After investigating, I found that the two solids share some geometrically coincident triangles (same geometry but coming from different meshes). My understanding is that these overlapping or coincident elements may be confusing the corefinement process, but I am not fully sure.
Here are some additional details:
CGAL version: 6.0.2 Kernel used: Exact_predicates_inexact_constructions_kernel Boolean function used: PMP::corefine_and_compute_union(), corefine_and_compute_intersection(), corefine_and_compute_difference() Mesh types: CGAL::Surface_mesh<Point_3>
Preprocessing steps attempted: PMP::stitch_borders PMP::remove_isolated_vertices PMP::remove_degenerate_faces PMP::orient_to_bound_a_volume PMP::self_intersections
Both meshes appear manifold, closed, and without detectable degeneracies. The error occurs only for certain input meshes, particularly those with partially coincident surface patches.
If possible, I would appreciate guidance on:
- Whether CGAL supports Boolean operations between meshes that contain exactly coincident triangles (shared geometry).
- Whether there is a recommended preprocessing step to handle such cases (e.g., snapping, merging, small perturbation, removing overlapping triangles).
- Any suggestions for detecting the exact cause of this assertion failure.
- Whether this might be a known limitation or a potential bug in the corefinement package.
I have attached sample OBJ files along with the code that reproduce the issue.
Thank you very much for your time and assistance.
It seems that you found a bug! I'll update the ticket when I have a fix.