tessl install tessl/pypi-numpy-stl@3.2.0Library to make reading, writing and modifying both binary and ascii STL files easy.
Agent Success
Agent success rate when using this tile
85%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.39x
Baseline
Agent success rate without this tile
61%
Utility for loading STL geometry and applying axis-aligned edits on triangle data stored in a structured array.
(2, 3, 3) that match the file contents and can be edited through the shared structured view. @test@generates
from typing import Sequence
import numpy as np
def load_triangle_points(path: str) -> np.ndarray:
"""Load an STL and return triangle vertices shaped (n, 3, 3)."""
def orient_normals_up(path: str) -> np.ndarray:
"""Load an STL, flip triangles whose normals point downward, and return updated normals shaped (n, 3)."""
def adjust_axes(path: str, x_offset: float, z_scale: float) -> np.ndarray:
"""Load an STL, apply an additive offset to X and multiplicative scale to Z for all vertices, and return the flattened (n*3, 3) view."""
def replace_triangle(path: str, index: int, vertices: Sequence[Sequence[float]]) -> np.ndarray:
"""Load an STL, overwrite the vertices at the given triangle index using the provided 3x3 coordinates, and return the stored vertices for that triangle."""Provides structured STL mesh arrays with normal and vertex axis views.