Skip to main content

Python library to generate STL format files for common shapes and geometries.

Project description

PISTL (pronounced as "Pistol")

Pystl_cover_image

About the figure above: Multiple shapes generated using PISTL as STL file and visualized in Meshmixer for the purpose of this picture. The visualization in PISTL can be done using pyvista, which is installed as a dependency._

What is PISTL?

PISTL is a small (micro) library that can be used in python to programatically create stereolithographic (stl) files of regular geometric shapes like circle, cylinder, tetrahedron, sphere, pyramid and others by morphing these shapes. pystl also provide functions that can be used to translate and rotate these stl objects.

In summary: PISTL can be used for the following purposes:

  • to create simple geometric shape files in .stl format.
  • visualize this stl files. [PySTL uses pyvista for such visualizations].
  • perform simple transformations like translate, rotate and scale shapes.

Examples

# This example creates a sphere stl using pistl

# step 1.0: import PySTL
import pistl
from pistl import shapes

#instantiate a sphere shape
sphere = shapes.Sphere()

# set the radius of the sphere
sphere.radius = 10

# set resolution of the sphere in longitude and latitude
sphere.resolution_latitude = 200
sphere.resoultion_longitude = 200

# once you have set the radius and resolution, call create method
sphere.create()

# call export method to set stl filename and shape name
sphere.export('Results/sphere.stl', 'sphere')

# Finally visualize the shape in trame window or in a jupyter kernal using the visualize method.
sphere.visualize().plot(color='magenta', text=f'{sphere.name}')

Pystl_generated_sphere_stl

PISTL is an open source project that welcomes contributions from developers from diverse community and backgrounds._

contact : sumanan047@gmail.com to get added on the project formally.

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

pistl-1.2.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

pistl-1.2.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file pistl-1.2.0.tar.gz.

File metadata

  • Download URL: pistl-1.2.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.9.12 Darwin/23.6.0

File hashes

Hashes for pistl-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c21092cd5423e1a0c0cf94da14b087912a5a39e1337b13faaeee2e6be9aba896
MD5 eb74740b4627aa6852f36af6c2619be7
BLAKE2b-256 50acd2da3d8d389688ee4f03ac1c07ce6b5030fb7dfd310fad87d050971a3954

See more details on using hashes here.

File details

Details for the file pistl-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pistl-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.9.12 Darwin/23.6.0

File hashes

Hashes for pistl-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ee004f656c529c882ab5974851dfc03e0eec64d564c1690641fb350950cd27b
MD5 e2ee51ae57668821144fec8a2ecdef70
BLAKE2b-256 d05405373c4fc583dd2762a0041c7043bdc1c1eab7427f7712881ba9bdebf113

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