Remove orphaned geometry after Constructive Solid Geometry operation I have used a library to perform a Constructive Solid Geometry difference operation, which has left me with orphaned geometry as well as imperfections.

Is there an approach/algorithm that will allow me clean the geometry so all that remains is the two cuboids?
I've not done CSG per se, but I did work on a, not-unrelated, problem of triangulation of arbitrary, self-intersecting, multi-contoured polygons. If you don't get the implicit intersections correct, all sorts of nasty artefacts can result.

Initially, I tried using standard, floating-point maths to compute intersections etc, but this is fraught with precision problems and no amount of trickery of ordering etc eliminated these accuracy issues.

In the end, I replaced all intersection calculations with rational maths (high precision integer numerator and denominators) with sufficient precision that all intersections would be represented exactly. Once the process was completed, then these high precision results could be reduced to back to floating point.

Perhaps a quick way to start would be to use a package such as GNU's GMP which supports arbitrary rational representations.