Kokopelli and antimony are parametric, comparative, implicit frameworks for computer-aided design that grew out of my master’s thesis at the MIT Center for Bits and Atoms – informed by previous work both there and in the broader research community – and were tested in the Fab Academy and the Machines that Make MIT class. At the moment, kokopelli is suitable for 2D and 3D modeling (and some even use it for PCB design!). It can export .pngs, .svgs, and .stls, and there’s basic built-in CAM for 2-, 3-, and 5-axis subtractive machining. Antimony, intended to be kokopelli’s spiritual successor, is experimental and under active development.
The kokopelli and antimony applications and source are available via Matt Keeter’s GitHub. Kokopelli is also available as a Mac application. All code examples shown here, including the ones with sliders and other graphical elements are included.
If you get nervous when trigonometry starts showing its ugly face, don’t panic! Understanding the underpinnings gives you more power to define your own shapes and transformations, but it’s not mandatory. It’s completely possible to design with the standard library of shapes or use a graphical interface created by a more advanced user (scroll to the bottom) without ever touching the math expressions at the heart of the design format.
Like OpenSCAD, but with Built-In CAM
Currently, kokopelli CAM paths can be exported to Universal and Epilog laser cutters, the Roland Modela mini-mill, three- and five-axis Shopbot machines, and plain G-code. A modular workflow makes adding new machines easy. The screenshot (above) shows kokopelli’s CAM interface doing path planning for a rough cut on a ShopBot.
These tools are built on an unusual solid modeling paradigm: objects are represented as mathematical expressions, not as collections of polygons and edges (similar to OpenSCAD). Each object is a function of x, y, and z; if the function evaluates to less than zero at a particular point in space, that point is inside the solid.. For example, a sphere of radius 1 can be represented as “f(x, y, z) = pow(x, 2) + pow(y, 2) + pow(z, 2) – 1″. This paradigm makes constructive solid geometry (e.g. unions, intersections, cutouts, blending) very easy. The downside is that some traditional CAD operations (like chamfering a particular edge) become tricky to express, because object features are implicit rather than explicit.
On top of this abstraction sits a geometry engine, coded in C and optimized for solving these expressions very quickly by using a handful of tricks to effectively find the zero crossings of the expression (which corresponds to the model’s surface). The geometry engine renders either height-maps or triangulated meshes, with support for dynamic re-meshing as the user moves the camera around the scene.
Kokopelli’s CAD system is built on this foundation. Instead of drafting and feature-based modeling, objects are designed as Python scripts. Many designers and creative coders are already familiar with Python, so the learning curve isn’t quite as steep as a domain-specific language. In addition, users have access to all of their favorite Python libraries.
The UI is inspired by Brett Victor’s “Inventing on Principle.” The left pane shows Python source code; the right pane shows the rendered model (either as a height-map, mesh, or both). The models are updated in real time as the code changes.
UI Elements: Sliders and More!
Models can also be parameterized by sliders and other interactive UI elements in the view panel. This allows more experienced designers to make template models that can be customized by less experienced users.
PARAMETRIC LIVING HINGE QUICKSTART
Into living hinges? Want to create your own custom CNC-able designs for multiple machining formats? Anna Kaziunas France created a short guide to creating and fabricating your own parametric living hinge with the built-in kokopelli example.
Antimony uses the same foundation as kokopelli but combines Python scripting with graph-based composition (similar to the Grasshopper extension for Rhino). Objects, transformations, and user-defined scripts are represented as nodes with a set of inputs and outputs. These nodes are drawn as interactive elements overlaying the rendered models; users can click-and-drag to change their properties. Designers then connect inputs and outputs into graphs representing operations on a set of primitives.
In practice, this is easier for novice users: they can get started by dragging-and-dropping primitives, then move into scripting when they need more sophisticated operations.
The Mac application and the Mac/Linux source for both antimony and kokopelli are at github.com/mkeeter/kokopelli) and include examples with graphical interfaces. To check out the included examples, after installing, use the kokopelli file menu to open a “.ko” file from the examples folder to get your CAD on.