Hello
I remember that this had been discussed already in this topic with @Deltakosh and @Evgeni_Popov , the problem comes from the fact that your “H” shape is not convex.
It seems that the default CAP generator of BabylonJS is a very simplistic “star” caping. It does something like that :
(Star extrusion toward the center)
While the best would be to have a “smarter” shape closing like that :
(dividing into convex subparts)
I think the best in your case would be to call the extruder without caps, and generate the right caps yourself.
By the way, I had proposed to add such feature, but still, didn’t took the time to deep dive into it