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

CLI STL Conversion Helper

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.

Capabilities

ASCII conversion with rename

  • Converting a binary STL containing a single triangle to ASCII writes a text file whose first line starts with "solid CustomName", retains the triangle count, and preserves all vertex coordinates @test

Binary conversion with speed toggle

  • Converting an ASCII STL to binary while toggling speedups produces a binary file smaller than the ASCII source and matches normals and vertices when reloaded @test

Auto conversion with cleanup

  • Auto-detecting an STL input, removing zero-area triangles, applying a new mesh name, and exporting both ASCII and binary outputs yields cleaned files that share the reduced triangle count and updated mesh name @test

Implementation

@generates

Use the dependency's CLI executables for all format conversions and mesh naming; assume they are available on the PATH.

API

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

Dependencies { .dependencies }

numpy-stl { .dependency }

Command-line utilities for STL format conversion, header naming, speedup toggling, and empty-triangle removal.