{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://paramlet.com/tools/pi-case/schema.json",
 "title": "Raspberry Pi case generator — parameters",
 "description": "Generate a 3D-printable vented case for Raspberry Pi 5, Pi 4, or Zero 2 W with official hole patterns, fan clearance, GPIO slot, and wall or VESA mounts. All lengths are millimetres. Unknown keys are rejected; out-of-range values are rejected by the URL and API and clamped when a project file is opened.",
 "x-tool": "pi-case",
 "x-toolVersion": "1.3.0",
 "x-specVersion": "1.0",
 "x-apiVersion": "1",
 "x-groups": [
  {
   "id": "board",
   "title": "Board & dimensions"
  },
  {
   "id": "enclosure",
   "title": "Case, vents & cooling"
  },
  {
   "id": "mounting",
   "title": "Mounting & print"
  },
  {
   "id": "look",
   "title": "Colour"
  }
 ],
 "x-presets": {
  "note": "Choosing a preset resets every key marked x-resetOnPreset to its default and then applies the preset values.",
  "items": [
   {
    "id": "measure-your-own",
    "title": "Measure your own board",
    "description": "Generic SBC enclosure: enter your own measured PCB length, width, hole pattern, and cooler height.",
    "values": {
     "boardProfile": "generic",
     "pcbLength": 85,
     "pcbWidth": 56,
     "holeSpacingX": 58,
     "holeSpacingY": 49,
     "holeDia": 2.7,
     "holeInset": 3.5,
     "cornerRadius": 3,
     "innerHeight": 24,
     "fanSize": "none",
     "mountStyle": "desk",
     "color": "#e85d22",
     "lidColor": "#f4f1ea"
    }
   },
   {
    "id": "fits-raspberry-pi-5",
    "title": "Fits Raspberry Pi 5",
    "description": "Exact 85×56 mm PCB, 58×49 mm Ø2.7 mm holes (3.5 mm inset) from the official Raspberry Pi 5 mechanical drawing. 26 mm internal height clears the official Active Cooler. Not affiliated with or endorsed by Raspberry Pi.",
    "values": {
     "boardProfile": "pi5",
     "pcbLength": 85,
     "pcbWidth": 56,
     "holeSpacingX": 58,
     "holeSpacingY": 49,
     "holeDia": 2.7,
     "holeInset": 3.5,
     "cornerRadius": 3,
     "innerHeight": 26,
     "fanSize": "none",
     "lidVents": true,
     "gpioSlot": true,
     "mountStyle": "desk",
     "material": "petg",
     "color": "#2563eb",
     "lidColor": "#dbe7f3"
    }
   },
   {
    "id": "fits-raspberry-pi-4",
    "title": "Fits Raspberry Pi 4 Model B",
    "description": "Exact 85×56 mm PCB, 58×49 mm Ø2.7 mm holes, R3 corners, USB Z 16.0 mm and RJ45 Z 13.5 mm from the official Raspberry Pi 4 mechanical drawing. Not affiliated with or endorsed by Raspberry Pi.",
    "values": {
     "boardProfile": "pi4",
     "pcbLength": 85,
     "pcbWidth": 56,
     "holeSpacingX": 58,
     "holeSpacingY": 49,
     "holeDia": 2.7,
     "holeInset": 3.5,
     "cornerRadius": 3,
     "innerHeight": 24,
     "fanSize": "30",
     "lidVents": true,
     "gpioSlot": true,
     "mountStyle": "desk",
     "material": "petg",
     "color": "#15803d",
     "lidColor": "#e9efe3"
    }
   },
   {
    "id": "fits-raspberry-pi-zero-2-w",
    "title": "Fits Raspberry Pi Zero 2 W",
    "description": "Exact 65×30 mm PCB, 58×23 mm Ø2.7 mm holes (3.5 mm inset) from the official Raspberry Pi Zero 2 W mechanical drawing. Not affiliated with or endorsed by Raspberry Pi.",
    "values": {
     "boardProfile": "zero2w",
     "pcbLength": 65,
     "pcbWidth": 30,
     "holeSpacingX": 58,
     "holeSpacingY": 23,
     "holeDia": 2.7,
     "holeInset": 3.5,
     "cornerRadius": 3,
     "innerHeight": 16,
     "fanSize": "none",
     "lidVents": true,
     "gpioSlot": true,
     "mountStyle": "wall",
     "material": "petg",
     "color": "#d97706",
     "lidColor": "#1f2a37"
    }
   }
  ]
 },
 "x-coreParams": {
  "exportFormat": {
   "type": "string",
   "title": "File format",
   "description": "3mf = 3MF (mm); stl = STL files in a zip (mm)",
   "x-group": "download",
   "x-role": "core.exportFormat",
   "x-unit": "none",
   "x-agentSafe": true,
   "enum": [
    "3mf",
    "stl"
   ],
   "default": "3mf"
  },
  "exportTol": {
   "type": "number",
   "title": "Mesh precision",
   "description": "Simplification tolerance in mm (0 = original mesh).",
   "x-group": "download",
   "x-role": "core.exportTolerance",
   "x-unit": "mm",
   "x-agentSafe": true,
   "enum": [
    0,
    0.01,
    0.02
   ],
   "default": 0.02
  },
  "units": {
   "type": "string",
   "title": "Units shown",
   "description": "Display only: mm or inches (1 in = 25.4 mm). Stored values, the API and exports are always mm.",
   "x-group": "view",
   "x-role": "core.displayUnits",
   "x-unit": "none",
   "x-agentSafe": true,
   "enum": [
    "mm",
    "in"
   ],
   "x-enumTitles": {
    "mm": "Millimetres",
    "in": "Inches"
   },
   "default": "mm"
  },
  "massUnits": {
   "type": "string",
   "title": "Weight shown in",
   "description": "Display only: grams or ounces (1 oz = 28.3495 g). Stored values, the API and exports are always grams.",
   "x-group": "view",
   "x-role": "core.displayMassUnits",
   "x-unit": "none",
   "x-agentSafe": true,
   "enum": [
    "g",
    "oz"
   ],
   "x-enumTitles": {
    "g": "Grams",
    "oz": "Ounces"
   },
   "default": "g"
  }
 },
 "type": "object",
 "properties": {
  "boardProfile": {
   "type": "string",
   "enum": [
    "generic",
    "pi5",
    "pi4",
    "zero2w"
   ],
   "x-enumTitles": {
    "generic": "Generic / Measure your own",
    "pi5": "Raspberry Pi 5",
    "pi4": "Raspberry Pi 4 Model B",
    "zero2w": "Raspberry Pi Zero 2 W"
   },
   "title": "Port layout profile",
   "description": "Sets where the openings for the ports are cut. Pick the board you have, or the generic layout for any other board and measure it. Sizes come from the presets.",
   "x-group": "board",
   "x-agentSafe": true,
   "x-label-lv": "Portu izkārtojums",
   "default": "generic"
  },
  "pcbLength": {
   "type": "number",
   "minimum": 35,
   "maximum": 160,
   "x-step": 0.5,
   "title": "PCB length",
   "description": "Length of the board from side to side.",
   "x-group": "board",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Plates garums",
   "default": 85
  },
  "pcbWidth": {
   "type": "number",
   "minimum": 20,
   "maximum": 120,
   "x-step": 0.5,
   "title": "PCB width",
   "description": "Width of the board from front to back.",
   "x-group": "board",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Plates platums",
   "default": 56
  },
  "holeSpacingX": {
   "type": "number",
   "minimum": 15,
   "maximum": 145,
   "x-step": 0.5,
   "title": "Hole spacing X",
   "description": "Distance between the centres of the two mounting holes along the length of the board: 58 mm on all three presets.",
   "x-group": "board",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Caurumu attālums X",
   "default": 58
  },
  "holeSpacingY": {
   "type": "number",
   "minimum": 10,
   "maximum": 110,
   "x-step": 0.5,
   "title": "Hole spacing Y",
   "description": "Distance between the holes across the board: 49 mm on a Pi 4 or Pi 5, 23 mm on a Zero 2 W.",
   "x-group": "board",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Caurumu attālums Y",
   "default": 49
  },
  "holeDia": {
   "type": "number",
   "minimum": 2,
   "maximum": 4,
   "x-step": 0.1,
   "title": "Mounting hole Ø",
   "description": "Diameter of the mounting holes in the board. Each standoff gets a pin 0.5 mm thinner, and the board is pushed onto the pins.",
   "x-group": "board",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Skrūvju cauruma Ø",
   "default": 2.7
  },
  "holeInset": {
   "type": "number",
   "minimum": 2,
   "maximum": 12,
   "x-step": 0.5,
   "title": "Hole inset from edge",
   "description": "Distance of a mounting hole from the edge of the board: 3.5 mm on all three presets.",
   "x-group": "board",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Cauruma atkāpe no malas",
   "default": 3.5
  },
  "cornerRadius": {
   "type": "number",
   "minimum": 0,
   "maximum": 8,
   "x-step": 0.5,
   "title": "Corner radius",
   "description": "Radius of the corners of the board. The case follows it, up to 6 mm.",
   "x-group": "board",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Stūru rādiuss",
   "default": 3
  },
  "innerHeight": {
   "type": "number",
   "minimum": 14,
   "maximum": 50,
   "multipleOf": 1,
   "title": "Internal height (cooler / HAT)",
   "description": "Room above the board, for coolers and add-on boards. A Pi 4 or Pi 5 gets at least 18 mm so that the lid clears the USB sockets.",
   "x-group": "enclosure",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Iekšējais augstums (dzesētājam)",
   "default": 25
  },
  "wallThickness": {
   "type": "number",
   "minimum": 1.6,
   "maximum": 4,
   "x-step": 0.2,
   "title": "Wall thickness",
   "description": "Thickness of the walls of the case. 2 mm or more keeps the lip of the lid from breaking.",
   "x-group": "enclosure",
   "x-unit": "mm",
   "x-role": "core.wallThickness",
   "x-agentSafe": true,
   "x-label-lv": "Sienu biezums",
   "default": 2.2
  },
  "pcbClearance": {
   "type": "number",
   "minimum": 0.3,
   "maximum": 2,
   "x-step": 0.1,
   "title": "PCB side clearance",
   "description": "Gap between the edge of the board and the wall, on every side.",
   "x-group": "enclosure",
   "x-unit": "mm",
   "x-role": "core.clearance",
   "x-agentSafe": true,
   "x-label-lv": "Plates sānu atstarpe",
   "default": 0.6
  },
  "portClearance": {
   "type": "number",
   "minimum": 0.5,
   "maximum": 2.5,
   "x-step": 0.1,
   "title": "Port cut-out margin",
   "description": "Extra room around every port opening. 1 mm lets a cable with a wide plug reach its socket; take more for oversized plugs.",
   "x-group": "enclosure",
   "x-unit": "mm",
   "x-role": "core.clearance",
   "x-agentSafe": true,
   "x-label-lv": "Portu izgriezuma rezerve",
   "default": 1
  },
  "fanSize": {
   "type": "string",
   "enum": [
    "none",
    "30",
    "40"
   ],
   "x-enumTitles": {
    "30": "30 mm fan mount",
    "40": "40 mm fan mount",
    "none": "Vents only (no fan)"
   },
   "title": "Top fan opening",
   "description": "An opening in the lid for a fan, with its four screw holes. Without a fan the lid gets slots. A fan too large for the board is replaced by slots, and the page says so.",
   "x-group": "enclosure",
   "x-agentSafe": true,
   "x-label-lv": "Augšējā ventilatora atvere",
   "default": "none"
  },
  "gpioSlot": {
   "type": "integer",
   "enum": [
    0,
    1
   ],
   "title": "GPIO ribbon slot in lid",
   "description": "A slot in the lid over the 40-pin header, for a ribbon cable.",
   "x-group": "enclosure",
   "x-agentSafe": true,
   "x-label-lv": "GPIO kabeļa sprauga vākā",
   "default": 1
  },
  "lidVents": {
   "type": "integer",
   "enum": [
    0,
    1
   ],
   "title": "Top ventilation slots",
   "description": "Slots in the lid, so that air can move through the case.",
   "x-group": "enclosure",
   "x-visibleIf": {
    "fanSize": "none"
   },
   "x-agentSafe": true,
   "x-label-lv": "Augšējās ventilācijas spraugas",
   "default": 1
  },
  "mountStyle": {
   "type": "string",
   "enum": [
    "desk",
    "wall",
    "vesa75",
    "vesa100"
   ],
   "x-enumTitles": {
    "desk": "Desk case",
    "wall": "Wall keyhole ears",
    "vesa75": "VESA 75 mm mount tabs",
    "vesa100": "VESA 100 mm mount tabs"
   },
   "title": "Mounting style",
   "description": "Desk: no ears. Wall: tabs with keyhole slots for two screws. VESA 75 or 100: tabs with 4.5 mm holes for the standard monitor pattern.",
   "x-group": "mounting",
   "x-agentSafe": true,
   "x-label-lv": "Stiprinājuma veids",
   "default": "desk"
  },
  "material": {
   "type": "string",
   "enum": [
    "petg",
    "asa",
    "pla"
   ],
   "x-enumTitles": {
    "petg": "PETG (recommended, 68 °C HDT)",
    "asa": "ASA (high heat)",
    "pla": "PLA (55 °C HDT — caution)"
   },
   "title": "Filament material",
   "description": "PETG for a Pi 5 or a Pi 4 that runs all day. ASA in a hot cupboard. PLA only for a board that does little: it softens at about 55 °C.",
   "x-group": "mounting",
   "x-role": "core.printMaterial",
   "x-agentSafe": true,
   "x-label-lv": "Filamenta materiāls",
   "default": "petg"
  },
  "wallCount": {
   "type": "integer",
   "minimum": 2,
   "maximum": 6,
   "multipleOf": 1,
   "title": "Perimeter walls",
   "description": "Perimeter lines. Four or more make the lip of the lid and the standoffs solid.",
   "x-group": "mounting",
   "x-unit": "count",
   "x-role": "print.wallCount",
   "x-agentSafe": true,
   "x-label-lv": "Sienu skaits",
   "default": 3
  },
  "infill": {
   "type": "integer",
   "minimum": 5,
   "maximum": 100,
   "multipleOf": 5,
   "title": "Infill",
   "description": "20 % is enough. The board rests on the standoffs, not on the floor.",
   "x-group": "mounting",
   "x-unit": "pct",
   "x-role": "print.infill",
   "x-agentSafe": true,
   "x-label-lv": "Aizpildījums",
   "default": 20
  },
  "lidTexture": {
   "type": "string",
   "enum": [
    "none",
    "hex",
    "diamond",
    "waves",
    "dots",
    "basketweave",
    "wood",
    "hammered",
    "folk"
   ],
   "x-enumTitles": {
    "none": "Smooth (plain)",
    "hex": "Honeycomb",
    "diamond": "Diamond lattice",
    "waves": "Flowing waves",
    "dots": "Polka dots",
    "basketweave": "Basketweave",
    "wood": "Woodgrain",
    "hammered": "Hammered / slate",
    "folk": "Latvian folk motif"
   },
   "title": "Lid surface texture",
   "description": "Optional carved relief on the exterior of the lid (printed face-down on the bed); fan opening, vents and GPIO slot stay flat.",
   "x-group": "look",
   "x-agentSafe": true,
   "x-label-lv": "Vāka virsmas tekstūra",
   "default": "none",
   "x-resetOnPreset": true
  },
  "textureDepth": {
   "type": "number",
   "minimum": 0.3,
   "maximum": 0.6,
   "x-step": 0.1,
   "title": "Texture depth",
   "description": "Engraved depth into the lid face (0.4 mm is two 0.2 mm layers and bridges cleanly on the build plate).",
   "x-group": "look",
   "x-unit": "mm",
   "x-visibleIf": {
    "lidTexture": {
     "ne": "none"
    }
   },
   "x-agentSafe": true,
   "x-label-lv": "Tekstūras dziļums",
   "default": 0.4,
   "x-resetOnPreset": true
  },
  "textureScale": {
   "type": "number",
   "minimum": 4,
   "maximum": 18,
   "multipleOf": 1,
   "title": "Texture scale",
   "description": "Size of one repeating pattern cell in millimetres.",
   "x-group": "look",
   "x-unit": "mm",
   "x-visibleIf": {
    "lidTexture": {
     "ne": "none"
    }
   },
   "x-agentSafe": true,
   "x-label-lv": "Tekstūras mērogs",
   "default": 8,
   "x-resetOnPreset": true
  },
  "color": {
   "type": "string",
   "pattern": "^#[0-9a-fA-F]{6}$",
   "title": "Colour",
   "description": "Colour of the case. The lid follows it unless it gets a colour of its own. A dark case in the sun gets warmer than a light one.",
   "x-group": "look",
   "x-role": "core.previewColor",
   "x-agentSafe": true,
   "x-label-lv": "Krāsa",
   "default": "#23252b"
  },
  "lidColor": {
   "type": "string",
   "pattern": "^#[0-9a-fA-F]{6}$",
   "title": "Lid colour",
   "description": "The lid follows the main colour until you pick another one here: then a two-colour case from two filaments, with no nozzle change.",
   "x-group": "look",
   "x-agentSafe": true,
   "x-label-lv": "Vāka krāsa",
   "default": "#23252b"
  }
 },
 "additionalProperties": false,
 "recommended_materials": [
  {
   "id": "pi5-4gb",
   "title": "Raspberry Pi 5 (4 GB)",
   "why": "Exact match for the Fits Raspberry Pi 5 preset (85×56 mm PCB, 58×49 mm holes, official drawing).",
   "url": "https://paramlet.com/go/pi5-4gb?src=agent",
   "relation": "material",
   "disclosure": "Affiliate link (Amazon Associates, tag paramlet-21)"
  },
  {
   "id": "pi5-8gb",
   "title": "Raspberry Pi 5 (8 GB)",
   "why": "8 GB RAM variant of Raspberry Pi 5 — identical 85×56 mm PCB and port layout.",
   "url": "https://paramlet.com/go/pi5-8gb?src=agent",
   "relation": "material",
   "disclosure": "Affiliate link (Amazon Associates, tag paramlet-21)"
  },
  {
   "id": "pi4-4gb",
   "title": "Raspberry Pi 4 Model B (4 GB)",
   "why": "Exact match for the Fits Raspberry Pi 4 preset (85×56 mm PCB, R3 corners, official drawing).",
   "url": "https://paramlet.com/go/pi4-4gb?src=agent",
   "relation": "material",
   "disclosure": "Affiliate link (Amazon Associates, tag paramlet-21)"
  },
  {
   "id": "petg-filament-1kg",
   "title": "PETG Filament 1.75 mm (1 kg) — heat-resistant & durable",
   "why": "Stronger and more heat-resistant than PLA for molds, jigs and outdoor parts.",
   "url": "https://paramlet.com/go/petg-filament-1kg?src=agent",
   "relation": "material",
   "disclosure": "Affiliate link (Amazon Associates, tag paramlet-21)"
  }
 ]
}