🐝

Hexagon rosette

Twelve rainbow hexagons overlapping in a beautiful rosette pattern.

BuilderΒ· ages 10–1220 minnested for loopslist indexingmoduloangles
hexagons.py

First load pulls ~10Β MB of Python. Only happens once β€” the browser caches it after.

What should the output look like?

A colorful overlapping rosette of hexagons in the middle of the canvas.

πŸ“–

How this works

Every hexagon is 6 sides with a 60Β° right turn between them. Then between hexagons we rotate by only 30Β° β€” half a turn β€” so each new hexagon overlaps the previous one at a fresh angle, building up a 12-pointed rosette.

Your turn β€” try these

  • 1Change `right(30)` to `right(15)`. What happens?
  • 2Try `right(60)` β€” now they all draw on top of each other. Why?
  • 3Change the side length from `60` to `range(30, 90, 5)` β€” grow the hex each round.