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

Mesh Pose Toolkit

Reposition STL meshes through axis-angle rotations, reusable rotation matrices, translations, and homogeneous transforms.

Capabilities

Axis-angle rotation

  • Rotates a mesh around a provided axis by a radian angle, honoring an optional pivot point; for a single triangle with vertices [[0,0,0], [1,0,0], [0,1,0]], a +pi/2 turn about the Z-axis around the origin yields vertices approximately [[0,0,0], [0,1,0], [-1,0,0]] with its normal rotated accordingly. @test

Matrix-based rotation reuse

  • Applies a supplied 3x3 rotation matrix to mesh vertices and normals while honoring an optional pivot; two identical meshes rotated with the same matrix (90 degrees about the X-axis) end with matching coordinates and normals, demonstrating reuse without recalculating the matrix. @test

Recentering translation

  • Translates a mesh so its geometric center matches a target point without changing normals; a rectangular plate spanning min [1,1,1] and max [3,3,1] moves to center on [0,0,0], producing min [-1,-1,-1] and max [1,1,-1]. @test

Homogeneous transform

  • Applies a single 4x4 transform that combines rotation and translation; with a matrix that rotates 90 degrees about the Y-axis and translates by [1,2,3], an L-shaped mesh with vertices [[0,0,0],[1,0,0],[0,1,0]] ends with vertices [[1,2,3],[1,2,2],[1,3,3]] and the normal rotated to point along +X. @test

Implementation

@generates

API

from __future__ import annotations
from typing import Sequence
import numpy as np

class MeshPose:
    def __init__(self, mesh) -> None: ...

    def rotate_axis_angle(self, axis: Sequence[float], radians: float, pivot: Sequence[float] | None = None) -> None: ...

    def apply_rotation_matrix(self, matrix: np.ndarray, pivot: Sequence[float] | None = None) -> None: ...

    def recenter(self, target_center: Sequence[float]) -> None: ...

    def apply_transform(self, matrix: np.ndarray) -> None: ...

Dependencies { .dependencies }

numpy-stl { .dependency }

Load and mutate STL meshes, updating vertices and normals.