Draw a Hexaflake Fractal
Draw the Sierpinski hexagon: each hexagon becomes seven of one third the size, one at the centre and six around.
Seven hexagons, then forty-nine
A hexagon of circumradius r is replaced by seven hexagons of radius r/3: one at the centre and six with their centres two thirds of the way to each vertex. That placement makes the ring touch the parent's vertices and touch its neighbours, which is what closes the honeycomb rather than leaving gaps. Level n holds 7^n hexagons.
Each hexagon is filled as its own path, with the fill darker at shallower levels so the structure stays readable. The page draws every level, so depth four is 2,801 paths in total. Depth is capped there: at five the page would paint 19,608 paths, which is slower than a frame at this canvas size, so the picture would appear to hang.
Rotation only turns the whole flake; it never changes the rule or the count. The drawing is a deterministic function of depth and rotation, with nothing fetched and nothing stored.
Draw a hexaflake: every hexagon becomes seven smaller ones and every level is filled, to a depth you set and an orientation you can rotate.
It is a deterministic filled figure on a canvas in this tab, and rotation turns the whole flake without changing the rule.
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 hexagons placed at the depth drawn.
The rule
Each hexagon is replaced by seven: six at the vertices and one in the centre. Every level is drawn, which is why the count and the painting cost climb faster than the depth suggests.
Where it stops
Depth is capped at 4, because each hexagon becomes seven and every intermediate level is filled, so a deeper flake paints more paths than a frame can show. There is no export.
What to Expect
Best for
- seeing a hexagonal analogue of the Sierpinski triangle
- producing a filled geometric figure
What this tool keeps
- The substitution and the fills happen in this tab; the page keeps no image and uploads nothing.
Frequently asked questions
How many hexagons per level?
Seven: one in the centre and six at the vertices. Because every level is painted, the visible count is the sum over levels, not just the deepest one.
What does rotation change?
Only the orientation of the finished flake. The substitution rule and the depth are untouched, so the same depth at two rotations is the same figure turned.
Why is the depth capped at 4?
Because each hexagon becomes seven and every level is filled — the painting cost grows faster than the depth, and the smallest hexagons stop being resolvable.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.