Video: http://pyvideo.org/video/3379/from-code-to-coffee-table-with-blender
I've been developing a Python library for turning 3D models into CNC-machinable parts. In this presentation I demonstrate the basics of the library and how I used it to build a wood coffee table.
Developer Data Modeling Mistakes: From Postgres to NoSQL
From Code to Coffee Table with Blender and Sly
1. From Code to Coffee Table
with Blender and Sly
Matt Meshulam
ChiPy 2015-03-12
2. About Me
By day - Developer Experience at
Member of Pumping Station: One
Side projects involving electronics, music,
woodworking, Python, cooking, visual art
8. Conception
CNC enables novel construction methods
that require unique, high precision parts.
Fabrication tools exist, but what about
upstream design tools?
I want a new coffee table.
9. Fabrication Software
● Vectric VCarve -
Convert vector images
to G-code toolpaths
● ShopBot software -
Calibrate axes and run
G-code on the ShopBot
G-code (yuck!)
16. Autodesk 123D Make
:-)
● Free
● Designed for CNC
construction
● Many cool built-in
features
:-(
● Unstable
● GUI only
● Hard to extend
17. A better design tool?
● Artistic/exploratory workflow
● Precise and reproducible operations
● Output in a useful format (2D vector
shapes)
● Aware of physical 3D concepts (e.g.
intersection)
22. bpy - Main Blender Python module
Programmatic equivalent of the GUI
Highly imperative - Operations apply to the
global selection context
Great for macros/automation, not for
complex apps
32. Introducing Sly
A Python library for 3D construction from 2D parts
Uses Blender for I/O, but fairly decoupled
Only ~350 SLoC
33. Two core concepts
Slice - A 2D polygon (with thickness)
positioned in 3D space.
Cut - Material to be removed from a slice so
it can interlock with another slice
44. Sly implementation (cont’d)
Shapely - http://toblerity.org/shapely/
● Great polygon library
● GIS-focused but general purpose
● Support for geometric operations:
intersections, unions, etc.
● Slices use Shaply polygons internally
45. Sly Roadmap
● Installer, tests, docs
● Command line operation
● Better Blender GUI integration
● Smart slice placement
● Output to G-code?
● Different construction modes?
46. Want more?
In-depth sessions at PS:1 starting in April, email me to
get notified: matt@meshul.am
Contribute on GitHub: github.com/meshulam/sly