Marc Dunand
WorkCVAboutContact
1 / 5
Major Works AnyHersheyWater ClockInk DripCDMScribblerBlick TypologyGenTruchetBall and LineLightsailWhat We Share Experiments CandleshiftDouble-Ended DrawingHow Do We See Art?Seven Days of DrawingEmotion Data PostcardThe 1x1080p DisplayFlockfinderSpirograph²JeremiahTDF3sLook Down
Major Works
  • AnyHershey
  • Water Clock
  • Ink Drip
  • CDM
  • Scribbler
  • Blick Typology
  • GenTruchet
  • Ball and Line
  • Lightsail
  • What We Share
Experiments
  • Candleshift
  • Double-Ended Drawing
  • How Do We See Art?
  • Seven Days of Drawing
  • Emotion Data Postcard
  • The 1x1080p Display
  • Flockfinder
  • Spirograph²
  • Jeremiah
  • TDF3s
  • Look Down

Spirograph², 2024

Pen plot: Recursive spirals that interleave horizontal and vertical branches

Spirograph² is a generative pen plot of branching spirals, inspired by the way mycelia grow. Every mark in the drawing is a half circle. I wrote a recursive algorithm in Processing that chains half circles into spirals and grows new branches off of them at right angles, interleaving horizontal and vertical lines of spirals as it spreads across the page. The drawings are plotted in pen with an Axidraw.

Behind the Project

I made Spirograph² in 2024 for Golan Levin’s Drawing with Machines course at Carnegie Mellon. The drawing is made by a single recursive function in Processing that only draws half circles.

How it works

The function works along a straight line. Given a stretch of line, it picks a new point partway along it and draws a half circle from the start of the stretch to that point. The first stretch runs horizontally across the middle of the page.

Diagram: a dashed line from start to end, with a half circle drawn below it from the start to a new point 70 percent of the way along

To keep these diagrams readable, the new point always lands 70 percent of the way along.

From the new point, the function calls itself twice, and both of the new half circles go on the opposite side of the line from the first one. One call heads back toward the start of the stretch, and the other heads on toward the end.

Diagram: two smaller half circles above the line, both starting at the new point, one reaching back toward the start and one on toward the end

Each of those calls does the same thing again, and so on, until the stretches are less than 3 pixels long. If you follow only the calls that head back, each half circle is smaller than the one before it and sits on the opposite side of the line, so together they curl into a spiral (dark, below). The calls that head on start new spirals further along, which is where the chain of smaller spirals along the line comes from.

Diagram: the full line of half circles, with the chain of calls heading back highlighted as a single spiral

A half circle can also start a branch. The branch starts at the top of the half circle and runs straight away from the line, and the function fills it in the same way, just turned 90 degrees. Branches off a horizontal line are vertical, and branches off a vertical line are horizontal again. This back and forth between horizontal and vertical is what I mean by interleaved. The bigger the half circle, the more likely it is to branch, so big ones almost always do and small ones rarely do.

Diagram: a vertical branch growing down from the top of the first half circle, and a horizontal branch growing off the vertical one

Only one branch is shown. In the sketch, every half circle gets a chance to branch.

Two variants

The repository has two variants of the sketch, v2 and v3. Both use the same base algorithm but implement parts of it differently. I wrote them while working out how to get the most beautiful drawings out of it. They differ in three ways:

Where the new point lands. In v2 it can land anywhere along the stretch. In v3 it always lands between 50 and 90 percent of the way along, so each half circle in a spiral is between half and nine tenths as wide as the one before it, which makes the spirals more regular.

How far branches reach. A branch ends 1.4 times the width of its half circle away from the line in v2, and 1.15 times in v3.

How often branches happen. The branching chance in v3 is double the one in v2, so more of the medium and small half circles branch.

Output of v2: irregular chains of spirals with branches spreading across the page
v2 output
Output of v3: more regular spirals nested inside larger circles
v3 output

The sketch saves each drawing as an SVG. The canvas is 1056 x 816 pixels, which is a landscape 11 x 8.5 inch sheet at 96 pixels per inch. I plotted the drawings on an Axidraw.

The source code for both variants is on GitHub.

marcdunandc at gmail dot com instagram.com/marccdunand linkedin.com/in/marc-dunand-cmu github.com/MarcDunand openprocessing.org/@u310940