pyvista_js.STLReader#
- class pyvista_js.STLReader(path: str | Path)#
ベースクラス:
objectReader for STL (STereoLithography) files (
.stl).Reads an STL file (ASCII or binary) and produces a
Meshthat delegates parsing to vtk.js'svtkSTLReaderat render time. Python extracts only the vertex coordinates so that camera framing and bounding-sphere queries work before rendering.- パラメータ:
path (str or Path) -- Path to the
.stlfile.
サンプル
>>> from pyvista_js import examples >>> mesh = examples.download_cad_model() >>> mesh.plot()
- __init__(path: str | Path) None#
Initialize the reader with a file path.
Methods
Attributes
Return the file path.
- property path: Path#
Return the file path.
- 戻り値:
The path to the STL file.
- 戻り値の型:
Path
- read() _STLMesh#
Read the STL file and return a Mesh.
The full file content is base64-encoded and stored so that vtk.js can parse it at render time. Vertex coordinates are extracted on the Python side for bounding-sphere and camera-framing calculations.
- 戻り値:
A mesh backed by the STL file content.
- 戻り値の型:
Mesh
- 例外:
ValueError -- If the file format is invalid or unsupported.