coudre

Printed L-Systems

L-Systems and Turtle Graphics

An L-System (or Lindenmayer System) is a mathematical and computational method that can generate complex behavior from very simple rules, usually used to simulate plants and fractal growth.

L-Systems are comprised of a collection of symbols, a subset of which is the initial "step" (axiom), and a series of rules that indicate how to recursively substitute these symbols for others once encountered.

For example, for an L-System comprised of symbols A and B, rules A = BA and B = A, and axiom A, the iterations produced would be as follows:

  1. A
  2. BA
  3. ABA
  4. BAABA
  5. ABABAABA
  6. ... etc.

These symbols do not need to be letters. For instance, they can be mapped into actions. Turtle Graphics is the interpretation of an L-System's output into graphics, by way of assigning different movements or commands to symbols in the L-System, that a "Turtle" or imaginary robot will implement. These commands allow the Turtle to do things like rotate, jump, or walk while drawing a line in the space, producing graphical results (or, in our case, printer movements).
As a simplified example, + could stand for "turn counterclockwise", - for "turn clockwise", F for "walk forward while drawing a line (or extruding material)", f for "jump forward without drawing a line", and so on, including turning commands for the two other axis if the Turtle is to navigate in 3D space. Symbols/commands can even be functions with their own inputs, such as the distance to be walked or the degrees to turn if they are not default.

In this way, many iterations of shape growth can be encoded in the small amount of data needed to store the L-System's rules and axiom.

For a complete explanation of L-Systems and Turtle Graphics, including other common Turtle Graphics commands, we recommend consulting the freely available book The Algorithmic Beauty of Plants, by Przemyslaw Prusinkiemicz and Aristid Lindenmayer.

Our exploration

L-Systems have been mostly used to generate 2D and 3D shapes that are not meant to be 3D printed.

Screenshot showing 3 generations of digital shrub-like shapes, each appearing to have grown larger.

Different iteration stages of a 3D plant, encoded by an L-System and generated using Rabbit, a plugin for Grasshopper. These shapes are not self-sustaining.

We developed software (in the Processing programming language) and a workflow that are able to generate different L-Systems which, when interpreted through Turtle Graphics, produce self-sustaining shapes that do not collapse when 3D printed with clay. Unlike the usual 3D printing methods, the Turtle Graphics' output is not a 3D model to be later translated into machine code; the Turtle commands are directly translated into G-code commands, which is the language that most CNC machines (such as 3D printers) are controlled with.

Screenshot showing code.

The raw program in the Processing developing environment served as our sole interface. Although we generated a crude preview of the final Turtle path, we could design shapes without a graphical output.

The digital, weightless paths generated don't translate directly into the same shape upon being printed; they gain the additional depth of the clay's extrusion volume and gravity. We were constantly reminded that the Turtle paths don't codify for shapes, but for printer gestures interacting with the extruded material. We came up with ways in which to harness the expressiveness of these gestures, which one cannot see in the usual 3D printing processes, such as rapidly pulling upwards from the extruded material to "cut" it, forming spikes.

3 porcelain pieces, all tubular, but with different degrees of coiling and spikiness in their texture.

Turtle Graphics do not need to be fed an L-System's output, they can be used alone to encode printer movement by hand. This method allows for quite precise control over the printer (as opposed to the generative quality of an L-System's results) without being as difficult to program as G-code. Turtle Graphics encourage an intuitive, more body-involved way of thinking about 3D printing: encoding prints in terms of a dance sequence, instead of spatial coordinates.

A 3D printer nozzle is in the process of extruding clay. The resulting tubular shape has a texture with multiple spike-like protrusions. A porcelain cylindrical piece with a texture resembling small, numerous nubs coming out in random places. Closeup of a piece's texture. The black clay layers are extruded with a mixture of spikes and looped curves. A porcelain piece with undulating vertical ridges. The workshop, full of 3D printers and open drawers, a picture of a kitten hung up on the wall, and Jude working. Closeup of spikes in a piece.

This piece is encoded by the following L-System rules, with a turning degree 20° for the Turtle:

  1. Axiom = P
  2. n P = -(32) S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - U P
  3. U = ^(90) f(3.5) &(90) F(3)
  4. S = F [ -(41.6) F(6.6) ^(80) f(20) ]