Skip to main content

Library to make reading, writing and modifying both binary and ascii STL fileseasy.

Project description

Simple library to make working with STL files (and 3D objects in general) fast and easy.

Due to all operations heavily relying on numpy this is one of the fastest STL editing libraries for Python available.

Requirements for installing:

  • numpy_ any recent version

  • python-utils_ version 1.6 or greater

Installation:

pip install numpy-stl

Initial usage:

  • stl2bin your_ascii_stl_file.stl new_binary_stl_file.stl

  • stl2ascii your_binary_stl_file.stl new_ascii_stl_file.stl

  • stl your_ascii_stl_file.stl new_binary_stl_file.stl

Quickstart

from stl import stl

mesh = stl.StlMesh('some_file.stl')
# The mesh normals (calculated automatically)
mesh.normals
# The mesh vectors
mesh.v0, mesh.v1, mesh.v2
# Accessing individual points (concatenation of v0, v1 and v2 in triplets)
mesh.points[0] == mesh.v0[0]
mesh.points[1] == mesh.v1[0]
mesh.points[2] == mesh.v2[0]
mesh.points[3] == mesh.v0[1]

mesh.save('new_stl_file.stl')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numpy-stl-1.1.0.tar.gz (7.5 kB view details)

Uploaded Source

File details

Details for the file numpy-stl-1.1.0.tar.gz.

File metadata

  • Download URL: numpy-stl-1.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for numpy-stl-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a0b0dd20a8ffd566bba9136c076d8d4effa338b2769019f27e3f728ce435fd9f
MD5 2d39890e39e6db159582a822afb309b2
BLAKE2b-256 9f3d67ccd7f440f8ffed21bb71aebd69c4d6a42e900a0bfe7aea07d7f020c8f4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page