I don’t know if you guys have noticed or thought about this but many of the kicad 3D Models like headers and connectors are already script generated and those scripts are open sourced. Perhaps for the jscad native implementations you can simply port the logic from those generators directly instead of trying to wrangle it yourselves?