In various cases, code to generate them can be simpler. E.g. the shapes you show, some of them, look like “extrusions” (term common in IFC and X3D). You can take a look how we build X3D nodes to display TIfcExtrudedAreaSolid. Basically, we use TIndexedFaceSetNode (sometimes with convex=false, for possibly-concave caps) with the beginning and ending. Between them, we use TIndexedQuadSetNode to place quads.
This is a short version of the answer – I see you solved it already on your side too:) Let me know if you need more info.