[ RASTER ]v1.0 / fluid-qr
> preview
> controls
48121620
#FFFC00
#09090B
> mask inspector

hover a QR cell to inspect its neighbor mask

> documentation / neighbor mask system
1. QR Generation

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.

2. 4-Bit Neighbor Mask

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.

3. Path Compilation

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.

maskbinaryneighborsdescription
00000noneIsolated cell - full rounded rectangle
10001WWest neighbor only
20010SSouth neighbor only
30011S, WSouth + West neighbors
40100EEast neighbor only
50101E, WHorizontal bridge
60110E, SEast + South neighbors
70111E, S, WThree-way (missing North)
81000NNorth neighbor only
91001N, WNorth + West neighbors
101010N, SVertical bridge
111011N, S, WThree-way (missing East)
121100N, ENorth + East neighbors
131101N, E, WThree-way (missing South)
141110N, E, SThree-way (missing West)
151111N, E, S, WFully surrounded - solid fill