Generate fractal

Expand a stored L-system and interpret its command string as an SVG turtle path.

freeworks offlinenothing uploaded
ToolFractal Generator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

At every depth, each symbol is replaced in parallel by the chosen production rule. A turtle draws on F, A, B, and G, turns on plus or minus, saves state at an opening bracket, restores it at a closing bracket, then scales all paths into the view box.

  • Depth begins at four and stops at six because production strings can grow exponentially.
  • Axiom, angle, and replacement rules are fixed for each named construction.

Worked example

Fourth-order Koch snowflake
Input
											Type: koch snowflake
Depth: 4
										
Output

When to use this

Graphics classes compare Koch iterations, L-system exercises inspect rewrite growth, and SVG demonstrations visualize branch stacks.

Edge cases

  • One extra iteration can multiply segment count rather than add a fixed number.
  • The Hausdorff-dimension mode prints stored notes and intentionally draws zero segments.
  • Branching examples retain a fixed segment length across generations, so they are illustrative rather than botanically calibrated.

References