{
  "schemaVersion": 1,
  "slug": "curtain-size-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "da2b965e1541b120702dc5c15d26412a333e79cb6e373801627d2aab694878ba",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/curtain-size-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": "Fb = (W + 16) × f × (H + r + h) ÷ 144",
    "vars": [
      [
        "W",
        "Window width (in)"
      ],
      [
        "f",
        "Fullness (1.5 / 2 / 2.5 / 1)"
      ],
      [
        "H",
        "Window height (in)"
      ],
      [
        "r",
        "Rod height (in)"
      ],
      [
        "h",
        "Hang allowance (0 / 4 / −0.5 / 4)"
      ]
    ],
    "note": "Rod = window width + 16 in (8 in each side); panel width = rod × selected fullness ÷ panel count. Panel length = window height + rod rise + hem allowance. Flat fabric area excludes hems, seams and pattern matching."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "IKEA — Measuring and planning curtains",
        "url": "https://www.ikea.com/nl/en/ideas/measure-the-window-for-curtain-rails-curtain-rods-or-blinds-pubf4dbe0f0/"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "da2b965e1541b120702dc5c15d26412a333e79cb6e373801627d2aab694878ba",
    "basis": "Fb = (W + 16) × f × (H + r + h) ÷ 144",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "const F = { sheer:1.5, standard:2, deluxe:2.5, flat:1 }; const H = { sill:0, apron:4, floor:-0.5, puddle:4 }; const rodWidth = windowWidth+16; const panelWidth = rodWidth*(F[fullness] || 2)/panelCount; const panelLength = windowHeight+rodHeight+(H[hang] ?? 0); return { rodWidth, panelWidth, panelLength, totalFabric: panelWidth*panelCount*panelLength/144 };",
    "inputs": [
      {
        "name": "windowWidth",
        "type": "number",
        "default": 60,
        "min": 6,
        "max": 400,
        "step": 1,
        "slider": true
      },
      {
        "name": "windowHeight",
        "type": "number",
        "default": 60,
        "min": 6,
        "max": 300,
        "step": 1,
        "slider": true
      },
      {
        "name": "panelCount",
        "type": "number",
        "default": 2,
        "min": 1,
        "max": 10,
        "step": 1
      },
      {
        "name": "fullness",
        "type": "select",
        "default": "standard",
        "options": [
          {
            "value": "sheer"
          },
          {
            "value": "standard"
          },
          {
            "value": "deluxe"
          },
          {
            "value": "flat"
          }
        ]
      },
      {
        "name": "hang",
        "type": "select",
        "default": "floor",
        "options": [
          {
            "value": "sill"
          },
          {
            "value": "apron"
          },
          {
            "value": "floor"
          },
          {
            "value": "puddle"
          }
        ]
      },
      {
        "name": "rodHeight",
        "type": "number",
        "default": 4,
        "min": 0,
        "max": 24,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "rodWidth",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "panelWidth",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "panelLength",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "totalFabric",
        "precision": 1,
        "unit": "sq ft"
      }
    ],
    "interpret": null
  }
}
