{
 "id": "procedural-kit-modeling",
 "title": "Procedural Kit Modeling with Verification (procgen-kit)",
 "aliases": [
  "parametric kit builder",
  "LLM-driven kit modeling"
 ],
 "domain": "procgen",
 "subdomain": "parametric modeling",
 "stage": "procedural",
 "realtime": "offline",
 "platforms": [
  "cpu",
  "python"
 ],
 "year_introduced": 2025,
 "inputs": [
  "text-prompt"
 ],
 "outputs": [
  "mesh",
  "graph"
 ],
 "style": "both",
 "dynamic": "static",
 "summary": "Describe a modular 3D kit as a short script that builds a parametric geometry graph, then mechanically check it: closed manifold meshes, every control swept across its range, touching parts and collision.",
 "how_it_works": "A kit builder script (typically written by a language model) declares parts, controls and their relationships; a native core turns it into a parametric geometry graph whose geometry is regenerated when controls change. A verification harness then sweeps each control to its limits and checks invariants: meshes stay closed and manifold, parts that should touch do touch, and collision tests (e.g. with convex decompositions in a physics engine) pass. Failures give the author concrete diagnostics to fix, so correctness is machine-checked instead of eyeballed. Renders (beauty, clay, parts passes) support review. This differs from random procedural generation: the output is a controllable, verified asset family.",
 "when_to_use": "Choose it when an LLM or script must produce parametric, game-ready modular kits (walls, gates, props) whose geometry has to be valid at every parameter setting. Prefer `cga-shape-grammar` for rule-based building facades at city scale, `greebling` for decorative surface noise, and `infinigen` for photorealistic natural scenes.",
 "cost": {
  "class": "offline",
  "notes": "Native geometry build is fast; the verification sweep multiplies cost by number of controls and test poses."
 },
 "failure_modes": [
  "Verification only covers swept controls and the checks it implements; unmodelled interactions can still fail",
  "Quality of the kit is bounded by the builder script, which a weak model may get geometrically wrong",
  "Complex organic forms are outside the parametric-part vocabulary",
  "Requires building the C++ core and a Python toolchain"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "gh:wrong-nebula/procgen-kit",
   "type": "code",
   "title": "wrong-nebula/procgen-kit",
   "description": "Procedural 3D kit modeler and verification harness for any LLM, cloud or local",
   "authors": [
    "wrong-nebula"
   ],
   "year": 2026,
   "venue": "GitHub",
   "url": "https://github.com/wrong-nebula/procgen-kit",
   "ids": {
    "repo": "wrong-nebula/procgen-kit"
   },
   "license": "MIT",
   "extra": {
    "stars": 22,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-23T07:35:19Z",
    "language": "Python",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wrong-nebula/procgen-kit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wrong-nebula/procgen-kit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wrong-nebula/procgen-kit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wrong-nebula/procgen-kit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wrong-nebula/procgen-kit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/wrong-nebula/procgen-kit",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "wrongnebula2026wrongd"
  }
 ],
 "presets": [
  {
   "id": "procedural-kit-modeling-live",
   "title": "Procedural Kit Modeling — manifold, contact-joint & clearance checks (left) vs parametric CAD assembly sweep (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_ARCH_SPAN": 0.58,
    "P_COL_HEIGHT": 0.72,
    "P_FLANGE_RAD": 0.28,
    "P_SPLIT": 0.48
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_ARCH_SPAN = 0.58; // P Arch Span [0.35, 0.82, 0.02]\nconst float P_COL_HEIGHT = 0.72; // P Column Height [0.42, 0.95, 0.02]\nconst float P_FLANGE_RAD = 0.28; // P Flange Radius [0.16, 0.38, 0.02]\nconst float P_SPLIT = 0.48; // P Verify / CAD Split [0.0, 1.0, 0.02]\n\nfloat sdBox(vec3 p, vec3 b) {\n  vec3 q = abs(p) - b;\n  return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);\n}\n\nfloat sdCylinder(vec3 p, float r, float h) {\n  vec2 d = abs(vec2(length(p.xz), p.y)) - vec2(r, h);\n  return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n}\n\n// Modular parametric architectural kit with exact contact constraints between base -> columns -> entablature -> finial!\nvec2 mapKit(vec3 p, float span, float colH, float flR) {\n  float baseTop = -0.52;\n  float colTop = baseTop + colH;\n\n  // Part 1: Stepped plinth base (exact top plane y = baseTop)\n  float dBase = sdBox(p - vec3(0.0, baseTop - 0.09, 0.0), vec3(span + flR + 0.08, 0.09, flR + 0.14)) - 0.015;\n  vec2 res = vec2(dBase, 1.0);\n\n  // Part 2: Twin interlocking fluted columns mating flush on y = baseTop and y = colTop\n  vec3 pSym = vec3(abs(p.x) - span * 0.78, p.y - (baseTop + colH * 0.5), p.z);\n  float ang = atan(pSym.z, pSym.x);\n  float flute = 0.012 * cos(ang * 10.0);\n  float dCol = sdCylinder(pSym, flR * 0.56 + flute, colH * 0.5);\n  // Lower & upper mating collar flanges snapped to exact joint planes\n  float dCollarB = sdCylinder(vec3(pSym.x, p.y - (baseTop + 0.035), pSym.z), flR * 0.78, 0.035);\n  float dCollarT = sdCylinder(vec3(pSym.x, p.y - (colTop - 0.035), pSym.z), flR * 0.78, 0.035);\n  float dCols = min(dCol, min(dCollarB, dCollarT));\n  if (dCols < res.x) res = vec2(dCols, 2.0);\n\n  // Part 3: Spanning architrave beam & carved arch void resting flush on y = colTop\n  float beamH = 0.24;\n  vec3 pBeam = p - vec3(0.0, colTop + beamH * 0.5, 0.0);\n  float dBeam = sdBox(pBeam, vec3(span + flR * 0.92, beamH * 0.5, flR * 0.72)) - 0.012;\n  float archCut = length(vec2(p.x, p.y - colTop)) - (span * 0.55);\n  dBeam = max(dBeam, -archCut);\n  if (dBeam < res.x) res = vec2(dBeam, 3.0);\n\n  // Part 4: Crown lantern finial snapped flush on top of architrave (y = colTop + beamH)\n  float finialY = colTop + beamH;\n  float dFinial = min(\n    sdCylinder(p - vec3(0.0, finialY + 0.08, 0.0), flR * 0.45, 0.08),\n    length(p - vec3(0.0, finialY + 0.22, 0.0)) - flR * 0.36\n  );\n  if (dFinial < res.x) res = vec2(dFinial, 4.0);\n\n  return res;\n}\n\nvec3 calcNormal(vec3 p, float span, float colH, float flR) {\n  vec2 e = vec2(0.002, 0.0);\n  return normalize(vec3(\n    mapKit(p + e.xyy, span, colH, flR).x - mapKit(p - e.xyy, span, colH, flR).x,\n    mapKit(p + e.yxy, span, colH, flR).x - mapKit(p - e.yxy, span, colH, flR).x,\n    mapKit(p + e.yyx, span, colH, flR).x - mapKit(p - e.yyx, span, colH, flR).x\n  ));\n}\n\nvec3 aces(vec3 x) {\n  x = max(x, 0.0);\n  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float sx = fragCoord.x / max(iResolution.x, 1.0);\n  float split = clamp(P_SPLIT, 0.0, 1.0);\n  bool showCAD = sx >= split;\n\n  // Gently sweep parameters around user slider targets to demonstrate continuous mechanical verification!\n  float sweep = sin(iTime * 0.75);\n  float span = clamp(P_ARCH_SPAN + 0.10 * sweep, 0.32, 0.88);\n  float colH = clamp(P_COL_HEIGHT + 0.10 * cos(iTime * 0.62), 0.38, 0.98);\n  float flR = clamp(P_FLANGE_RAD, 0.14, 0.40);\n\n  float orb = iTime * 0.34 + 0.35;\n  vec3 ro = vec3(2.45 * sin(orb), 0.42, 2.45 * cos(orb));\n  vec3 ta = vec3(0.0, -0.05, 0.0);\n  vec3 fw = normalize(ta - ro);\n  vec3 ri = normalize(cross(fw, vec3(0.0, 1.0, 0.0)));\n  vec3 up = cross(ri, fw);\n  vec3 rd = normalize(fw * 1.48 + ri * uv.x + up * uv.y);\n\n  vec3 bg = mix(vec3(0.05, 0.065, 0.095), vec3(0.14, 0.18, 0.26), smoothstep(-0.3, 0.6, rd.y));\n  vec3 col = bg;\n\n  // Floor plane at y = -0.715\n  float tHit = 1e5;\n  float hitId = 0.0;\n  if (rd.y < -0.005) {\n    float tf = (-0.715 - ro.y) / rd.y;\n    if (tf > 0.05 && tf < 14.0) { tHit = tf; hitId = 10.0; }\n  }\n\n  float t = 0.05;\n  for (int i = 0; i < 64; i++) {\n    vec2 h = mapKit(ro + rd * t, span, colH, flR);\n    if (h.x < 0.0018) {\n      if (t < tHit) { tHit = t; hitId = h.y; }\n      break;\n    }\n    t += h.x;\n    if (t > min(tHit, 7.5)) break;\n  }\n\n  if (hitId > 0.5) {\n    vec3 p = ro + rd * tHit;\n    vec3 v = -rd;\n    vec3 L = normalize(vec3(0.62, 0.82, 0.52));\n\n    if (hitId > 9.0) {\n      // Studio blueprint floor grid\n      vec2 g = abs(fract(p.xz * 2.5) - 0.5);\n      float line = smoothstep(0.035, 0.008, min(0.5 - g.x, 0.5 - g.y));\n      vec3 fCol = mix(vec3(0.07, 0.09, 0.13), vec3(0.22, 0.34, 0.48), line * 0.65);\n      float ao = smoothstep(0.15, 1.25, length(p.xz));\n      col = mix(fCol * (0.45 + 0.55 * ao), bg, 1.0 - exp(-tHit * 0.14));\n    } else {\n      vec3 n = calcNormal(p, span, colH, flR);\n      float baseTop = -0.52;\n      float colTop = baseTop + colH;\n      float finY = colTop + 0.24;\n\n      if (!showCAD) {\n        // Left: Mechanical verification diagnostic overlay (per-part manifold ID colors + bright green mating-joint verification rings!)\n        vec3 partCol = vec3(0.22, 0.52, 0.82);\n        if (hitId > 1.5 && hitId < 2.5) partCol = vec3(0.28, 0.72, 0.68);\n        else if (hitId > 2.5 && hitId < 3.5) partCol = vec3(0.84, 0.56, 0.22);\n        else if (hitId > 3.5) partCol = vec3(0.72, 0.38, 0.86);\n\n        float ndl = 0.38 + 0.62 * max(dot(n, L), 0.0);\n        // Subtle parametric iso-slice wireframe confirming watertight closed manifold\n        float iso = smoothstep(0.05, 0.012, abs(fract(p.y * 10.0) - 0.5));\n        col = partCol * ndl + vec3(0.85, 0.94, 1.0) * iso * 0.14;\n\n        // Glowing emerald snap rings at exact mathematical contact planes (touching-part verification PASS!)\n        float j1 = smoothstep(0.022, 0.004, abs(p.y - baseTop));\n        float j2 = smoothstep(0.022, 0.004, abs(p.y - colTop));\n        float j3 = smoothstep(0.022, 0.004, abs(p.y - finY));\n        float jointGlow = clamp(j1 + j2 + j3, 0.0, 1.0);\n        col = mix(col, vec3(0.18, 1.0, 0.45) * 1.45, jointGlow);\n      } else {\n        // Right: Crisp shaded stone & brushed-bronze parametric kit assembly\n        vec3 alb = vec3(0.76, 0.73, 0.68);\n        float met = 0.0;\n        if (hitId > 3.5) { alb = vec3(0.86, 0.68, 0.36); met = 0.75; }\n        else if (hitId > 2.5) alb = vec3(0.82, 0.79, 0.74);\n\n        vec3 H = normalize(L + v);\n        float ndl = max(dot(n, L), 0.0);\n        float spec = pow(max(dot(n, H), 0.0), mix(24.0, 68.0, met)) * mix(0.35, 1.25, met);\n        vec3 skyFill = mix(vec3(0.16, 0.20, 0.28), vec3(0.40, 0.52, 0.72), 0.5 + 0.5 * n.y);\n        col = alb * (vec3(1.32, 1.22, 1.05) * ndl + skyFill * 0.48) + mix(vec3(1.0), alb, met) * spec;\n      }\n    }\n  }\n\n  float sep = smoothstep(0.0035, 0.0008, abs(sx - split));\n  col = mix(col, vec3(0.95, 0.97, 1.0), sep);\n  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "procedural-kit-modeling",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T21:07:22.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.6273,
      "std": 0.2302,
      "min": 0.2511,
      "max": 0.9344
     },
     "image": "/specimens/procedural-kit-modeling-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "cga-shape-grammar",
  "greebling",
  "infinigen"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/procgen/procedural-kit-modeling.json"
 },
 "solves": [
  "llm-generated modular props have broken geometry",
  "need parametric walls and gates that stay valid at any setting",
  "check meshes are closed and manifold automatically",
  "script a game-ready kit and verify collisions",
  "sliders produce overlapping or leaking parts"
 ],
 "authority": "wrong-nebula, 2026",
 "url": "https://texelatlas.vercel.app/t/procedural-kit-modeling/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 29.68,
  "tier": "heavy",
  "p50_ms": 0.9765,
  "p95_ms": 1.0122,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "procedural-kit-modeling-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 27.37,
   "tier": "heavy",
   "p50_ms": 0.4352,
   "p95_ms": 0.448,
   "speedup_x": 2.24,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 18.62,
   "tier": "moderate",
   "p50_ms": 0.5362,
   "p95_ms": 0.5509,
   "speedup_x": 1.82,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}