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%
A small utility that wraps the package-provided STL command-line converters to standardize ASCII/BINARY outputs, mesh naming, and cleanup without reimplementing STL parsing.
@generates
Use the dependency's CLI executables for all format conversions and mesh naming; assume they are available on the PATH.
from typing import Optional, Dict, Any
def to_ascii(src_path: str, dest_path: str, mesh_name: Optional[str] = None, remove_empty: bool = False) -> Dict[str, Any]:
"""
Convert an STL file to ASCII using the dependency's command-line converter.
Returns a summary containing keys: format ("ascii"), triangles (int), mesh_name (str).
"""
def to_binary(src_path: str, dest_path: str, use_speedups: bool = True) -> Dict[str, Any]:
"""
Convert an STL file to binary using the dependency's command-line converter.
Returns a summary containing keys: format ("binary"), triangles (int), mesh_name (str).
"""
def cleanup_and_dual_export(src_path: str, ascii_path: str, binary_path: str, mesh_name: str, remove_empty: bool = True) -> Dict[str, Any]:
"""
Auto-detect input format, remove empty/degenerate triangles, rename the mesh, export ASCII and binary outputs,
and return a summary containing triangle counts for input and cleaned outputs plus the applied mesh_name.
"""Command-line utilities for STL format conversion, header naming, speedup toggling, and empty-triangle removal.