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-7/

Multi-Mesh Aggregation Utility

Compose helper functions for working with STL data that can arrive as several files or as a single ASCII document containing multiple solids. The utilities combine meshes, expose ordered access to per-solid meshes, and emit concise geometry summaries.

Capabilities

Merge multiple STL files

  • Combining two ASCII STL files containing one triangle each returns a single mesh with 2 triangles and a bounding box from (0.0, 0.0, 0.0) to (1.0, 1.0, 0.0) that encloses both fixtures. @test
  • Passing an empty iterable of file paths raises ValueError. @test

Load multi-solid ASCII STL

  • Reading an ASCII STL with two solids named part_a and part_b, each containing one triangle, returns a list of two mesh objects in file order with matching names and triangle counts. @test
  • Attempting to load a binary STL that declares multiple solids raises ValueError mentioning ASCII-only support. @test

Summarize merged mesh

  • Summarizing a merged mesh built from the two one-triangle fixtures returns a dictionary containing triangles: 2 and bounding_box: ((0.0, 0.0, 0.0), (1.0, 1.0, 0.0)). @test

Implementation

@generates

API

from typing import Iterable, Any, Dict, List, Tuple

def merge_mesh_files(paths: Iterable[str], recalc_normals: bool = True) -> Any:
    """
    Combine meshes from multiple STL files into one mesh object supplied by the dependency.
    - Raises ValueError when paths is empty.
    - When recalc_normals is True, recompute normals on the merged result.
    """

def load_ascii_multi_mesh(path: str) -> List[Any]:
    """
    Parse an ASCII STL containing multiple solids and return a list of mesh objects in file order.
    - Retain solid names on returned meshes when present.
    - Raise ValueError when the file is not ASCII or contains no solids.
    """

def summarize_mesh(mesh_obj: Any) -> Dict[str, Tuple[Tuple[float, float, float], Tuple[float, float, float]]]:
    """
    Return a summary with keys:
    - "triangles": the number of triangles in the mesh.
    - "bounding_box": ((min_x, min_y, min_z), (max_x, max_y, max_z)) derived from all vertices.
    """

Dependencies { .dependencies }

numpy-stl { .dependency }

Provides STL mesh loading, multi-solid parsing, and concatenation utilities.