APEX 5040 Gen 3 load calculator - source (built 2026-12-02)

Inputs
  5040Gen3RiggingCalculator7-25-26.xlsm   APEX workbook (sheet "Apex Rig Calculator", Rev 12-01-24)
  APEX-4240-Gen3-Load-Calculator-offline.html (Rev 11/30/26)   the app shell the 5040 is built on
  apex-5040-gen3.html from reflectionsproductions.com/3d/      Vectorworks model -> model5040.json (its "const DATA" array)
  Apex5040Gen3.pdf                                              manufacturer spec sheet, pages 7, 10, 14, 15 become the Spec tabs

Build
  python extract5040.py <workbook.xlsm> wb5040.json            workbook -> engine data (+ wb5040-plan.png, the stage drawing)
  python build5040.py <4240 calculator.html> wb5040.json wb5040-plan.png model5040.json Apex5040Gen3.pdf <output.html>
  stage3d_patch.py is used by build5040.py (5040 members, towers, wings and camera for the 3D view).

What the build changes on top of the workbook
  - Overload (red) bands are open-ended. In the workbook they stop at an upper number, so a very large load lost its colour.
  - Slide-out beam totals: red from 4,000 (the workbook had none), yellow from 2,001 (spec sheet prints 2,000).
  - Angle support beam totals: red from 3,600 (the workbook had none), yellow from 2,001 (spec sheet prints 2,000).
  - Wind brace: yellow from 251 (spec sheet prints 250; workbook limit 1,000 unchanged).
  - PA pull-back beam: yellow from 3,001 (spec sheet prints 3,000; workbook limit 4,000 unchanged).
  - The span-share table in B4:C55 is calculated but not drawn. Colour-scale rules are not used (they never show on an input cell).
  Storage key apex5040g3-inputs-v1; saved files carry app id apex-5040-gen3.

Tests (tests/)
  ref_eval.py   independent Python evaluation of the workbook formulas and colour rules; writes test load sets
  cmp.js        opens each load set in the calculator and compares every shown value and cell colour with ref_eval
  ui.js         3D status table vs ref_eval, Loads, Wind, Spec tab, Save as, reopen, print report, clear and undo
  mobile.js     phone / tablet sized run (Chromium emulation; not a real iPhone)
  nye5040.py, runplan.js   the New Year Eve 2026 plot placed on the 5040 grid
