or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/numpy-stl@3.2.x
tile.json

tessl/pypi-numpy-stl

tessl install tessl/pypi-numpy-stl@3.2.0

Library 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%

task.mdevals/scenario-2/

Mesh Axis Editor

Utility for loading STL geometry and applying axis-aligned edits on triangle data stored in a structured array.

Capabilities

Triangles preserved during load

  • Loading a two-triangle STL fixture returns vertex coordinates shaped (2, 3, 3) that match the file contents and can be edited through the shared structured view. @test

Upward normals enforcement

  • Triangles with a negative Z normal are reordered so resulting normals have non-negative Z values and the vertex order is reversed for those triangles. @test

Axis-specific adjustment

  • Applying an X offset and Z scale updates only those axes for all vertices while leaving Y coordinates unchanged; the flattened vertex view reflects the updated values. @test

Indexed triangle replacement

  • Replacing vertices at a specified triangle index overwrites only that triangle and subsequent reads of the per-triangle view return the injected coordinates. @test

Implementation

@generates

API

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."""

Dependencies { .dependencies }

numpy-stl { .dependency }

Provides structured STL mesh arrays with normal and vertex axis views.