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%
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.
(0.0, 0.0, 0.0) to (1.0, 1.0, 0.0) that encloses both fixtures. @testValueError. @testpart_a and part_b, each containing one triangle, returns a list of two mesh objects in file order with matching names and triangle counts. @testValueError mentioning ASCII-only support. @testtriangles: 2 and bounding_box: ((0.0, 0.0, 0.0), (1.0, 1.0, 0.0)). @test@generates
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.
"""Provides STL mesh loading, multi-solid parsing, and concatenation utilities.