About
This is an interactive model of snowflake growth inspired by Kenneth G. Libbrecht’s Snowflake books.
Snowflakes can be said to grow in two different ways: ‘faceting’ and ‘branching’. Faceting causes the snowflake to grow large hexagonal ‘faces’, whereas branching causes the snowflake to split into several elongated hexagonal ‘branches’. In real life, whether a snowflake is faceting or branching depends on the current temperature and humidity. Changes to these conditions are what make snowflakes look so unique.
The solid line in the graph above represents a combination of the temperature and humidity during the snowflake’s growth. The temperature and humidity are apt for faceting in the region above the dotted line and apt for branching in the region below the dotted line. The snowflake will split into several branches when the solid line crosses from the top region to the bottom region, and will grow facets at the end of its branches when the solid line crosses from the bottom region to the top region.
Controls
How the snowflake looks and grows can be customized in various ways:
- Graph: Tap or click to move a graph handle to that location. On PC, handles may also be dragged up or down. The purpose of the graph is described under About.
- Pause/Play: Toggles snowflake growth.
- Reset: Restarts snowflake growth.
- Random: Randomly chooses one of approximately one quadrillion different snowflakes.
- Spin: Toggles snowflake rotation.
- Speed: Tap or click to change snowflake growth rate. On PC, the slider may be dragged.
- Theme: Switch between light and dark themes.
On PC, the controls may also be navigated via tab (forwards) and shift-tab (backwards), with space/enter selecting the option. When a graph handle is selected with the keyboard, it may be moved up or down with the arrow keys or set to a specific location with the number keys.
Implementation
- Languages: TypeScript, Zig
- Snowflake: CanvasRenderingContext2D
- Graph: SVG