Braille Fractal
Generate stunning L-system fractals rendered as Unicode Braille characters. Dragon Curve, Koch Snowflake, Sierpinski Triangle, Hilbert Curve & more.
About
L-system fractals are generated by recursive string rewriting: an axiom string is expanded through production rules over n iterations, then interpreted as turtle graphics commands. Each iteration multiplies string length by a factor dependent on the ruleset - a Koch Snowflake at depth 6 produces over 4,000 line segments. This tool rasterizes those segments onto a quantization grid where each cell maps to a 2×4 Braille dot matrix (Unicode block U+2800 - U+28FF), encoding 8 binary dots per character. The result is a text-only fractal you can paste into terminals, code comments, or social media. Misconfiguring iteration depth relative to grid resolution produces either empty output or an undifferentiated blob - the presets here are calibrated to avoid both failure modes.
Formulas
An L-system is defined by the tuple (V, ω, P) where V is the alphabet, ω is the axiom, and P is the production ruleset. At each iteration the string is rewritten in parallel:
The resulting string is interpreted via turtle graphics. F means move forward by step length d, + means turn left by angle θ, − means turn right by θ. The turtle position updates as:
For Braille quantization, the bounding box of all segments is mapped to a grid of W × H cells. Each cell covers a 2×4 dot matrix. A dot at position (col, row) within the cell sets bit b in the Braille codepoint:
Where dk ∈ {0, 1} indicates whether dot k is raised. The Braille dot ordering maps (column 0, rows 0 - 3) to bits 0,1,2,6 and (column 1, rows 0 - 3) to bits 3,4,5,7.
Reference Data
| Fractal | Axiom | Rule(s) | Angle | Safe Depth | Segments at Max | Symmetry |
|---|---|---|---|---|---|---|
| Dragon Curve | FX | X→X+YF+, Y→−FX−Y | 90° | 12 | 4,096 | None |
| Koch Snowflake | F++F++F | F→F−F++F−F | 60° | 5 | 3,072 | 3-fold |
| Sierpinski Triangle | F−G−G | F→F−G+F+G−F, G→GG | 120° | 7 | 9,843 | 3-fold |
| Hilbert Curve | A | A→−BF+AFA+FB−, B→+AF−BFB−FA+ | 90° | 6 | 4,096 | Self-similar |
| Lévy C Curve | F | F→+F−−F+ | 45° | 14 | 16,384 | 2-fold |
| Gosper Curve | A | A→A−B−−B+A++AA+B−, B→+A−BB−−B−A++A+B | 60° | 4 | 2,401 | 6-fold |
| Peano Curve | X | X→XFYFX+F+YFXFY−F−XFYFX, Y→YFXFY−F−XFYFX+F+YFXFY | 90° | 3 | 6,561 | Space-filling |
| Quadratic Koch Island | F+F+F+F | F→F+F−F−FF+F+F−F | 90° | 3 | 2,048 | 4-fold |
| Sierpinski Carpet | F | F→F+F−F−F+F | 90° | 6 | 15,625 | 4-fold |
| Cross | F+F+F+F | F→F+F−F+F+F | 90° | 5 | 3,125 | 4-fold |