Here is a script that can be run with canvas-sketch to generate OBJ files from a parametric/algorithmic 3D ThreeJS geometry.
Hitting "Cmd + S" from the canvas-sketch tool will export a PNG and OBJ file of the scene.
If the same script is run from Node, it will simply render the OBJ to stdout, or write to the filename argument if given.