Extrude the path by following it with a rectangle (upright, perpendicular to the path direction), returns a CSG solid.
Simplified (openscad like, even though OpenSCAD doesn't provide this) via rectangular_extrude(), where as
rectangular_extrude([ [10,10], [-10,10], [-20,0], [-10,-10], [10,-10] ], // path is an array of 2d coords {w: 1, h: 3, closed: true});
or more low-level via rectangularExtrude(), with following unnamed variables:
// first creating a 2D path, and then extrude it var path = new CSG.Path2D([ [10,10], [-10,10], [-20,0], [-10,-10], [10,-10] ], /*closed=*/true); var csg = path.rectangularExtrude(3, 4, 16, true); // w, h, resolution, roundEnds return csg;