By · Updated

Spirograph Generator

Hypotrochoid and Epitrochoid Curves, Free PNG

No ratings yet

Loading…

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Spirograph Generator works

This spirograph generator draws curves from rings and gears. The toy had a fixed ring, a small gear with holes in it and a pen. Here the ring and gear are tooth counts and the pen offset is a slider, and the page plots the curve until it comes back to its start. Small changes to the gear ratio give completely different flowers, and every one can be saved as a PNG.

Spirograph generator: what it does and why

A spirograph curve is traced by a pen fixed at some distance from the centre of a gear that rolls around the inside or outside of a ring. Rolling inside gives a hypotrochoid, the familiar looping flower; rolling outside gives an epitrochoid, which bulges outward and looks more like a crown. The three numbers that define the curve are the ring size R, the gear size r and the pen offset d, all in the same units. The toy expressed them as tooth counts, so the sliders here do too.

How many loops. The pen returns to its starting point after the gear has gone around the ring r ÷ gcd(R, r) times, where gcd is the greatest common divisor. The stats line shows this number. R = 96 and r = 56 share a factor of 8, so the curve closes after 7 loops and has 12 lobes. Change r to 55, which shares no factor with 96, and it needs 55 loops to close and fills the ring almost solid. Pick tooth counts with a large common factor for a simple shape and coprime counts for a dense one.

Pen offset. At d = 0 the pen is at the gear's centre and draws a plain circle. As d grows the lobes get pointier, then at d = r the curve has cusps, and past that it develops loops at each lobe. The classic toy only allowed d less than r because the holes were inside the gear; this page allows more.

Colour. Rainbow shifts the hue along the length of the curve, so you can see where the pen was early and late. Single picks one hue from the seed. Regenerate changes only the colour; the shape is entirely determined by the sliders, which is what you want when tuning it.

Export. The curve is scaled to fit the shorter side of the export, so a 4K desktop export and a phone export both contain the whole figure, centred.

FAQ

What are the classic toy's numbers?

The original set had rings of 96 and 105 teeth and wheels of 24, 30, 32, 40, 42, 45, 48, 52, 56, 60, 63, 64, 72, 75, 80 and 84. Try ring 105 with wheel 42 or 63 for the shapes on the box.

Why does my curve look like a single circle?

Either the pen offset is near zero, or r divides R exactly so the curve closes after one loop. Raise d or pick a gear that does not divide the ring.

Why does the picture go solid?

Because the tooth counts are coprime and the curve needs dozens of loops to close. That is correct behaviour, and often pretty at a low line weight, but if you want distinct lobes choose R and r with a common factor.

Are these the same as Lissajous curves?

No. A Lissajous figure is two sine waves at right angles, which gives a quite different family of shapes. There is a separate generator for those, and one for harmonograph curves, which add damping.

See also: all Generative Art tools, Images, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools