Cutting with Code

2026-01-30. Filed in twoville, talks.

Following are the notes from a workshop I gave at 2026 Fab Educators Summit.

Hi, folks. I am a computer scientist who likes the physical world as much as the virtual world. I grew up with a father who had every tool imaginable in his shop. But I gravitated toward brain tools, like math and code, because I felt that they were more learnable. They had an explicit notation. They were forgiving. They could be edited. They consumed time but not money. They made mistakes cheap.

As an adult and professor of computer science, I now try to unify the physical and virtual worlds. One way is through Twoville, a programming language and development environment that I've made for designing real objects. I've been offering workshops with Twoville in my community for about six years now. At least 500 middle and high school students have used it to make stickers, greeting cards, T-shirts, and laser-cut sculptures, all of which were born on the computer but don't die there.

My goal today is to share Twoville with you. I will demonstrate how to use it and give you the chance to try it out with me around to cheer you on. 45 minutes isn't a lot, however, so I'm going to keep things moving.

Twoville's core mechanic is code. I recognize that not everyone loves code. I encourage you to give it a shot and see that Twoville also allows you to use more than just disembodied cognition.

Frankenshape

For our first activity, we'll make a frankenshape—which is a composite shape made out of simpler shapes like rectangles and circles. Here's how to make these simple shapes in Twoville:

As in Python, the indentation matters. These properties belong to the shapes, and we show it through indentation. We also name almost everything. In a Twoville program, we should know what numbers mean. We wouldn't get that with circle(4, 0, 2).

When I lead a workshop with Twoville, I try to break each activity into three stages: draw, measure, and code. Trying to do all three mental activies at the same time usually fails. By separating them, code becomes more like translation than design work. Today, however, we have only a short time together, and I've gone ahead and drawn a shape. Your challenge is to code up this capybara:

Write your code in this template, in which I've included a starting circle and rectangle for reference:

Once we have a design, we export it to an SVG file in the panel. Then we load that in Silhouette Studio or Cricut Design Space or whatever fabrication software we're using. If we want to join all the black shapes and subtract all the white shapes, we add matte = :silhouette at the top level of the code.

Polygon

Two important concepts in computational design are repetition and parameterization. Let's see both in Twoville by modeling a hexagonal nut. We sample a circle at 60-degree increments to form the hexagon:

This repetition can be more elegantly expressed as a loop. We also a fillet to round off the corners a bit and subtract away a circular hole:

Here's a challenge for you: put your cursor in the circle code and then drag on the radius handle. What do you notice as the circle gets really big? What could we do to fix it?

Bézier Curves

For our final shape, let's make a diamond icon—like you'd see on a playing card. We could use a polygon for this, but diamonds tend to have a little concavity to give them style. That's something we can achieve with Bézier curves. You've likely used these in vector graphics programs before, and they've probably felt like magic. I understand them a lot better after working with them in Twoville.

Let's start by drawing just one of the four edges using the figure command:

A Bézier curve is a line segment with a black hole nearby that sucks the line segment toward it. That black hole is a control point. Quadratic Bézier curves have one black hole. Cubic have two. Here we replace the line with a quadratic node, which has an additional control property:

We could add three more quadratic nodes to complete the icon, but they'd all be independent. If we adjust one, we lose the two-fold symmetry. A more elegant option is to add a couple of mirror nodes. For each we pick a point and an axis about which to mirror. We end up with this diamond:

Conclusion

That's Twoville. It's my vehicle for making things with both computation and one's aesthetic sense. It's also my vehicle for sharing computational making with the students in my community. Anyone can access it for free. There is no account system by design. Tutorials are available in the Learn tab. If you're looking for a platform that combines math, programming, and fabrication, then we've got the same dream. I'm here to support you.