pyvista_cad.read_scad#
- read_scad(path, /, *, binary=None, args=(), timeout=None, **_)[source]#
Compile an OpenSCAD source file and return the resulting mesh.
The OpenSCAD CLI compiles
.scadto STL in a temp directory; the STL is then loaded as apyvista.PolyData. Theopenscadbinary must be installed and onPATH(or passbinary=to point at it).- Parameters:
- pathstr or os.PathLike
Path to a
.scadsource file.- binarystr or None, optional
Explicit path to the openscad executable.
- argstuple of str, optional
Extra CLI arguments forwarded to openscad (e.g.
('-D', 'n=20')). The fast--backend=manifoldkernel (OpenSCAD >= 2024) is used automatically, with a transparent fallback to the default CGAL kernel on older builds. Pass an explicit--backend=...here to override.- timeoutfloat or None, optional
Subprocess timeout in seconds.
- **_Any
Forward-compat keyword arguments are accepted and ignored.
- Returns:
- pyvista.PolyData
Tessellated mesh.
- Parameters:
- Return type: