Getting started with Python-powered OpenSCAD
Enabling Python support
For Python support to be enabled, 2 conditions must be met:
- The
python-enginefeature must be enabled
- The extension of the file you're editing MUST be
.py.
If both those condition are met, then the file will be interpreted as a Python file.
Differences with regular OpenSCAD
If you're familiar with regular OpenSCAD, then the synthax will be fairly obvious, as the names of functions and classes are the same.
The major difference is that you need to use the output() function for a shape to be displayed, as opposed to it being displayed automatically in regular OpenSCAD.
Creating a basic shape
Lets create a 5x5x5 cube.
That was pretty easy! Next, let's see how to combine multiple shapes.