The material engine, in one file
Panels per wall from the wall width and the roll width. The cut length rounded up to a whole number of pattern repeats. Panels per roll from the roll length. Rolls from the total panels, plus yardage and the pricing that follows. Openings come off either as their real measured sizes or as US-standard door and window defaults when nobody measured them. The file opens with the rule it enforces: all formulas live here, and a business rule is changed by editing this file and nothing else.
Proof
lib/calc.ts

