Ultimate Lozenge Tiling Generator - Draw Any Region     lozenge-tilings

Leonid Petrov


Simulation Info

Ultimate Lozenge Tiling Generator - Draw Any Region     lozenge-tilings

Leonid Petrov

About this simulation
  1. Draw a region on the triangular grid using the pencil tool, or use Hexagon preset
  2. Click "Make Tileable" if the region shows as invalid
  3. Click "Perfect Sample" to generate an exact random tiling
  4. Toggle 3D view to see the height function surface

A region is tileable if it has equal numbers of black and white triangles that can be perfectly matched.

Sampling Methods:

  • Glauber dynamics: MCMC with local flips. Converges to target distribution over time.
  • Perfect Sample (CFTP): Coupling From The Past — exact sample with no burn-in.

Weight Distributions:

  • Uniform (q=1): Equal probability for all tilings
  • q-Volume (q≠1): Probability ∝ qvolume
  • Periodic weights: k×k matrix of position-dependent q values

Advanced:

  • Average Sample: Compute mean height (Limit Shape)
  • Fluctuations: Height difference ≈ Gaussian Free Field
  • Double Dimer: Superimpose two samples to form loops

Drawing Tools:

  • Pan 🤚: Move the view around
  • Draw ✏️: Add triangles to region
  • Erase 🧹: Remove triangles from region
  • Lasso Fill/Erase: Click points to define polygon, click near start to close
  • Snap 📐: Snap lasso to grid vertices

Region Tools:

  • Scale Up/Down: Double or halve region size
  • Make Tileable: Auto-fix invalid regions
  • Undo/Redo: Full history support (Ctrl+Z/Y)

Presets: Hexagon (a,b,c), Letters A-Z, Numbers 0-9, Shape of the Month

Visualization:

  • 2D Lozenge ◆: Standard flat tiling view
  • 2D Paths →: Non-intersecting paths
  • 2D Dimer •-•: Matching on dual graph
  • 3D Height: Stepped surface, rotate/zoom

Export Options:

  • Images: PNG, PDF
  • Data: Height CSV, Mathematica array
  • Region: JSON import/export
  • Share: Copy link with encoded state

Performance: Uses WebGPU when available, falls back to multi-threaded WASM.


Dimers 0 | Steps 0 | CFTP -
Fluctuations & Double Dimers
Export
Images 85
Height
Shape
Share
3D mm

code

(note: parameters in the code might differ from the ones in simulation results below)

Dear colleagues:
Feel free to use code (unless otherwise specified next to the corresponding link), data, and visualizations to illustrate your research in talks and papers, with attribution (CC BY-SA 4.0). Some images are available in very high resolution upon request. I can also produce other simulations upon request - email me at lenia.petrov@gmail.com
This material is based upon work supported by the National Science Foundation under Grant DMS-2153869