OpenSCAD User Manual/Example/Strandbeest
Abstract
Translating the Dutch word "strand" and "beest" literally into English gives us the clues "beach" and "beast", but is better read as "beach animal". Theo Jansen has been creating self-propelling machines for many years, testing them on the beaches facing the North Sea. The key element of his designs is the stepping motion of the beasts' legs. It raises the foot as it moves forward, places it on the sand where it braces against the pressure in the upper leg that presses the body of the beast forwards, and then repeats. The legs are paired so that one has its foot on the ground while the other is moving forwards, and multiple lets are joined in a gang to ensure stability as the beast roams over the uneven terrain of a beach.

OpenSCAD can help to understand the operation of a complex mechanism like a strandbeest by animating it.
The model is not meant for 3D-Printing.
The source code is a single file and uses no included libraries. Originally developed using OpenSCAD version 2015.03 the code is still working in the 2025 Development version.
Prerequisites
Only a basic understanding of using OpenSCAD is needed to copy-paste the code into the app.
To understand how the calculations are done in the math functions requires a good knowledge of geometry, trigonometry, and mechanics ... but is not necessary to manipulate the animation.
The most important mathematics has to do with the arc-tangent function and the Law of Cosines which are used in VVLL2D function, where the name derives from Vector Vector Length Length (in) Two Dimensions. Most math libraries provide two versions of the arc-tangent function, atan() and atan2() and are fully explained in the Wikipedia article on atan2. Arc-Tangent returns an angle given a value representing the ration between sides of a triangle. The difference between the two version is how they handle the mathematical impossibility of dividing by zero.
This is a good article on the numeric implementation of Law of Cosines.
Mathematically the issue is that the arc-tangent can have either no solution, or two solutions, depending on the relative lengths of the two arms of the linkage. The mechanical implementation of the math reflects this in that a linkage of two rotating arms, one driving and the other driven, has at least one position where it locks. The good news is that careful adjustment of the real-life structure can avoid the locking position ... and this is how the years of trial and error work by Theo resulted in "the constants" that specify the particular linkage the gives the stepping action needed to move a strandbeest along a beach.
Development of the Linkage Geometry
Other sources may be consulted for the full story of the years Theo Janssen has been working on his Strandbeest ideas. He has built several beasts and many of them share the complex linkage of the legs modeled by this program. The leg is anchored by a fixed rod (X-Y in the following) that has rotating points at each end. The driving power is applied by a crank at Point X causing the linkage to move according to the constraints imposed by the lengths of its movable rods. The lengths of the rods are were derived by trial and error testing after an initial structure was calculated and are referred to as "the constants".
First of all, we need a drawing with the constants.
Theo Jansen has published the numbers on his website: (Video "The Legsystem", 3:36) or on archived version the webpage:

I suggest to name the points. The naming can be arbitrary. I have used Z..S to avoid confusion with the lengths a..m.

