Staaarter

Generate a Sierpinski Hexagon

Generates the hexaflake, a well-documented fractal built from a central regular hexagon plus 6 hexagons arranged around it, each scaled down by a factor of 1/3. Adjust the Depth input from 0 to 4 and export the result as SVG or PNG. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-08-05
By Staaarter Team
fractalgeneratorsvg

Overview

Introduction

The hexaflake extends the same n-flake idea behind the pentaflake to a hexagon base, a central hexagon with 6 more arranged around it, each scaled down by exactly one third.

It's a real, well-documented fractal, closely related to the Sierpinski triangle and carpet in spirit, subdivide and repeat, but built from hexagonal tiling instead of triangular or square grids.

What Is Generate a Sierpinski Hexagon?

A fractal made of a central regular hexagon with 6 more hexagons arranged around its edges, each one exactly a third the size of its parent. The same 7-copy pattern then repeats inside each of those hexagons.

It's one of the most commonly cited n-flake fractals, alongside the pentaflake, because the hexagon's natural 1/3 scale factor produces a clean, edge-to-edge tiling with no visible gaps.

How Generate a Sierpinski Hexagon Works

The tool starts with one regular hexagon. At the first recursive step, it places 6 smaller hexagons around the original's edges, each scaled by 1/3, plus one more copy at the same 1/3 scale sitting on the original's center.

That gives 7 total sub-hexagons per level, 6 arranged around the perimeter and 1 in the center, each one eligible for the same subdivision at the next level.

This repeats down to the chosen Depth, with every one of the 7^depth resulting hexagons drawn as a filled polygon.

When To Use Generate a Sierpinski Hexagon

Use it whenever you want an accurate hexaflake for math visualizations, generative art, or educational material about n-flake fractals and hexagonal tiling.

If you want the same idea on a different base polygon, see the pentagon-based Sierpinski Pentagon Generator or the octagon-based Sierpinski Polyflake Generator.

Features

Advantages

  • Implements the standard, mathematically exact hexaflake construction with a clean 1/3 scale factor.
  • The hexagon's natural tiling gives a visually dense but orderly result even at moderate depth.
  • Filled-polygon rendering makes the 6-fold symmetry clear at a glance.

Limitations

  • Depth is capped at 4, since the hexagon count grows by a factor of 7 per level and quickly produces a very large number of tiny shapes.
  • Only the standard 1/3 scale factor is offered, there's no option to use a different packing ratio.

Examples

Depth 3 hexaflake

Input

Depth: 3

Output

A dense, honeycomb-like cluster of hexagons showing 3 recursive levels of the 7-copy (1 center plus 6 surrounding) hexaflake pattern.

Each of the 7 hexagons from depth 2 is replaced with its own scaled center-plus-6 arrangement.

Best Practices & Notes

Best Practices

  • Start at Depth 2 to see the 6-fold symmetry and honeycomb-like tiling clearly before increasing further.
  • Use the SVG export for print or further vector editing, since the polygon points stay exact at any zoom level.

Developer Notes

Generated by the shared `nFlake(sides, scale, depth, radius, cx, cy, level, out)` helper with `sides = 6` and `scale = 1 / 3`. At each level the helper places `sides` child copies around the perimeter at `distance = radius * (1 - scale)` plus one more child copy centered on the same point, giving the standard 7-copies-per-level hexaflake recursion. Depth is bounded to 0-4 by `boundsCheck`.

Generate a Sierpinski Hexagon Use Cases

  • Math and geometry visualizations demonstrating n-flake fractals and hexagonal tiling
  • Generative art with a honeycomb-like, 6-fold symmetric texture
  • Educational material comparing hexaflake, pentaflake, and other n-flake constructions side by side

Common Mistakes

  • Assuming the hexaflake uses the same golden-ratio scale factor as the pentaflake, it doesn't, the hexagon's natural ratio is an exact 1/3.
  • Pushing Depth to the maximum immediately, at depth 4 the hexagon count is large enough that individual shapes become very small on screen.

Tips

  • Compare this tool with Sierpinski Pentagon Generator to see how the base polygon's shape changes the fractal's symmetry and density.
  • Zoom into the exported SVG to inspect the self-similar center-plus-6 structure at each level individually.

References

Frequently Asked Questions