Draw a Triflake Fractal screenshot

Draw a Triflake Fractal

Outline the three-fold flake: three half-size corner triangles per level, with the middle left as a visible hole.

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

Outlines, not fills

The triflake is the three-fold Sierpinski outline. Each equilateral triangle keeps its three corner triangles at half the side and drops the middle, and the page draws each level in outline rather than filling it — which is what keeps the holes visible as the depth grows. Level n holds 3^n triangles.

Every level is outlined, so depth six is 1,093 stroked paths. That is the cap: at seven the total is 3,280 outlines whose sides are under a pixel long, so the page would spend frames drawing detail no one can see. The stroke width also thins with depth so the smaller outlines stay legible.

Rotation turns the whole flake and never changes the rule. Corner triangles share the parent's corner exactly, so the geometry is exact rather than approximate, and reloading reproduces it.

Draw a triflake: three corner triangles of half the side replace each triangle, and the middle is left empty.

That hole is the fractal. Every level is stroked, so the outline count triples as the sides shrink.

How to use it

Set the depth and the rotation, then press Draw or Animate. Stop ends the animation, and the status line names the number of outlined triangles at the depth drawn.

The rule

Corner triangles are half the side and share the parent's corner exactly; the central triangle is not drawn. That removed centre is what makes the figure self-similar rather than a tiling.

Where it stops

Depth is capped at 6, because each outline spawns three more and every level is stroked, so depth 7 is 3,280 outlines with sides shorter than a pixel. There is no export.

What to Expect

Best for

  • seeing the Sierpinski gasket as an outline figure
  • comparing levels of a three-fold substitution

What this tool keeps

  • The substitution and the strokes happen in this tab; the page uploads nothing and stores no image.

Frequently asked questions

Why is the middle of each triangle empty?

Because the central triangle is deliberately not drawn — the hole is the construction. Only the three corner triangles of half the side are kept.

What does rotation do?

It turns the whole flake. The substitution, the depth and the empty centre are unchanged.

Why cap the depth at 6?

Because each outline spawns three and every level is stroked: depth 7 is 3,280 outlines whose sides are under a pixel.

Developer program

Build custom tools for your store

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