How solidcode/solidpython works
SolidPython is a Python interface for building OpenSCAD models and emitting SCAD text or files. The main workflow is to construct geometry with OpenSCAD-style primitives and CSG operations, then render the object tree; OpenSCAD can consume the generated file for preview or mesh rendering. Separate capabilities include importing existing SCAD modules, utilities for positioning and BOM work, and geometry-generation extensions. Edges follow the README or shown imports/calls; unsampled details are not inferred.
Main entry points: objects.py OpenSCAD primitives · solidpython.py SCAD renderer · __init__.py SolidPython API · scad_parser.py SCAD importer parser
Components 14
Model construction
- SolidPython API
solid/__init__.py - OpenSCAD primitives
solid/objects.py - Euclid compatibility
solid/patch_euclid.py - Model utilities
solid/utils.py
SCAD generation and import
- SCAD renderer
solid/solidpython.py - SCAD importer parser
solid/py_scadparser/scad_parser.py - SCAD lexer tokens
solid/py_scadparser/scad_tokens.py - SCAD declarations AST
solid/py_scadparser/scad_ast.py - Generated SCAD file
Geometry extensions
- Path extrusion
solid/extrude_along_path.py - Spline surfaces
solid/splines.py - Screw threads
solid/screw_thread.py
Other components
- Python model author
- OpenSCAD
Connections 15
- Python model author → SolidPython API: authors with
README.rst - SolidPython API → SCAD renderer: renders through
solid/__init__.py - SolidPython API → OpenSCAD primitives: exposes
solid/__init__.py - SolidPython API → Euclid compatibility: exposes patch
solid/__init__.py - OpenSCAD primitives → SCAD renderer: builds object tree
solid/objects.py - Model utilities → OpenSCAD primitives: uses primitives
solid/utils.py - SCAD renderer → Generated SCAD file: writes SCAD
README.rst - SCAD renderer → SCAD importer parser: parses imports
solid/solidpython.py - SCAD importer parser → SCAD lexer tokens: uses lexer
solid/py_scadparser/scad_parser.py - SCAD importer parser → SCAD declarations AST: builds declarations
solid/py_scadparser/scad_parser.py - Generated SCAD file → OpenSCAD: opens or renders
README.rst - Path extrusion → OpenSCAD primitives: creates polyhedra
solid/extrude_along_path.py - Spline surfaces → OpenSCAD primitives: creates shapes
solid/splines.py - Screw threads → OpenSCAD primitives: creates CSG
solid/screw_thread.py - Screw threads → SCAD renderer: exports example
solid/screw_thread.py