TextCAD is an experimental interface for Python to OpenSCAD design. The project objective was to develop a system in Python that allowed for the use of Object Oriented Programming with functional solid modelling as seen in OpenSCAD. I didn’t want to re-invent too much, but rather understand from a programmatic aspect what OpenSCAD with OOP could feel like. For this reason, I kept OpenSCAD as the rendering layer to avoid additional complexity.
The pipeline started with serialized Python Objects, which were output as JSON, then parsed out to a CSG file readable by OpenSCAD. File watchers allowed for a similar iterative development experience as OpenSCAD where any file save would-re-render the component.
https://github.com/sjkelly/textcad
https://github.com/sjkelly/python-textcad
As an initial test I developed a port of Magpie to TextCAD.
https://github.com/sjkelly/pyMagpie
And I finally developed a prototype H-bot gantry to test the paradigm, called HaytchBot.
https://github.com/sjkelly/HaytchBot
Overall the project and experiment was quite successful. I realized that over-reliance on OOP leads to less literal programming, and the code becomes highly linear. In contrast to OpenSCAD, with its deeply nested blocks, improper OOP makes debugging and collaboration way more difficult.