Draw a Levy Fractal Curve screenshot

Draw a Levy Fractal Curve

Draw the Levy C curve from its one-rule L-system at 45 degrees, doubling the stroke count per level up to depth 13.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab

One rewrite, 45-degree turns

The Levy C curve has a single rule: every F becomes +F--F+. In words, each stroke is replaced by a left turn, a stroke, two right turns, a stroke and a left turn, and every turn is 45 degrees. The path therefore doubles its stroke count at each level and never crosses itself, which is why the outline stays crisp instead of turning into noise.

The page expands the string for the chosen depth and walks it with a turtle. Depth is capped at 13, which is 8,192 strokes. The string is rebuilt from scratch on every redraw, so depth 14 would build a 16,384-stroke string for detail the canvas cannot show.

The seed is the single symbol F and there is no randomness anywhere. The same depth always produces the same curve, and the page keeps everything in the tab.

Draw the Lévy C curve from the rewrite F → +F−−F+, with 45° turns, to a depth you set.

The curve bends but never crosses itself, the rewrite is fixed, and the same depth always draws the same figure.

How to use it

Set the depth, then press Draw or Animate. Stop ends the animation, and the status line names the stroke count at that depth.

The rule

One forward stroke becomes a forward stroke, a left turn, two forward strokes and a right turn. With 45° turns the path stays on the diagonal lattice, which is why it folds instead of self-intersecting.

Where it stops

Depth is capped at 13, which is 8,192 strokes on a 640-pixel canvas. There is no export, no seed and no colour control.

What to Expect

Best for

  • seeing a curve that folds without crossing itself
  • comparing a rewrite at two depths

What this tool keeps

  • The rewrite and the drawing run in this tab; nothing is uploaded and no image is stored.

Frequently asked questions

What rule draws the Lévy curve?

F becomes +F−−F+ — one forward stroke, a left turn, two strokes, a right turn — with 45° turns. That is the whole rule, and it is printed on the page.

Why does it not cross itself?

Because the 45° turns keep the path on the diagonal lattice and the rewrite never reverses into an existing stroke. The page draws the curve rather than proving that.

Why stop at depth 13?

Because the rewrite doubles the stroke count at every step: depth 13 is 8,192 strokes, which is the limit of what a 640-pixel canvas resolves.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.