I can’t help with the CSG problem in general, but the original problem of extruding shapes on a closed path is based on problems with Path3d, demonstrated here: https://playground.babylonjs.com/#2DLXYB#269
There are two related problems:
- The initial and final tangents and binormals do not take into account that they are at the same point, so they are different and only based on the initial or final segment. Note that at midpoints in the path, Path3d computes reasonable average tangents and binormals.
- At the initial and final point on the closed path, you get two different binormals, which gives two different locations for placing the points for the ribbon path, which then need to be connected by a spurious segment.
I think a fix for Path3d to support closed paths would eliminate many of the issues with extrusions and make the resulting extrusion cleaner and simpler for things like CSG