PyCon 2016 in Portland, Or
hills next to breadcrumb illustration

Monday 3:15 p.m.–4 p.m.

Laser Cutters, 3D Printers, and Python

Giles Hall

Audience level:


How to leverage python to generate physical, tangible things. We will discuss the basics of laser cutters, 3D printers, and how you can use python to design physical objects. After a brief introduction to these technologies, we will explore a few different examples of how we can use python to generate designs suitable for 3D printing and laser cutting.


Python is a wonderfully expressive language. It lowers the barrier between our imagination and implementation. Most of the code a programmer writes, however, stays locked inside a computer, pulling data in, pushing data out, and rarely generates results that are literally tangible. With the advent of cheap, sophisticated 3D printers, laser cutters, and CNC machines, many enthusiasts are capable of using their home computer to make physical objects. While most designs are built with graphical tools, Python is the great alternative to generating customizable, build-able designs. After a brief introduction to laser cutters and 3D printers, how they work, and the types of file formats used to control them, I will focus on two simple example python projects, one for each technology. For laser cutters, I will demonstrate how to use python to design a wood box with finger joins. We will examine the geometry of a single face and discuss how to translate its geometry into code. Once we establish the geometry of the box in python, we will add parameters to the design to make our box customizable. 3D printing is more complicated, since it adds a dimension to our designs. After an initial discussion about how 3D data is expressed, and how 3D printers use this data to generate objects, we will side-step the complexity of describing 3D data with triangles by leveraging OpenSCAD. OpenSCAD is a programming environment in its own right, but its language is simple and lacks much of python's elegance and sophistication. I will demonstrate how to drive OpenSCAD with python. Much like the laser cutter tutorial, we will model a simple object, a flower pot, using python. We will break down its geometry and learn how to express it in terms of primitive solids. From there, I will show how we can customize our flower pot script with different parameters. I will also show two more python examples that are more sophisticated, to help catalyze your imagination. The first is a [snowflake generator]( that generates diverse snowflakes for laser cutting. The second is a [model-rocket generator]( that builds customizable, ready-to-fly model rockets for 3D printing. If you don't own your own 3D printer or laser cutter, no problem! I will explain how to gain access to these tools through your public library, maker spaces, and services like Shapeways. Feel free to browse the [supplemental page]( for more information.