How can I know if Brep.CreateBooleanDifference did substract something?

Ist there a way to know if Brep.CreateBooleanDifference did actually subtract anything from the input brep?

Lets say the brep and the trimmer are just touching each other.

Even if the returned brep is the same as the input , calling Object.ReferenceEquals returns always false.

Would I first have to compute CreateBooleanIntersection and see if it returns anything ?
Since these calls can be expensive I would like to avoid that.

A cheap method might be to get/check the brep volumes:

191218_BrepsKissing_00.gh (7.9 KB)

Though this probably is too simple to catch all cases.

1 Like

or maybe even cheaper compare the vertex count, and distance from start to end vertex of each edge.
Since in most cases I would expect the vertex count to change this could be a very cheap proof that a subtractions actually happend.
Only then more expensive checks could follow.
Also not sure if this would catch all cases.

I would convert breps to meshes, then use MeshMeshFast to check if the return line array is empty or not.
Just wondering if brep to mesh conversion would be fast.

If (planar) faces are overlapping a particular way, both Brep.CreateBooleanDifference and the _BooleanDifference command can create a brep with increased component counts.
image image