Make something
Email yourself a 10% off coupon
Send
Coupon sent! Check your email
This will be 3D printed near you and delivered to your door by May 05
Loading

A script written in Python (version 2.7) for reading as ASCII PGM file, and then writing an STL "surface" from it. After playing with the PGM to OpenSCAD surface script, I was disappointed to find that OpenSCAD would not create the STL files for images larger than about 200 pixels square. So, I did what any hack programmer would do, I wrote my own script to bypass OpenSCAD and go straight to an STL file! Voila!You need to have an installation of Python version 2.7 (it will probably fail to run on version 2.6, sorry), with Tkinter. Use a photo editor like IrfanView or ImageMagick to convert a photo to PGM format, but make sure it is in ASCII format! The STL file will be a mirror image of the PGM. You can plan accordingly. Set the "relief" value (1 to 5) depending on your purpose for the STL file. A value of 5 gives "high" relief, but might be too high for some purposes. Caveat: STL files will be LARGE! A photo that is 253px by 313px is processed into a 7.6MB STL file with 79,000 vertices and 157,000 faces! I've successfully created an STL of 158MB with over 1.5M faces, but it takes a long time to convert. MeshLab reads the output files well. I have not yet printed a STL file made with this utility. I will try to post a picture of my first success with that.

PGM to STL via Python
Please wait while we prepare the order
$ 0.00 + free delivery
Sorry we had trouble getting the 3D files. Download them yourself and upload them here to place an order.
View files
  • 0 inches x 0 inches x 0 inches
  • this product is 3D printed
  • 16 available colors
  • material is a strong plastic
  • free delivery by May 05
  • 0 parts
Delivery address
This field is required.
This field is required.
Please enter a valid email.
This field is required.
This field is required.
This field is required.
This field is required.
This field is required.
Pay with credit card or debit card
or pay with
Place order
Order summary
PGM to STL via Python
Color:
Quantity:
Subtotal
$
Delivery (May 04 - May 06)
Free
Total
$