01
Why we separated the math from the interface
A calculator is easiest to trust when its inputs, formulas, unit conversions, rounding, and outputs can be tested without a browser. The original formulas lived alongside interface state, so we extracted them into pure TypeScript functions.
The result is @buildvisionai/construction-calculators: the same calculation domains used by the free calculator pages, without React, DOM APIs, or runtime dependencies.
02
What the package covers
The package spans concrete and masonry, materials and aggregates, roofing, structures and exterior work, and business calculations. Examples include concrete volume, block and mortar, gravel tonnage, board feet, drywall, paint, insulation, roof pitch, fencing, stairs, labor cost, markup, equipment depreciation, and critical-path scheduling.
The live interfaces remain available in the BuildVision AI calculator directory, where each route explains its assumptions and units.
- Pure typed inputs and outputs
- Imperial and metric handling where the calculator supports both
- No browser or React requirement
- Unit tests around the calculation engines
03
Install and import
Install the published package, then import only the calculation functions your project uses.
npm install @buildvisionai/construction-calculators
import { calculateMarkup } from '@buildvisionai/construction-calculators';
const result = calculateMarkup({ costs: 850, markupPercent: 25 });04
Design decisions
Pure functions make the engines predictable: an input object goes in and a typed result comes out. Keeping the runtime dependency list empty reduces integration surface, while TypeScript definitions make available units and fields visible in the editor.
Open source also makes review possible. A formula can be inspected, tested against a known example, discussed, and corrected without treating the web interface as a black box.
05
Use calculations as an input, not a specification
Construction calculators estimate quantities and arithmetic from the values supplied. They do not replace project drawings, engineering, code requirements, manufacturer instructions, supplier coverage, or professional judgment.
Review units, waste factors, pack sizes, local pricing, and job conditions before purchasing or bidding. Contributions and issue reports belong in the public repository.