{
  "schemaVersion": 1,
  "slug": "lumber-calculator",
  "category": "construction",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "f554524c3fcf2ea14a27818f8b9739a32f5e9505e9a40a6afec11ac16fa26a12",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/lumber-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "BF = T × W × (12L) ÷ 144; BF_total = BF × Q; linearFeet = L × Q; cost = BF_total × p",
    "vars": [
      [
        "T",
        "thickness (in)"
      ],
      [
        "W",
        "width (in)"
      ],
      [
        "L",
        "length per piece (ft)"
      ],
      [
        "Q",
        "pieces"
      ],
      [
        "BF",
        "board feet"
      ],
      [
        "p",
        "price per board foot"
      ]
    ],
    "note": "Length is entered in feet and converted to inches before dividing cubic inches by 144. A 2 × 6 × 8 ft piece is 8 board feet."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const lengthInches=length*12; const boardFeetEach=thickness*width*lengthInches/144; const boardFeetTotal=boardFeetEach*quantity; return {boardFeetEach,boardFeetTotal,linearFeet:length*quantity,cost:boardFeetTotal*pricePerBoardFoot};",
    "inputs": [
      {
        "name": "thickness",
        "type": "number",
        "default": 2,
        "min": 0.5,
        "max": 12,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "width",
        "type": "number",
        "default": 6,
        "min": 0.5,
        "max": 24,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "length",
        "type": "number",
        "default": 8,
        "min": 0.5,
        "max": 30,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "quantity",
        "type": "number",
        "default": 10,
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "pricePerBoardFoot",
        "type": "number",
        "default": 6,
        "min": 0,
        "max": 200,
        "step": 0.1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "boardFeetEach",
        "precision": 2,
        "unit": "bf"
      },
      {
        "name": "boardFeetTotal",
        "precision": 2,
        "unit": "bf"
      },
      {
        "name": "linearFeet",
        "precision": 1,
        "unit": "ft"
      },
      {
        "name": "cost",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