It can be very helpful to print out the drawing to scribble on.
Construction by hand
Now we have to think about how we could construct the mechanism by hand.
We need a non collapsible compass, a ruler, paper and a pencil.
- non collapsible compass and ruler
We set the origin Z to an arbitrary point. For Y, we are going down l and a to the left. The crank m can be at an arbitrary angle. Drawing the crank results in the point X.
From this point, we construct triangles that are defined by two points and two lengths.
In geometry, this is the SSS case (constructing a Triangle with three sides given, see also Solution of triangles#Three sides given (SSS)).
On paper, this can be easily solved using a compass.
Let us start with setting the compass to length b and then putting the compass in point Y. Then we set the compass to the length j and put the compass in point X. The crossing point of the arcs is the point W.
Note that when two points and two lengths are given, there are always two solutions, speak crossing points. Given that we already know the general shape of the mechanism, we know which one we need. But keep it mind for later.
The rest is more or less "rinse and repeat".
Geometric Construction Instructions
Conventions
- lengths are written in lower case
- point are written in upper case
- lines and arcs used for construction have a '
Instructions
- construct point Z
- draw a horizontal line h
- draw a vertical line v crossing the horizontal line h
- mark point Z where the h and v cross
- that will be the origin of this construction and crank axis of the leg mechanism
- construct point Y
- draw a horizontal line h' distance l down from h
- draw a vertical line v' distance a left from v
- label the crossing point of h' and v' as fix point Y
- construct point X
- draw a line m' trough Z add an arbitrary angle (the angle is the crank angle)
- draw an arc from point Z with radius m, the crossing point of arc n and Point Z is crank pivot X
- draw line m from Z to X
- construct point W (SSS case)
- draw an arc j' from point X with radius j
- draw an arc b' from point Y with radius b
- the crossing point of arc j' and b' is point W
- draw line j from X to W
- draw line b from Y to W
- construct point V (SSS case)
- draw an arc e' from point W with radius e
- draw an arc d' from point Y with radius d
- draw line e from W to V
- draw line d from Y to V
- the crossing point of arc e' and d' is point V
- construct point U (SSS case)
- draw an arc c' from point Y with radius c
- draw an arc k' from point X with radius k
- draw line c from Y to U
- draw line k from X to U
- the crossing point of arc c' and k' is point U
- construct point T (SSS case)
- draw an arc f' from point V with radius f
- draw an arc g' from point U with radius g
- the crossing point of arc f' and g' is point T
- draw line f from V to T
- draw line g from U to T
- construct point S (SSS case)
- draw an arc h' from point T with radius h
- draw an arc i' from point U with radius i
- the crossing point of arc f' and g' is point S
- this is the "foot" of the mechanism
- draw line h from T to S
- draw line i from U to S
given lengths
a=38.0 b=41.5 c=39.3 d=40.1 e=55.8 f=39.4 g=36.7 h=65.7 i=49.0 j=50.0 k=61.9 l= 7.8 m=15.0
Points
Z fix point, origin, crank axis Y fix point X crank axis W V U T S foot


Implementation
In all of the following math functions the inputs are [x,y] positions (v), distances or lengths (l) and angles in decimal degrees (ang):
- add2D(v1, v2)
- adds the two [x,y] position given to return a new position [x1+x2,y1+y2]
- sub2D(v1, v2)
- subtracts the second x-y vector from the first to return a new position [x1-x2,y1-y2]
- addAngle2D(v, ang, l)
- return a new
- getAngle2D(v1,v2)
- use atan2() to return an angle in degrees from the given positions
- scale2D(v,c)
- apply a scaling factor to the given position returning a new one
- length2D(v1,v2)
- return the length of the line between the two given positions
- VVLL2D(v1,v2,l1,l2)
- return an new [x,y] position calculated from the two given positions and lengths
The rod() module draws a rod and its endpoints
- module rod(v1,v2,t=6)
- draw a "rod" from v1 to v2 with thickness t
The leg() module draws all of the rods for one leg given the angle of the driving crank and the set of constants a to m.
The leg_pair() module uses the leg() and a mirror() operation to draw one leg of the pair touching the ground and the other raised to step forward.
The strandbeest() module then draws a group of three leg pairs for the left side of the beast, and then a second group of three for its right side.
Source
Exporting the animation
OpenSCAD can export the frames of animation into PNG files. This PNG files can under Linux be turned into a gif via command line:
convert -delay 10 -loop 0 *.png myimage.gif
Convert is part of ImageMagick.
The resulting GIF can then (if necessary) be cropped with GIMP.
Working With This Example
I recommend to split the source code into different files. One way to split it is:
- Trigonometry Function
- drawing function
- Jansen Mechanism / Leg
- Strandbeest
I would recommend to use "use". This allows you to include self tests with each file.
To prettify the animation, you can draw the axes connecting the legs and/or add a support frame.
If you have access to a 3D-Printer, you can modify the code, so that the connecting points can actually rotate.
Next when building the mechanism with a different method
Wrong Angle / Missing measurement / Tilt
- Strandbeest with correct dimensions
a = 38.0
l = 7.8
locus correct and grounded - Strandbeest with incorrect dimensions
a = 38.0
l = 0
locus extraged and tilted - Strandbeest with incorrect dimensions
a = 38.79
l = 0
locus correct, but tilted
Examples:
- Klann R & D, Joe Klann, Jansen Linkage - Klann Linkage Comparison
- Adam Savage's One Day Builds: Pedal-Powered Strandbeest!
Note that the examples are not to mock the creators for their mistake, but praising them for sharing their experience so that we all can learn from them.
This mistake is made more likely by speaking about the eleven[1][2] magic numbers instead of the 13 magic number.
(There are elven rods, but the two fixed points are a and l apart from each other)
Triangle
Traditionally, the leg is formed by just using rods:
When manufacturing from flat stock like paper or wood, realizing that that one leg can also be constructed from 2 triangles and 5 rods can simplify the assembly and make the mechanism more robust
here some practical examples:
- Leg mechanism made from card board
- Mini Strandbeest
Model ready for 3D-Printing
A fully-parametric strandbeest implemented in OpenSCAD, with assembly instructions, is available for 3D printing.[3]
Using Rod of the same length
f=39,4 and c=39,3 are so close in length, that using rods of the same length can simplify the assembly without affecting the gait to much.
Note that in practice, the whole mechanism as play and flex, undergrounds are not perfectly flat and lengths and holes have manufacturing inducted errors.
References
- ↑ https://ethanzuckerman.com/2007/03/08/theo-jansens-strandbeests/
- ↑ Linda Leinen (26 September 205). "Theo Jansen: Walking on the Mild Side".
- ↑ A. Matulich (23 May 2020). "Building the Strandbeest".