Special Variables
PythonSCAD uses global Python variables instead of OpenSCAD's $-prefixed special variables.
fn
Number of segments used to approximate curves (circles, spheres, cylinders, etc.). Setting fn overrides fa and fs. Equivalent to OpenSCAD's $fn.
from openscad import *
fn = 100
circle(10).show() # high-resolution circle
fn = 6
circle(10).show() # hexagon
You can also pass fn as a keyword argument to individual functions:
OpenSCAD reference: $fn
fa
Minimum angle in degrees for each segment of a curve. Smaller values produce smoother curves. Equivalent to OpenSCAD's $fa.
OpenSCAD reference: $fa
fs
Minimum circumferential length for each segment of a curve. Smaller values produce smoother curves on larger objects. Equivalent to OpenSCAD's $fs.
OpenSCAD reference: $fs
time
Animation time step, ranging from 0 to 1. Updated by PythonSCAD's animation system. Equivalent to OpenSCAD's $t.
phi
Convenience variable equal to 2 * PI * time. Useful for smooth cyclic animations.