gizmobench

Fractal Generator

Choose a branching tree, Sierpinski triangles or your own L-system rules, then generate the complete geometry in your browser. Adjust iterations, angle, model length, colors and output size. Read exact edge and triangle counts, reproduce a tree from its seed, and export SVG or PNG from the same fitted coordinates shown in the preview.

Fractal settings

Complete fitted drawing

Generate to view the complete drawing. No geometry is calculated automatically when settings load.

The same fitted coordinates drive this preview, SVG and PNG. The full geometry is centered with at least 24 output pixels of padding; there is no crop. The preview scales to the available screen width. Base length changes model units; automatic fitting can keep a self-similar shape visually the same size.

Drawing edgesPending
Filled trianglesPending
Expanded symbolsPending
PixelsPending

Tree level 0 has one trunk; each level adds two children at every tip, giving 2^(n+1) - 1 segments. The seed controls each branch angle variation within ±6° and child lengths from 67% to 77% of the parent. Sierpinski level 0 is one equilateral triangle; each level keeps three half-size corner triangles and removes the middle. Level n has exactly 3^n filled triangles and three edges per triangle. Sierpinski and L-system shapes are deterministic without using the tree seed.

Select a fractal or edit its settings, then generate the complete geometry.

Geometry status
Not generated
View fitting
Full shape, no crop
Segment limit
200,000 edges

Import saved settings

Local bounds: 0 to 10 iterations, 250,000 expanded symbols, 200,000 drawing edges, 1,024 saved branch positions, and 2,097,152 output pixels. Width and height are 128 to 2048 pixels. Expansion and drawing counts are checked before allocating geometry. The worker stops after 30 seconds; PNG encoding stops after 15 seconds. Extremely fine detail can be smaller than one output pixel even when all vector geometry is present.

Accuracy. Deterministic mathematical art; finite iteration and output caps limit detail.

Common questions

How does the Sierpinski triangle count work?
Level 0 is one filled equilateral triangle. Each level divides every retained triangle into four half-size triangles, keeps its three corner triangles and removes the center. Level n therefore contains exactly 3^n filled triangles, with three edges counted per triangle. At level 10 this is 59,049 triangles and 177,147 edges. All geometry is generated even when details are smaller than an output pixel.
Does the same tree seed reproduce the same result?
Yes. The same complete settings and unsigned 32-bit seed produce the same geometry. Tree level 0 contains one trunk and each next level adds two children at each tip, giving 2^(n+1) - 1 segments. The seed determines branch-angle variation within six degrees of the selected angle and child lengths from 67% to 77% of their parent. Sierpinski and L-system modes do not use the tree seed.
What L-system grammar can I supply?
Enter a nonempty axiom and rules such as F = F[+F]F[-F]F, one uppercase symbol per rule. F and G draw forward, f moves without drawing, + and - turn clockwise and counterclockwise by the angle, and | turns 180 degrees. Brackets save and restore turtle position and direction; each axiom and replacement must have balanced brackets. Other uppercase letters are nondrawing variables. Unruled symbols remain unchanged and an empty replacement erases its symbol. Rules are parsed as data and never executed as code.
Why does changing base length sometimes leave the preview the same size?
Length is measured in model units. The complete geometry is always centered and fitted into the selected output dimensions, preserving its aspect ratio with at least 24 pixels of padding and no crop. Changing the scale of a self-similar shape can therefore leave its fitted appearance unchanged. Model bounds and the fit scale are displayed. The on-screen canvas can shrink to fit your screen, while downloads retain the selected dimensions.
Do PNG and SVG contain the same geometry as the preview?
Yes. The preview, SVG and PNG use the same complete fitted coordinates and colors. Tree and L-system lines use the chosen pixel width; Sierpinski uses filled triangles. SVG retains vector geometry, while PNG renders it at the selected pixel size. The tool never downloads a partial render when an operation is canceled or fails.
What limits protect the browser from very large rules?
Iterations are limited to 0 through 10. Before expanding strings or allocating geometry, the tool counts the requested expansion and drawing segments against limits of 250,000 symbols and 200,000 edges. Branch stacks are limited to 1,024 positions. Output is limited to 2,097,152 pixels, with each dimension from 128 to 2048. Geometry workers stop after 30 seconds and PNG encoding after 15 seconds. Reduce iterations, shorten rules or reduce output size when a limit is reached.
Can I save and reopen the settings?
Save settings JSON after a complete generation, then paste it into Import saved settings. Import validates the entire versioned settings file before replacing current controls. Valid edited settings also save locally in this browser when storage is available. Restoring or importing settings does not automatically generate a drawing. All processing stays on this device.

Deterministic mathematical art; finite iteration and output caps limit detail.