stl
Read and Write STL Binary and ASCII Files.
Classes
STLMesh()
Bases: object
Container for STL mesh data.
Attributes
triangles = []
instance-attribute
Functions
add_triangle(normal, vertices)
Add a triangle to the mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
normal
|
tuple of 3 floats (nx, ny, nz) |
required | |
vertices
|
list of 3 tuples, each with 3 floats (x, y, z) |
required |
Source code in pyrevitlib/pyrevit/interop/stl.py
Functions
load(filepath)
Load an STL file (binary or ASCII).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
path to the STL file |
required |
Returns:
| Type | Description |
|---|---|
|
STLMesh object containing the mesh data |
Source code in pyrevitlib/pyrevit/interop/stl.py
dump(outputfile, mesh)
Save mesh to binary STL file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outputfile
|
path to output file |
required | |
mesh
|
STLMesh object to save |
required |