Skip to content

Library for creating, visualizing and exporting [.stl files] 2D and 3D shapes

License

Notifications You must be signed in to change notification settings

sumanan047/pistl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Library for creating, visualizing and exporting [.stl files] 2D and 3D shapes

Topics

Resources

License

Stars

Watchers

Forks

Languages