hover a QR cell to inspect its neighbor mask
A standard QR code matrix is generated from your input payload using the qrcode-generator library. The result is a boolean 2D array where true represents an active (dark) module.
For each active cell at (x, y), a 4-bit mask encodes which of its four cardinal neighbors are also active. North=8 (1000), East=4 (0100), South=2 (0010), West=1 (0001). The sum determines the shape of that corner.
Each mask value (0-15) maps to a specific SVG path segment via buildFluidModulePath(). The segments use arc commands to smooth corners where neighbors exist, producing connected, fluid shapes instead of discrete squares.
| mask | binary | neighbors | description |
|---|---|---|---|
| 0 | 0000 | none | Isolated cell - full rounded rectangle |
| 1 | 0001 | W | West neighbor only |
| 2 | 0010 | S | South neighbor only |
| 3 | 0011 | S, W | South + West neighbors |
| 4 | 0100 | E | East neighbor only |
| 5 | 0101 | E, W | Horizontal bridge |
| 6 | 0110 | E, S | East + South neighbors |
| 7 | 0111 | E, S, W | Three-way (missing North) |
| 8 | 1000 | N | North neighbor only |
| 9 | 1001 | N, W | North + West neighbors |
| 10 | 1010 | N, S | Vertical bridge |
| 11 | 1011 | N, S, W | Three-way (missing East) |
| 12 | 1100 | N, E | North + East neighbors |
| 13 | 1101 | N, E, W | Three-way (missing South) |
| 14 | 1110 | N, E, S | Three-way (missing West) |
| 15 | 1111 | N, E, S, W | Fully surrounded - solid fill |