{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://paramlet.com/tools/furniture-leg-cap/schema.json",
 "title": "Leg cap — parameters",
 "description": "Leg caps and tube inserts sized to your leg: round, square or rectangular, in flexible TPU or stiff PETG, with a levelling thread and a felt pad recess. 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": "furniture-leg-cap",
 "x-toolVersion": "1.0.0",
 "x-specVersion": "1.0",
 "x-apiVersion": "1",
 "x-groups": [
  {
   "id": "cap",
   "title": "Leg cap"
  },
  {
   "id": "fit",
   "title": "Fit"
  },
  {
   "id": "extras",
   "title": "Extras"
  },
  {
   "id": "look",
   "title": "Colours"
  },
  {
   "id": "print",
   "title": "Printing"
  }
 ],
 "x-presets": {
  "note": "Choosing a preset resets every key marked x-resetOnPreset to its default and then applies the preset values.",
  "items": [
   {
    "id": "round-chair-leg-cap-30mm",
    "title": "Round chair leg cap, 30 mm",
    "description": "A flexible TPU cap for a 30 mm round wooden chair leg: it grips the leg and the floor, and keeps the chair from scratching.",
    "values": {
     "kind": "cap",
     "profile": "round",
     "legA": 30,
     "legB": 30,
     "wall": 2,
     "height": 35,
     "base": 4,
     "clearance": -0.2,
     "corner": 2,
     "angle": 0,
     "lip": true,
     "felt": false,
     "flare": 0,
     "thread": "none",
     "coupon": false,
     "baseColor": "#0e7490",
     "material": "tpu",
     "layerHeight": 0.2,
     "wallCount": 4,
     "infill": 25
    }
   },
   {
    "id": "square-tube-leg-cap-40mm",
    "title": "Square tube cap, 40 mm",
    "description": "For a 40 by 40 mm square steel tube with rounded corners, the leg of a sofa, a bed or a cabinet. Measure your corner radius.",
    "values": {
     "kind": "cap",
     "profile": "square",
     "legA": 40,
     "legB": 30,
     "wall": 2,
     "height": 40,
     "base": 6,
     "clearance": -0.2,
     "corner": 3,
     "angle": 0,
     "lip": true,
     "felt": false,
     "flare": 0,
     "thread": "none",
     "coupon": false,
     "baseColor": "#1f2937",
     "material": "tpu",
     "layerHeight": 0.2,
     "wallCount": 4,
     "infill": 25
    }
   },
   {
    "id": "rect-tube-leg-cap-40x20mm",
    "title": "Rectangular tube cap, 40 × 20 mm",
    "description": "For a 40 by 20 mm rectangular tube, the leg of a bed frame or a shelving unit. Set A to the long side and B to the short one.",
    "values": {
     "kind": "cap",
     "profile": "rect",
     "legA": 40,
     "legB": 20,
     "wall": 2,
     "height": 35,
     "base": 5,
     "clearance": -0.2,
     "corner": 2,
     "angle": 0,
     "lip": true,
     "felt": false,
     "flare": 0,
     "thread": "none",
     "coupon": false,
     "baseColor": "#1f4e8c",
     "material": "tpu",
     "layerHeight": 0.2,
     "wallCount": 4,
     "infill": 25
    }
   },
   {
    "id": "leg-cap-with-felt-pad",
    "title": "Leg cap with a felt pad",
    "description": "A 32 mm round cap with a recess in the bottom for a self-adhesive felt pad: the chair slides on a hard floor without a mark.",
    "values": {
     "kind": "cap",
     "profile": "round",
     "legA": 32,
     "legB": 30,
     "wall": 2,
     "height": 35,
     "base": 5,
     "clearance": -0.2,
     "corner": 2,
     "angle": 0,
     "lip": true,
     "felt": true,
     "flare": 0,
     "thread": "none",
     "coupon": false,
     "baseColor": "#3f6212",
     "material": "tpu",
     "layerHeight": 0.2,
     "wallCount": 4,
     "infill": 25
    }
   },
   {
    "id": "leaning-chair-leg-cap",
    "title": "Leaning chair leg cap",
    "description": "For a splayed leg at 12 degrees: the bottom is cut level, so that the cap sits flat while its opening stays square to the leg.",
    "values": {
     "kind": "cap",
     "profile": "round",
     "legA": 28,
     "legB": 30,
     "wall": 2,
     "height": 35,
     "base": 4,
     "clearance": -0.2,
     "corner": 2,
     "angle": 12,
     "lip": true,
     "felt": true,
     "flare": 0,
     "thread": "none",
     "coupon": false,
     "baseColor": "#a16207",
     "material": "tpu",
     "layerHeight": 0.2,
     "wallCount": 4,
     "infill": 25
    }
   },
   {
    "id": "levelling-foot-cap-m8",
    "title": "Levelling foot cap, M8 thread",
    "description": "A stiff PETG cap with an M8 threaded hole in the base for a screw-in levelling foot, on a table or a cabinet that stands uneven.",
    "values": {
     "kind": "cap",
     "profile": "round",
     "legA": 35,
     "legB": 30,
     "wall": 2,
     "height": 35,
     "base": 6,
     "clearance": 0.2,
     "corner": 2,
     "angle": 0,
     "lip": false,
     "felt": false,
     "flare": 0,
     "thread": "m8",
     "coupon": false,
     "baseColor": "#374151",
     "material": "petg",
     "layerHeight": 0.16,
     "wallCount": 6,
     "infill": 100
    }
   },
   {
    "id": "square-tube-insert-m8",
    "title": "Square tube insert, 25 mm, M8 thread",
    "description": "A stiff PETG insert that pushes into a 25 mm square tube, the leg of a flat-pack bed or sofa, and takes an M8 bolt for a new foot.",
    "values": {
     "kind": "insert",
     "profile": "square",
     "legA": 25,
     "legB": 30,
     "wall": 2,
     "height": 35,
     "base": 8,
     "clearance": 0.2,
     "corner": 2,
     "angle": 0,
     "lip": false,
     "felt": false,
     "flare": 0,
     "thread": "m8",
     "coupon": false,
     "baseColor": "#b45309",
     "material": "petg",
     "layerHeight": 0.16,
     "wallCount": 6,
     "infill": 100
    }
   },
   {
    "id": "tube-insert-m10",
    "title": "Round tube insert, 40 mm, M10 thread",
    "description": "A stiff PETG insert that pushes into a 40 mm round tube and takes an M10 bolt: a sofa leg, a bed riser, a replacement foot.",
    "values": {
     "kind": "insert",
     "profile": "round",
     "legA": 40,
     "legB": 30,
     "wall": 2,
     "height": 40,
     "base": 8,
     "clearance": 0.2,
     "corner": 2,
     "angle": 0,
     "lip": false,
     "felt": false,
     "flare": 0,
     "thread": "m10",
     "coupon": false,
     "baseColor": "#9a3412",
     "material": "petg",
     "layerHeight": 0.16,
     "wallCount": 6,
     "infill": 100
    }
   }
  ]
 },
 "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"
  }
 },
 "type": "object",
 "properties": {
  "kind": {
   "type": "string",
   "enum": [
    "cap",
    "insert"
   ],
   "x-enumTitles": {
    "cap": "Cap over the leg",
    "insert": "Insert into a tube"
   },
   "title": "Kind",
   "description": "A cap pulls over the leg from outside; an insert pushes into the opening of a hollow tube and screws or taps in.",
   "x-group": "cap",
   "x-agentSafe": true,
   "x-label-lv": "Veids",
   "default": "cap",
   "x-resetOnPreset": true
  },
  "profile": {
   "type": "string",
   "enum": [
    "round",
    "square",
    "rect"
   ],
   "x-enumTitles": {
    "round": "Round",
    "square": "Square",
    "rect": "Rectangle"
   },
   "title": "Leg profile",
   "description": "Measure the leg where the cap goes. Square and rectangular steel tube have rounded corners: their radius is a parameter of the fit.",
   "x-group": "cap",
   "x-agentSafe": true,
   "x-label-lv": "Kājas profils",
   "default": "round",
   "x-resetOnPreset": true
  },
  "legA": {
   "type": "number",
   "minimum": 8,
   "maximum": 80,
   "x-step": 0.5,
   "title": "Leg size A",
   "description": "The diameter of a round leg, or the long side of a square or rectangle. Measure across, not around.",
   "x-group": "cap",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Kājas izmērs A",
   "default": 30,
   "x-resetOnPreset": true
  },
  "legB": {
   "type": "number",
   "minimum": 8,
   "maximum": 80,
   "x-step": 0.5,
   "title": "Leg size B",
   "description": "The short side of a rectangular leg. Equal to A for a square.",
   "x-group": "cap",
   "x-unit": "mm",
   "x-visibleIf": {
    "profile": "rect"
   },
   "x-agentSafe": true,
   "x-label-lv": "Kājas izmērs B",
   "default": 30,
   "x-resetOnPreset": true
  },
  "wall": {
   "type": "number",
   "minimum": 1,
   "maximum": 3,
   "x-step": 0.25,
   "title": "Wall thickness",
   "description": "2 mm of TPU stretches over the leg and springs back; 1.5 mm for a tight fit on a big leg, 3 mm to last.",
   "x-group": "cap",
   "x-unit": "mm",
   "x-role": "core.wallThickness",
   "x-agentSafe": true,
   "x-label-lv": "Sienas biezums",
   "default": 2,
   "x-resetOnPreset": true
  },
  "height": {
   "type": "number",
   "minimum": 8,
   "maximum": 100,
   "multipleOf": 1,
   "title": "Height",
   "description": "How far the cap goes up the leg, or the insert into the tube. A cap holds better when it is longer.",
   "x-group": "cap",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Augstums",
   "default": 35,
   "x-resetOnPreset": true
  },
  "base": {
   "type": "number",
   "minimum": 2,
   "maximum": 15,
   "x-step": 0.5,
   "title": "Base thickness",
   "description": "Of the floor under the leg: 4 mm for a chair, 8 mm or more for a sofa or a bed. On an insert, the plate the tube stands on.",
   "x-group": "cap",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Pamata biezums",
   "default": 4,
   "x-resetOnPreset": true
  },
  "clearance": {
   "type": "number",
   "minimum": -0.3,
   "maximum": 0.5,
   "x-step": 0.05,
   "title": "Clearance per side",
   "description": "Room between the cap and the leg, on each side. TPU stretches: minus 0.2 grips and stays on when the chair is dragged. PETG and PLA do not: plus 0.2 to slide on.",
   "x-group": "fit",
   "x-unit": "mm",
   "x-role": "core.clearance",
   "x-agentSafe": true,
   "x-label-lv": "Atstarpe katrā pusē",
   "default": -0.2,
   "x-resetOnPreset": true
  },
  "corner": {
   "type": "number",
   "minimum": 0,
   "maximum": 8,
   "x-step": 0.5,
   "title": "Corner radius",
   "description": "Of the leg's corners: 0 for a sharp wooden leg, 1.5 to 3 for steel tube, more for aluminium.",
   "x-group": "fit",
   "x-unit": "mm",
   "x-visibleIf": {
    "profile": [
     "square",
     "rect"
    ]
   },
   "x-agentSafe": true,
   "x-label-lv": "Stūra rādiuss",
   "default": 2,
   "x-resetOnPreset": true
  },
  "angle": {
   "type": "number",
   "minimum": 0,
   "maximum": 20,
   "multipleOf": 1,
   "title": "Leg angle",
   "description": "How far the leg leans out from upright. The bottom is cut level, so that the cap sits flat on the floor.",
   "x-group": "fit",
   "x-unit": "deg",
   "x-visibleIf": {
    "kind": "cap"
   },
   "x-agentSafe": true,
   "x-label-lv": "Kājas slīpums",
   "default": 0,
   "x-resetOnPreset": true
  },
  "lip": {
   "type": "integer",
   "enum": [
    0,
    1
   ],
   "title": "Grip lip",
   "description": "A ridge round the opening that catches the leg, so that the cap does not slide off. Leave it off for a rigid cap.",
   "x-group": "fit",
   "x-visibleIf": {
    "kind": "cap"
   },
   "x-agentSafe": true,
   "x-label-lv": "Turēšanas lūpa",
   "default": 1,
   "x-resetOnPreset": true
  },
  "felt": {
   "type": "integer",
   "enum": [
    0,
    1
   ],
   "title": "Felt pad recess",
   "description": "A round recess in the bottom for a self-adhesive felt pad, so that the chair slides instead of scratching.",
   "x-group": "extras",
   "x-visibleIf": {
    "kind": "cap"
   },
   "x-agentSafe": true,
   "x-label-lv": "Filca spilventiņa ligzda",
   "default": 0,
   "x-resetOnPreset": true
  },
  "flare": {
   "type": "number",
   "minimum": 0,
   "maximum": 20,
   "multipleOf": 1,
   "title": "Base flare",
   "description": "How far the base spreads beyond the cap, for a steadier foot or a riser. 0: none.",
   "x-group": "extras",
   "x-unit": "mm",
   "x-visibleIf": {
    "kind": "cap"
   },
   "x-agentSafe": true,
   "x-label-lv": "Pamata izpleties",
   "default": 0,
   "x-resetOnPreset": true
  },
  "thread": {
   "type": "string",
   "enum": [
    "none",
    "m6",
    "m8",
    "m10"
   ],
   "x-enumTitles": {
    "none": "None",
    "m6": "M6",
    "m8": "M8",
    "m10": "M10"
   },
   "title": "Leveller thread",
   "description": "A threaded hole through the base for a screw-in levelling foot. Print it in PETG, not TPU. On a leg too narrow for it, the thread is left out, and the page says so.",
   "x-group": "extras",
   "x-agentSafe": true,
   "x-label-lv": "Regulēšanas vītne",
   "default": "none",
   "x-resetOnPreset": true
  },
  "coupon": {
   "type": "integer",
   "enum": [
    0,
    1
   ],
   "title": "Fit coupon",
   "description": "A short piece of the cap's wall or of the insert to try on the leg before printing the whole thing.",
   "x-group": "fit",
   "x-agentSafe": true,
   "x-label-lv": "Pielaides paraugs",
   "default": 0,
   "x-resetOnPreset": true
  },
  "baseColor": {
   "type": "string",
   "pattern": "^#[0-9a-fA-F]{6}$",
   "title": "Cap colour",
   "description": "The cap and its coupon.",
   "x-group": "look",
   "x-role": "core.previewColor",
   "x-agentSafe": true,
   "x-label-lv": "Uzgaļa krāsa",
   "default": "#0e7490",
   "x-resetOnPreset": true
  },
  "material": {
   "type": "string",
   "enum": [
    "tpu",
    "petg",
    "pla"
   ],
   "x-enumTitles": {
    "tpu": "TPU 95A",
    "petg": "PETG",
    "pla": "PLA"
   },
   "title": "Filament",
   "description": "TPU 95A for a cap: it stretches over the leg, grips and protects the floor. PETG for an insert or a levelling foot: stiff, and the thread prints clean.",
   "x-group": "print",
   "x-role": "core.printMaterial",
   "x-agentSafe": true,
   "x-label-lv": "Filaments",
   "default": "tpu",
   "x-resetOnPreset": true
  },
  "layerHeight": {
   "type": "number",
   "minimum": 0.12,
   "maximum": 0.3,
   "x-step": 0.02,
   "title": "Layer height",
   "description": "0.2 mm for TPU; 0.16 mm for a thread, so that its flanks come out straight.",
   "x-group": "print",
   "x-unit": "mm",
   "x-agentSafe": true,
   "x-label-lv": "Slāņa augstums",
   "default": 0.2,
   "x-resetOnPreset": true
  },
  "wallCount": {
   "type": "integer",
   "minimum": 2,
   "maximum": 8,
   "multipleOf": 1,
   "title": "Perimeter walls",
   "description": "A cap is all walls: four lines make 2 mm solid, which stretches without tearing.",
   "x-group": "print",
   "x-unit": "count",
   "x-role": "print.wallCount",
   "x-agentSafe": true,
   "x-label-lv": "Sienu skaits",
   "default": 4,
   "x-resetOnPreset": true
  },
  "infill": {
   "type": "integer",
   "minimum": 10,
   "maximum": 100,
   "multipleOf": 5,
   "title": "Infill",
   "description": "25 % in the base of a TPU cap keeps it springy; 100 % in a PETG insert or a levelling foot.",
   "x-group": "print",
   "x-unit": "pct",
   "x-role": "print.infill",
   "x-agentSafe": true,
   "x-label-lv": "Aizpildījums",
   "default": 25,
   "x-resetOnPreset": true
  }
 },
 "additionalProperties": false,
 "recommended_materials": [
  {
   "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)"
  }
 ]
}