Engineering / After hours

Geometry automation for stadium seating layouts

A pipeline that reads seating layouts out of CAD drawings, solves seat spacing under aisle and accessibility constraints, and emits fabrication-ready drawings with associative dimensions, proven correct by golden-file and property tests rather than by eye.

computational geometryCADDXFconstraint solvingPythonproperty testing

The problem

A seating manufacturer receives an architect's drawing and has to answer a deceptively simple question: how many seats fit in each row, at what spacing, and where does every bracket go? The answer has to respect aisle widths, accessibility clearances, product widths that come in fixed increments, and the fact that the drawing is a drawing, not a database.

Done by hand, a section takes an experienced estimator most of a day and produces a document that is right until someone changes the aisle. Done badly by software, it produces layouts that are valid on paper and unbuildable in steel.

The pipeline

Extract. Read the DXF. Find the row arcs and lines, the aisle boundaries, and the existing dimensions. Treat the drawing's own dimension text as an oracle where it exists, and as a lie where it contradicts the geometry.

Solve. For each row, distribute seats along the row geometry so that every gap lands in a legal range, gaps plus margins sum to the run, no seat overlaps an aisle or a clearance zone, and the product widths are ones that exist. This is a small constraint problem per row and a bookkeeping problem across the section. The solver is deterministic, so the same drawing always produces the same layout.

Emit. Write a new DXF with named layers, seat blocks with attributes, true associative dimensions on a defined dimension style, a title block, and a paper-space layout at a fixed plot scale. The output opens in the tools the shop already uses.

Prove. This is the part that made it real. Every extracted drawing has a golden output that a human has blessed once; any change that alters the emitted geometry beyond tolerance fails the build. Property tests generate thousands of synthetic rows and assert the invariants: every gap in range, sums correct, no overlaps, counts match. A round-trip test extracts the emitted drawing and diffs it against the solved model.

What I learned

  • Numerical geometry is mostly about tolerances and about deciding, explicitly, which source of truth wins when two disagree.
  • A visual diff (overlaying the solved positions on the extracted ones) settled more arguments in five seconds than any table did in an hour.
  • "It runs" is not a result. "Here is the proof it is right" is the result, and it is what let an estimator trust the output on a job with real money attached.