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

3MF Scene Summarizer

Build a small utility that reads zipped 3MF files, extracts every mesh they contain, and produces summaries plus an STL export option. Rely on the provided dependency for parsing the 3MF container rather than manually handling XML or ZIP structures.

Capabilities

Summarize each mesh

  • Summarizing the single-part fixture cube.3mf returns one entry named Cube with triangles equal to 12 and bounding_box ((0.0, 0.0, 0.0), (1.0, 1.0, 1.0)), preserving the mesh name from the file. @test
  • Summarizing the multi-part fixture assembly.3mf returns two entries in file order: first Bracket with triangles 24 and bounding_box ((0.0, 0.0, 0.0), (40.0, 20.0, 10.0)), then Clip with triangles 8 and bounding_box ((5.0, 0.0, 0.0), (15.0, 10.0, 5.0)). @test

Filtering meshes

  • When an include list is provided, only meshes whose names match the list are summarized; non-matching meshes are ignored without errors. Using assembly.3mf with ["Clip"] returns a single Clip summary with triangles 8. @test

Export to STL

  • Exporting assembly.3mf with default merging writes an STL file that combines all meshes and returns a summary whose triangles total 32 and whose bounding_box spans both parts ((0.0, 0.0, 0.0), (40.0, 20.0, 10.0)). @test
  • Exporting the same file with include=["Clip"] writes an STL containing only the Clip mesh, returns a summary with triangles 8, and leaves existing files at other paths untouched. @test

Implementation

@generates

API

from typing import Iterable, List, TypedDict, Tuple

Point = Tuple[float, float, float]
BoundingBox = Tuple[Point, Point]

class MeshSummary(TypedDict):
    name: str
    triangles: int
    bounding_box: BoundingBox

def summarize_3mf(path: str, *, recalc_normals: bool = True) -> List[MeshSummary]:
    """Load every mesh in a 3MF file and return ordered summaries with triangle counts and bounding boxes."""

def summarize_filtered_3mf(path: str, include: Iterable[str], *, recalc_normals: bool = True) -> List[MeshSummary]:
    """Return summaries only for meshes whose names appear in the include list, preserving file order."""

def export_stl_from_3mf(
    source_path: str,
    destination_path: str,
    *,
    include: Iterable[str] | None = None,
    merge_meshes: bool = True,
    recalc_normals: bool = True,
) -> MeshSummary:
    """Write an STL derived from the 3MF contents (optionally filtered/merged) and return a summary of what was written."""

Dependencies { .dependencies }

numpy-stl { .dependency }

Provides 3MF mesh ingestion and STL writing support.