You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
boolean_chain returns an empty result (0 vertices, 0 faces) when the target mesh and cutter meshes share a coplanar edge. The target
is a simple 8-vertex box (inner beam plate). The three wedge cutters each have faces at exactly
Z=3303.0. Shifting the cutters by +0.1 in Z makes the operation succeed. The individual cutters are all valid: closed, manifold,
triangulated, consistently oriented outward normals. The operation is ["difference", "difference", "difference"].
The problem is really happens when elements are collinear, I am talking about -80.000000000000043 ~1e-14 level. This happens when doing Python Transformation using doubles. This is something that corefinement cannot catch if input is such. The obj files will work on c++ because CGAL IO obj will round to decimal places and would work.
It is quite tricky to catch these bugs.
The key issue is this: corefine_and_compute_difference returns false (failed) on valid closed meshes with both EPICK and EPECK, while union/intersection/swapped-difference all succeed on the same input. The problem is specifically the dirty cutter as operand B of A - B.
Since obj will round coordinates I share .off files:
OK as you said, the situation here is like in the drawing:
when you are subtracting yellow you create a non-manifold connection between two red volumes.
You can successfully compute the resulting triangle soup using either #9363 or the non-manifold visitor.
However, you will end up with something that is a polygon soup and only #9363 is able to do any additional Boolean operations.
If you are in a case where most of the things happening are axis-aligned, then a coordinate snapping might be the way to go (especially if you already know that some intermediate single float are used somewhere in the pipeline). Could that be something working for you?
The situation is this, and yes because of imprecision it results in what you drew:
The rounding helps, but this is because it is a specific case where I know what I do. If a user is not a software developer, then these cases would be troublesome to debug. Most of the user cases we have are in CAD, and they use doubles in the kernel.
I am wondering if snapping to coordinates could be part of CGAL Mesh Boolean.
Activity
petrasvestartas commentedon May 26, 2026
The problem is really happens when elements are collinear, I am talking about -80.000000000000043 ~1e-14 level. This happens when doing Python Transformation using doubles. This is something that corefinement cannot catch if input is such. The obj files will work on c++ because CGAL IO obj will round to decimal places and would work.
It is quite tricky to catch these bugs.
The key issue is this: corefine_and_compute_difference returns false (failed) on valid closed meshes with both EPICK and EPECK, while union/intersection/swapped-difference all succeed on the same input. The problem is specifically the dirty cutter as operand B of A - B.
Since obj will round coordinates I share .off files:
cgal_debug.zip
petrasvestartas commentedon May 26, 2026
I will try try autorefine_triangle_soup with apply_iterative_snap_rounding(true) .
petrasvestartas commentedon May 26, 2026
No, this does not help: https://doc.cgal.org/6.2-beta1/PMP_Boolean_operations/PMP_Boolean_operations_2corefinement_consecutive_bool_op_8cpp-example.html , we are really talking about super small tolerance, even input meshes are simple and completely valid.
I am talking about precision of these edges, marked in red:
sloriot commentedon Jun 1, 2026
OK as you said, the situation here is like in the drawing:
when you are subtracting yellow you create a non-manifold connection between two red volumes.
You can successfully compute the resulting triangle soup using either #9363 or the non-manifold visitor.
However, you will end up with something that is a polygon soup and only #9363 is able to do any additional Boolean operations.
If you are in a case where most of the things happening are axis-aligned, then a coordinate snapping might be the way to go (especially if you already know that some intermediate single float are used somewhere in the pipeline). Could that be something working for you?
petrasvestartas commentedon Jun 1, 2026
The situation is this, and yes because of imprecision it results in what you drew:
The rounding helps, but this is because it is a specific case where I know what I do. If a user is not a software developer, then these cases would be troublesome to debug. Most of the user cases we have are in CAD, and they use doubles in the kernel.
I am wondering if snapping to coordinates could be part of CGAL Mesh Boolean.
I will try the PR and the example you referenced.
sloriot commentedon Jun 1, 2026
As I said, trying the PR and example will probably not help because you will end up with a soup.
About snapping in CGAL, that was indeed my idea to have a pre-processing function. I did some tests in a PR, and in particular this commit:
e94be55
I'm expecting it to work great in your case, but in general cases, it was still missing some steps.
[-]Mesh Boolean Difference (Consequtive )[/-][+]Mesh Boolean Difference (Consecutive )[/+]