Draw a T-Square Fractal screenshot

Draw a T-Square Fractal

Draw the T-square fractal from squares: each square spawns two half-size squares on one edge, axes alternating.

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

Squares that stack into a T

This fractal is built from squares rather than strokes. A square of side s spawns two squares of side s/2 attached along one edge, and the growth axis alternates by 90 degrees at every level — horizontal children then vertical grandchildren — which is what turns a stack into a T. Level n holds 2^n squares, and the figure accumulates ancestors as it grows.

Each square is a separate filled rectangle, shaded by depth so the smaller ones stay visible. Depth is capped at ten, which is 2,047 squares including ancestors. Past that the newest squares are thinner than a pixel, and painting two thousand rectangles per frame is already the dominant cost.

The fill opacity is adjustable but the placement is not: children always sit on the parent's edge at half the side. The same depth always draws the same stack, entirely inside the tab.

Draw a T-square fractal: every square puts its children on its own edge at half the side, with the axis turned 90°.

Nothing is placed by hand — the children's positions follow from the parent's edge and orientation, level after level.

How to use it

Set the depth and the fill strength, then press Draw or Animate. Stop ends the animation, and the status line names the square count at the depth drawn.

The rule

Each level doubles the square count, and every child sits on its parent's edge at half the side with the axis rotated 90°. The orientation is inherited, which is why the figure spirals instead of tiling.

Where it stops

Depth is capped at 10, where the figure is 2,047 filled squares, each thinner than a pixel. The fill control changes the alpha only; there is no export.

What to Expect

Best for

  • seeing a fractal built from edges rather than centres
  • comparing fill strength at a fixed depth

What this tool keeps

  • The placement and the fills run in this tab; nothing is uploaded and no image is kept.

Frequently asked questions

Where do the children sit?

On the edge of their parent, at half the side, with the axis turned 90°. The position follows from the parent rather than from a formula with a free parameter.

What does the fill control change?

Only the alpha of the filled squares. The geometry, the depth and the count are unaffected.

Why cap the depth at 10?

Because every level doubles the square count: depth 10 is 2,047 squares, each thinner than a pixel, which is where the drawing stops adding information.

Developer program

Build custom tools for your store

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