pyvista_cad.read_scad

On this page

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 .scad to STL in a temp directory; the STL is then loaded as a pyvista.PolyData. The openscad binary must be installed and on PATH (or pass binary= to point at it).

Parameters:
pathstr or os.PathLike

Path to a .scad source 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=manifold kernel (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:

PolyData