Skip to content

Commit

Permalink
[geom] Add load_stl() docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Holl committed Nov 27, 2024
1 parent 6c639ca commit 7d18768
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion phi/geom/_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,17 @@ def load_gmsh(file: str, boundary_names: Sequence[str] = None, periodic: str = N


@broadcast
def load_stl(file: str, face_dim=instance('faces')):
def load_stl(file: str, face_dim=instance('faces')) -> Mesh:
"""
Load a triangle `Mesh` from an STL file.
Args:
file: File path to `.stl` file.
face_dim: Instance dim along which to list the triangles.
Returns:
`Mesh` with `spatial_rank=3` and `element_rank=2`.
"""
import stl
model = stl.mesh.Mesh.from_file(file)
points = np.reshape(model.points, (-1, 3))
Expand Down

0 comments on commit 7d18768

Please sign in to comment.