{
  "schemaVersion": 1,
  "slug": "resin-calculator",
  "category": "diy-craft",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "61843a5bec21aaeadd74dbbe857fb4b50d4e24e4e8f7770b1c01403be389d689",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/resin-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": "Vₜ = V×N×(1+s÷100); A = Vₜ×a÷(a+b); C = Vₜ÷1000×p",
    "vars": [
      [
        "V",
        "Mould volume (mL)"
      ],
      [
        "N",
        "Number of moulds"
      ],
      [
        "s",
        "Shrinkage allowance (%)"
      ],
      [
        "a",
        "Part A ratio"
      ],
      [
        "b",
        "Part B ratio"
      ],
      [
        "Vₜ",
        "Total mix volume (mL)"
      ],
      [
        "A",
        "Part A amount (mL)"
      ],
      [
        "C",
        "Total cost"
      ],
      [
        "p",
        "Kit price per litre"
      ]
    ],
    "note": "A:B parts are by volume and must match the product label. A weight ratio needs density conversion; defaults are examples."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const total = mouldVolume*mouldCount*(1 + shrinkagePct/100); const parts = ratioA + ratioB; return { totalVolume: total, totalLitres: total/1000, partA: total*ratioA/parts, partB: total*ratioB/parts, totalCost: total/1000*kitPrice, costPerMould: mouldCount > 0 ? total/1000*kitPrice/mouldCount : 0 };",
    "inputs": [
      {
        "name": "mouldVolume",
        "type": "number",
        "default": 500,
        "min": 1,
        "max": 1000000,
        "step": 1
      },
      {
        "name": "mouldCount",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "ratioA",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "ratioB",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "shrinkagePct",
        "type": "number",
        "default": 3,
        "min": 0,
        "max": 30,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "kitPrice",
        "type": "number",
        "default": 30,
        "min": 0,
        "max": 10000,
        "step": 0.01
      }
    ],
    "outputs": [
      {
        "name": "totalVolume",
        "precision": 1,
        "unit": "ml"
      },
      {
        "name": "totalLitres",
        "precision": 3,
        "unit": "l"
      },
      {
        "name": "partA",
        "precision": 1,
        "unit": "ml"
      },
      {
        "name": "partB",
        "precision": 1,
        "unit": "ml"
      },
      {
        "name": "totalCost",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "costPerMould",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
