{
  "version": "v1",
  "source": "https://craftquantities.com",
  "licence": "CC BY 4.0",
  "licenceUrl": "https://creativecommons.org/licenses/by/4.0/",
  "attribution": "Craft Quantities — craftquantities.com",
  "documentation": "https://craftquantities.com/api/",
  "versioning": "Fields are added, never removed or repurposed, within a version. A breaking change becomes /api/v2/ and v1 keeps being built.",
  "slug": "gambrel-roof-rafter-calculator",
  "category": "materials-quantities",
  "title": "Gambrel Roof Rafter Geometry Calculator",
  "description": "Calculate total rafter length for a two-slope gambrel (barn-style) roof from building width and each segment's pitch.",
  "url": "https://craftquantities.com/calculators/materials-quantities/gambrel-roof-rafter-calculator/",
  "json": "https://craftquantities.com/api/v1/calculators/gambrel-roof-rafter-calculator.json",
  "inputCount": 4,
  "testCaseCount": 2,
  "sourceCount": 1,
  "lastVerified": "2026-09-02",
  "translations": {
    "es-US": "https://craftquantities.com/es/calculators/materials-quantities/gambrel-roof-rafter-calculator/"
  },
  "citation": {
    "author": "Craft Quantities",
    "title": "Gambrel Roof Rafter Geometry Calculator",
    "version": "1.0.1",
    "sourcesChecked": "2026-09-02",
    "url": "https://craftquantities.com/calculators/materials-quantities/gambrel-roof-rafter-calculator/",
    "accessDate": null,
    "accessDateNote": "Add the date you retrieved this. It is deliberately absent: a static file cannot know when you read it, and the build date would be wrong.",
    "permanentVersionedUrl": null,
    "permanentVersionedUrlNote": "Not offered. This site keeps no archive of previous builds, so any such URL would resolve to the current page or to nothing. The version and sourcesChecked fields identify the calculation instead.",
    "formats": {
      "plain": "Craft Quantities. Gambrel Roof Rafter Geometry Calculator. Version 1.0.1. Sources checked 2026-09-02. https://craftquantities.com/calculators/materials-quantities/gambrel-roof-rafter-calculator/",
      "apa": "Craft Quantities. (2026). Gambrel Roof Rafter Geometry Calculator (Version 1.0.1) [Web calculator]. Retrieved from https://craftquantities.com/calculators/materials-quantities/gambrel-roof-rafter-calculator/",
      "harvard": "Craft Quantities (2026) Gambrel Roof Rafter Geometry Calculator (Version 1.0.1). Available at: https://craftquantities.com/calculators/materials-quantities/gambrel-roof-rafter-calculator/",
      "bibtex": "@misc{craftquantities-calculators-materials-quantities-gambrel-roof-rafter-calculator,\n  author       = {{Craft Quantities}},\n  title        = {Gambrel Roof Rafter Geometry Calculator},\n  version      = {1.0.1},\n  year         = {2026},\n  howpublished = {\\url{https://craftquantities.com/calculators/materials-quantities/gambrel-roof-rafter-calculator/}},\n}"
    }
  },
  "inputs": [
    {
      "id": "buildingWidth",
      "label": "Building Width",
      "type": "number",
      "dimension": "length",
      "defaultValue": 8,
      "min": 0.01,
      "max": 20,
      "step": 0.1,
      "help": "The overall building width the gambrel roof spans."
    },
    {
      "id": "lowerPitch",
      "label": "Lower (Steep) Segment Pitch (rise per 12)",
      "type": "number",
      "defaultValue": 24,
      "min": 12,
      "max": 30,
      "step": 1,
      "help": "The steeper lower roof segment's pitch, as rise per 12 units of run."
    },
    {
      "id": "upperPitch",
      "label": "Upper (Shallow) Segment Pitch (rise per 12)",
      "type": "number",
      "defaultValue": 6,
      "min": 2,
      "max": 12,
      "step": 0.5,
      "help": "The shallower upper roof segment's pitch, as rise per 12 units of run."
    },
    {
      "id": "breakPointRatio",
      "label": "Break Point (fraction of half-width, lower segment)",
      "type": "number",
      "defaultValue": 0.5,
      "min": 0.2,
      "max": 0.8,
      "step": 0.05,
      "help": "The fraction of the half-building-width covered by the lower segment's run before transitioning to the upper segment."
    }
  ],
  "sources": [
    {
      "label": "Standard rafter-length trigonometry applied independently to each of the gambrel roof's two slope segments: segment length = segment run × √(1+(segment pitch/12)²)"
    }
  ],
  "testCases": [
    {
      "name": "8m width, 24/6 pitch, 0.5 break",
      "inputs": {
        "buildingWidth": 8,
        "lowerPitch": 24,
        "upperPitch": 6,
        "breakPointRatio": 0.5
      },
      "expected": 6.708,
      "toleranceDecimalPlaces": 1,
      "unit": "m",
      "confidence": "high",
      "steps": [
        {
          "label": "Lower segment length",
          "value": 4.47213595499958,
          "unit": "m"
        },
        {
          "label": "Upper segment length",
          "value": 2.23606797749979,
          "unit": "m"
        }
      ],
      "basis": "sole-source",
      "sourceIndex": 0
    },
    {
      "name": "10m width, 20/8 pitch, 0.4 break",
      "inputs": {
        "buildingWidth": 10,
        "lowerPitch": 20,
        "upperPitch": 8,
        "breakPointRatio": 0.4
      },
      "expected": 7.493,
      "toleranceDecimalPlaces": 1,
      "unit": "m",
      "confidence": "high",
      "steps": [
        {
          "label": "Lower segment length",
          "value": 3.8873012632302006,
          "unit": "m"
        },
        {
          "label": "Upper segment length",
          "value": 3.6055512754639896,
          "unit": "m"
        }
      ],
      "basis": "sole-source",
      "sourceIndex": 0
    }
  ]
}
