Languages: English | Français | All languages
A simulator/testbed for Spirograph inspired drawings. Multiple gear layers, multiple traces per layers, "Super Spirograph"-inspired custom tracks. Configurable gear sizes, path offsets, colors. Save/export designs to JSON, PNG and SVG.
SpiroSim ships with a localisation system for UI strings. Use Options → Language to
switch languages, and see localisation.md for the translation file
format plus instructions on adding a new language to the program and repository.
- Ensure you have Python 3.10+ installed.
- (Optional) Create and activate a virtual environment:
Or with Conda/Miniconda:
python -m venv .venv source .venv/bin/activateconda create -n spirosim python=3.10 conda activate spirosim
- Install the GUI dependency:
python -m pip install PySide6
Launch the main application:
python SpiroSim.pyThe main window renders the drawing and exposes the following menus and dialogs.
- Load settings (JSON): import saved layers, paths, colors, and track settings.
- Save settings (JSON): export the current configuration.
- Export as SVG: save vector output of all visible layers.
- Export as high-res PNG: save a raster export at a specified resolution.
- Quit: exit the application.
- Manage layers and paths: open the layer/path manager to build your design.
- Background color: set the canvas background (CSS4 name, hex, or HSL tuple).
- Canvas size and precision: set output width/height and points per path.
- Language: switch the UI between French and English.
- Animation: toggle the animation controls below the canvas.
- Show track: toggle rendering of modular track centerlines in the preview.
- Regenerate drawing: recompute and refresh the drawing.
- Manual: open the localized README for the current language.
- About: show version and license details.
When animation is enabled, controls below the canvas allow you to start/pause/reset the preview and change the animation speed (points per second, including instant mode).
A layer represents one gear setup and can contain multiple paths (traces). Each path is drawn from the same gear motion but with its own pen hole, phase, color, and stroke width.
When you edit a layer in the manager, you can configure:
- Name: label used in exports and the layer list.
- Visible: toggle whether the layer is rendered.
- Layer zoom: scales all paths in the layer together.
- Layer translate/rotate: offset and rotate the entire layer.
- Number of gears (2 or 3): choose between a 2-gear or 3-gear system.
Each layer has 2 or 3 gears. Gear 1 is stationary (the base ring or modular track), and gear 2 (and optionally 3) are moving gears. For each gear, you can configure:
- Name: label displayed in the manager.
- Type:
ring,wheel,triangle,square,bar,cross,eyemodular(modular track base, only allowed for Gear 1)
- Size (wheel / inner ring): size for the wheel or inner ring.
- Outer size (ring): outer size for ring-type gears.
- Relation:
stationary: only valid for Gear 1 (fixed in place).inside: wheel rolls inside the ring (hypotrochoid).outside: wheel rolls outside the ring (epitrochoid).
- Modular track (notation): only shown for Gear 1 when type is
modular. This uses the custom track notation described below. Use the … button to open the modular track editor.
Each path defines how the pen is placed on the moving gear:
- Name: label displayed in the manager and exports.
- Hole offset: radial hole offset on the moving gear (distance from center).
- Phase offset (track units): phase shift applied to the pen position.
- Color: CSS4 name,
#RRGGBBhex, or(H, S, L)HSL tuple. - Stroke width: line width in the preview and exports.
- Path zoom: scales only this path (multiplicative with layer zoom).
- Path translate/rotate: offset and rotate the path relative to the layer.
If Gear 1 is a modular track with a valid notation, the manager enables Test path to preview the track geometry and wheel motion.
The layer manager lets you add, edit, reorder, enable/disable, and remove layers or paths. It also includes bulk enable/disable for all paths in a layer.
Tracks are defined by a compact algebraic notation made of blocks, written as
letter + number pieces separated by operators +, -, or *. Whitespace is
ignored, and the entire string is case-insensitive.
To keep spirosim/_version.py in sync after each pull, checkout, or rebase,
install the GitVersion tool and enable the repository hooks:
dotnet tool restore --tool-manifest .config/dotnet-tools.json
python scripts/setup_git_hooks.pyThe hooks run python scripts/update_version.py automatically, which calls
GitVersion and rewrites spirosim/_version.py with the latest fullSemVer
and shortSha values.
+/-: sets the turn direction (left/right) for the next piece.*: jump to the next open branch created by ayorbpiece.
An initial optional + or - sets the default turn direction for the first
piece. A leading * jumps to the first open branch.
aNN: arc ofNNdegrees. The sign (+/-) determines left/right turn.dNN: straight segment ofNNunits.b: rounded end (half-circle) connecting the two sides of the track.y: triangular junction composed of three 120° arcs spaced by the track width.nNN: origin offset in units, applied in the direction of the current sign.oNN: origin angular offset in degrees, applied with the same sign convention.
NN can be an integer or a decimal value.
+a90-d40+b*a90
This builds a 90° left arc, a 40-unit straight, a rounded end, then continues on the next branch with another 90° left arc.