What you're looking at
Every cell of the rectangle holds a density between 0 (void) and 1 (solid). A finite-element model with that density field is loaded the way you painted it, and the optimizer asks: for a fixed amount of material, which arrangement bends the least? That is minimum compliance, and the answer is found by SIMP: intermediate densities are penalised (stiffness ∝ ρ³), so the design is pushed to black-and-white, and an optimality-criteria update moves material towards the cells where it does the most good.
The expensive part is solving K u = f every iteration. Here it is done on the graphics card: a conjugate-gradient solver written as WebGL fragment shaders, with the stiffness matrix never assembled; each node's row is applied on the fly from the four elements around it. Sums and dot products go through a reduction pyramid, so an iteration of the solver needs no help from the CPU.
The filter blurs the density over a radius before it is used, which sets a minimum member size and kills checkerboards. Heaviside projection sharpens the blurred field back to crisp boundaries. Several load cases are solved separately and their compliances added, so the structure must carry each of them on its own.
Validated against a Float64 port of the 88-line MATLAB code and against beam theory on the benchmark page.
Keys: space runs and pauses, S steps, R resets, 1–5 switch views, F L D K V E pick tools, [ ] change the brush, Ctrl+Z undoes, Shift+drag erases. Built by Lukas Schulz.