Plan Rooms

Open a floor-plan PDF. The page finds every room from the wall lines and measures it. Nothing leaves your browser.

The plan is drawn here. Wheel to zoom, drag to pan, click a room to select it, double-click to zoom to it.

How it works

  1. Read. pdf.js gives every line of the page with its pen, and every text with its position. A scale note like 1/8" = 1'-0" sets the points per foot.
  2. Walls. The wall pen is the pen with the most drawn length among the thin ones. Door leaves, swings and dashes are dropped.
  3. Rooms. The walls go on a raster at 8 px per foot, doors are closed, and each pool of white that holds a room number is a room. Lockers, counters and stalls merge into their room.
  4. Snap. Each straight edge of a room moves to the PDF wall face, so the area is exact.
  5. Measure. The Sector Map maths: Bézier area by Green's theorem, shoelace, perimeter, the exact Fourier series and its 200 largest circles.

Controls