{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "bund-wall",
  "type": "registry:component",
  "title": "Tank bund wall",
  "description": "Reinforced-concrete secondary containment: walls on a footing toe with coping, internal coating band and sealed expansion joints, a lined floor slab with perimeter fillets falling to a gully and a gratinged sump, a drain line through the wall to a normally-closed bund drain valve, step-over stairs (outside flight, landing over the wall, inside flight) to ISO 14122, and a capacity sign. `complete` builds the full rectangle (length × width); otherwise a single straight wall segment along X.",
  "dependencies": [
    "three",
    "@react-three/fiber",
    "@react-three/drei"
  ],
  "registryDependencies": [
    "https://deck-twin-library.demoareeb.workers.dev/r/core.json"
  ],
  "files": [
    {
      "path": "onshore/bund-wall.tsx",
      "type": "registry:file",
      "target": "components/deck-twin/onshore/bund-wall.tsx",
      "content": "// Tank bund (secondary containment): reinforced concrete wall on a footing, lined floor falling to a sump, drain valve, step-over stairs. NFPA 30, API 2610, EN 1992-3.\nimport * as THREE from 'three'\nimport type { Kit } from '../lib/kit'\nimport { KitMesh, useKit, type GroupProps } from '../lib/mesh'\nimport { grating, handrail, member, nozzle, pipeRun, tagPlate } from '../lib/parts'\nimport { paint } from '../lib/materials'\nimport { port, type Port } from '../lib/ports'\nimport { textMaterial } from '../lib/textures'\nimport { clamp, stair } from './_onshore'\n\nexport interface BundWallProps {\n  /** complete rectangular bund, or a single straight segment along X */\n  complete?: boolean\n  /** along X, m */\n  length?: number\n  /** along Z (complete bund), m */\n  width?: number\n  /** wall height above grade, m */\n  height?: number\n  /** wall thickness, m */\n  thickness?: number\n  /** step-over stairs */\n  stairs?: boolean\n  drainNps?: number\n  tag?: string\n}\n\nexport const defaults = { complete: true, length: 30, width: 22, height: 1.5, thickness: 0.3, stairs: true, drainNps: 4, tag: '' }\n\nconst FLOOR = 0.15 // lined floor slab top at the walls, typical\n\nfunction layout(p: typeof defaults) {\n  const L = clamp(p.length, 3, 200)\n  const W = clamp(p.width, 3, 200)\n  const H = clamp(p.height, 0.4, 4)\n  const t = clamp(p.thickness, 0.2, 0.6)\n  const sump = { x: L / 2 - t - 0.9, z: W / 2 - t - 0.9 }\n  return { L, W, H, t, sump, drainY: 0.35, drainX: L / 2 + 0.6 }\n}\n\nexport function ports(props: BundWallProps = {}): Port[] {\n  const p = { ...defaults, ...props }\n  if (!p.complete) return []\n  const g = layout(p)\n  return [port('drain', 'Bund drain', [g.drainX, g.drainY, g.sump.z], [1, 0, 0], p.drainNps, 150, 'drain')]\n}\n\nexport function BundWall(props: BundWallProps & GroupProps) {\n  const { complete, length, width, height, thickness, stairs, drainNps, tag, ...group } = { ...defaults, ...props }\n  const p = { complete, length, width, height, thickness, stairs, drainNps, tag }\n  const data = useKit((k) => build(k, p, layout(p)), [complete, length, width, height, thickness, stairs, drainNps, tag])\n  return (\n    <group {...group}>\n      <KitMesh data={data} />\n    </group>\n  )\n}\n\nexport default BundWall\n\ntype P = typeof defaults\ntype G = ReturnType<typeof layout>\n\n/** Straight wall from a to b (centreline) along X or Z, with footing toe, coping and expansion joints. */\nfunction wall(k: Kit, x0: number, z0: number, x1: number, z1: number, g: G, inside: THREE.Vector3) {\n  const along = x1 !== x0 ? 'x' : 'z'\n  const len = Math.abs(along === 'x' ? x1 - x0 : z1 - z0)\n  const cx = (x0 + x1) / 2\n  const cz = (z0 + z1) / 2\n  const size = (a: number, b: number, h: number): [number, number, number] => (along === 'x' ? [a, h, b] : [b, h, a])\n  const { t, H } = g\n  k.box('concrete', size(len, t, H), [cx, H / 2, cz])\n  // footing toe either side, at grade\n  k.box('concrete', size(len, t + 0.5, 0.08), [cx, 0.04, cz])\n  // coping chamfer and inner coating band\n  k.box('concrete', size(len, t + 0.04, 0.05), [cx, H + 0.025, cz])\n  const coat = paint('#4d5a5e', { roughness: 0.6, clearcoat: 0.1, weather: 0.4 })\n  const off = inside.clone().multiplyScalar(t / 2 + 0.003)\n  k.box(coat, size(len, 0.006, H - FLOOR - 0.02), [cx + off.x, FLOOR + (H - FLOOR) / 2, cz + off.z])\n  // vertical expansion joints with sealant every ~10 m\n  const n = Math.floor(len / 10)\n  for (let i = 1; i <= n; i++) {\n    const s = -len / 2 + (i * len) / (n + 1)\n    const p = along === 'x' ? [cx + s, cz] : [cx, cz + s]\n    k.box('rubberBlack', along === 'x' ? [0.02, H + 0.01, t + 0.045] : [t + 0.045, H + 0.01, 0.02], [p[0], H / 2, p[1]])\n  }\n}\n\n/** Step-over: stair up the outside, landing on the coping, stair down inside; centred on (x, z) facing `out`. */\nfunction stepOver(k: Kit, x: number, z: number, out: THREE.Vector3, g: G, floor = FLOOR) {\n  const { H, t } = g\n  const top = H + 0.05 + 0.03\n  const run = (rise: number) => {\n    const n = Math.max(1, Math.round(rise / 0.18))\n    return ((n - 1) * rise) / n / Math.tan((38 * Math.PI) / 180)\n  }\n  const land = t + 0.9\n  const dir = (v: THREE.Vector3) => (Math.abs(v.x) > 0.5 ? (v.x > 0 ? '-x' : 'x') : v.z > 0 ? '-z' : 'z')\n  // landing across the wall\n  const w = 0.9\n  const side = new THREE.Vector3(-out.z, 0, out.x)\n  const c = new THREE.Vector3(x, top, z)\n  const lx = Math.abs(out.x) > 0.5 ? land : w\n  const lz = Math.abs(out.x) > 0.5 ? w : land\n  grating(k, [x, top, z], lx, lz)\n  for (const s of [-1, 1]) {\n    const e = c.clone().addScaledVector(side, (s * w) / 2)\n    const a = e.clone().addScaledVector(out, -land / 2)\n    const b = e.clone().addScaledVector(out, land / 2)\n    member(k, [a.x, top - 0.08, a.z], [b.x, top - 0.08, b.z], 'UPN 100', 'galvanised', [0, 1, 0])\n    handrail(k, [[a.x, top, a.z], [b.x, top, b.z]], 'safetyYellow')\n  }\n  // outside flight from grade, inside flight down to the bund floor\n  const ro = run(top)\n  const fo = c.clone().addScaledVector(out, land / 2 + ro)\n  stair(k, [fo.x, 0, fo.z], dir(out), top, w - 0.1)\n  const ri = run(top - floor)\n  const fi = c.clone().addScaledVector(out, -(land / 2 + ri))\n  stair(k, [fi.x, floor, fi.z], dir(out.clone().negate()), top - floor, w - 0.1)\n}\n\nfunction build(k: Kit, p: P, g: G) {\n  const { L, W, H, t } = g\n  if (!p.complete) {\n    wall(k, -L / 2, 0, L / 2, 0, g, new THREE.Vector3(0, 0, -1))\n    if (p.stairs) stepOver(k, 0, 0, new THREE.Vector3(0, 0, 1), g, 0)\n    if (p.tag) tagPlate(k, p.tag, [-L / 2 + 1, H * 0.6, t / 2 + 0.002], 'z', 0.3)\n    return\n  }\n  const xi = L / 2 - t / 2\n  const zi = W / 2 - t / 2\n  wall(k, -L / 2, -zi, L / 2, -zi, g, new THREE.Vector3(0, 0, 1))\n  wall(k, -L / 2, zi, L / 2, zi, g, new THREE.Vector3(0, 0, -1))\n  wall(k, -xi, -zi + t / 2, -xi, zi - t / 2, g, new THREE.Vector3(1, 0, 0))\n  wall(k, xi, -zi + t / 2, xi, zi - t / 2, g, new THREE.Vector3(-1, 0, 0))\n  // lined floor slab falling to the sump; perimeter fillet\n  const lining = paint('#585f5c', { metalness: 0, roughness: 0.75, clearcoat: 0.05, weather: 1.1 })\n  const Li = L - 2 * t\n  const Wi = W - 2 * t\n  k.box(lining, [Li, FLOOR, Wi], [0, FLOOR / 2, 0])\n  for (const s of [-1, 1]) {\n    k.box(lining, [Li, 0.08, 0.08], [0, FLOOR + 0.0, s * (Wi / 2 - 0.03)], new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 4))\n    k.box(lining, [0.08, 0.08, Wi], [s * (Li / 2 - 0.03), FLOOR, 0], new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 0, 1), Math.PI / 4))\n  }\n  // drainage channel to the sump along the +Z wall\n  k.box('castIron', [Li - 1.6, 0.006, 0.3], [-0.8 + 0.0, FLOOR + 0.003, Wi / 2 - 0.5])\n  // sump with grating and the drain line through the wall to a normally-closed valve outside\n  const { x: sx, z: sz } = g.sump\n  k.box('concrete', [1.06, 0.06, 1.06], [sx, FLOOR + 0.0, sz])\n  k.box('rubberBlack', [0.9, 0.004, 0.9], [sx, FLOOR + 0.03, sz])\n  grating(k, [sx, FLOOR + 0.035, sz], 0.9, 0.9)\n  const dn = p.drainNps\n  pipeRun(k, [[sx + 0.2, FLOOR + 0.02, sz], [sx + 0.2, g.drainY, sz], [L / 2 + 0.15, g.drainY, sz]], dn)\n  nozzle(k, { base: [L / 2 + 0.15, g.drainY, sz], dir: [1, 0, 0], nps: dn, rating: 150, standout: 0.45, mat: 'pipePaint' })\n  k.box('valveBody', [0.2, 0.2, 0.22], [L / 2 + 0.36, g.drainY, sz])\n  k.box('actuatorRed', [0.03, 0.02, 0.3], [L / 2 + 0.36, g.drainY + 0.13, sz + 0.1])\n  k.cyl('brass', 0.03, 0.05, [L / 2 + 0.36, g.drainY + 0.12, sz], 'y', 10)\n  k.box('concrete', [0.5, g.drainY - 0.08, 0.4], [L / 2 + 0.35, (g.drainY - 0.08) / 2, sz])\n  k.plane(textMaterial('BUND DRAIN  KEEP CLOSED', '#c3221a', '#ffffff'), 0.5, 0.12, [L / 2 + 0.003, H * 0.6, sz], new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI / 2))\n  // step-overs on the two long walls\n  if (p.stairs) {\n    stepOver(k, -L / 4, -zi, new THREE.Vector3(0, 0, -1), g)\n    stepOver(k, L / 4, zi, new THREE.Vector3(0, 0, 1), g)\n  }\n  // capacity sign\n  const cap = Li * Wi * (H - FLOOR)\n  k.plane(textMaterial(`BUND ${Math.round(cap)} m³`, '#1f4e9a', '#ffffff'), 1.2, 0.3, [0, H * 0.55, W / 2 + 0.003], new THREE.Quaternion())\n  if (p.tag) tagPlate(k, p.tag, [-L / 2 + 1, H * 0.55, W / 2 + 0.002], 'z', 0.3)\n}\n"
    },
    {
      "path": "onshore/_onshore.ts",
      "type": "registry:file",
      "target": "components/deck-twin/onshore/_onshore.ts",
      "content": "// Shared onshore parts: plinths, anchor bolts, earth bonds, ISO 14122 stairs, shedded insulators, lattice steel and swivel joints.\nimport * as THREE from 'three'\nimport { axisVec, type Axis, type Kit, type MatKey, type V3 } from '../lib/kit'\nimport { paint } from '../lib/materials'\nimport { grating, handrail, member } from '../lib/parts'\nimport { stairFlight } from '../lib/standards'\n\nexport const add = (a: V3, b: V3, s = 1): V3 => [a[0] + b[0] * s, a[1] + b[1] * s, a[2] + b[2] * s]\nexport const deg = (d: number) => (d * Math.PI) / 180\nexport const clamp = (v: number, a: number, b: number) => Math.min(b, Math.max(a, v))\n\nexport const porcelain = () => paint('#6e3420', { metalness: 0.05, roughness: 0.12, clearcoat: 0.9, clearcoatRoughness: 0.1, weather: 0 })\nexport const silicone = () => paint('#8b9399', { metalness: 0, roughness: 0.55, clearcoat: 0.2, clearcoatRoughness: 0.5, weather: 0.3 })\nexport const earthLead = () => paint('#5c9e33', { metalness: 0, roughness: 0.6, clearcoat: 0, weather: 0 })\nexport const lightGrey = () => paint('#cfd2cf', { metalness: 0.2, roughness: 0.5, clearcoat: 0.25, weather: 1 })\n\n/** Concrete plinth from y0 up to y0 + h with a small arris, centred on (cx, cz). */\nexport function plinth(k: Kit, cx: number, cz: number, sx: number, sz: number, h: number, y0 = 0) {\n  const c = Math.min(0.025, h * 0.2)\n  k.box('concrete', [sx, h - c, sz], [cx, y0 + (h - c) / 2, cz])\n  k.box('concrete', [sx - 2 * c, c, sz - 2 * c], [cx, y0 + h - c / 2, cz])\n}\n\n/** Cast-in anchor bolt standing on a surface at p: washer, double nut, projecting thread. */\nexport function anchorBolt(k: Kit, p: V3, dia = 0.024) {\n  k.cyl('galvanised', dia * 1.1, 0.005, [p[0], p[1] + 0.0025, p[2]], 'y', 12)\n  k.hex('nut', dia * 1.85, dia * 0.9, [p[0], p[1] + 0.005 + dia * 0.45, p[2]])\n  k.hex('nut', dia * 1.85, dia * 0.9, [p[0], p[1] + 0.005 + dia * 1.4, p[2]])\n  k.cyl('boltXylan', dia / 2, dia * 2.6, [p[0], p[1] + dia * 1.3, p[2]], 'y', 8)\n}\n\n/** Steel base plate with its top at y, on a grout bed, anchored near each corner. */\nexport function basePlate(k: Kit, cx: number, y: number, cz: number, sx: number, sz: number, t = 0.025, dia = 0.024, mat: MatKey = 'galvanised') {\n  k.box(mat, [sx, t, sz], [cx, y - t / 2, cz])\n  const ix = sx / 2 - dia * 2.2\n  const iz = sz / 2 - dia * 2.2\n  for (const a of [-1, 1]) for (const b of [-1, 1]) anchorBolt(k, [cx + a * ix, y, cz + b * iz], dia)\n}\n\n/** Earth boss with a bolted lug and a green/yellow bonding lead down to an inspection pit at grade. */\nexport function earthBond(k: Kit, pos: V3, out: V3, ground = 0, pitOffset = 0.3) {\n  const o = new THREE.Vector3(...out).normalize().toArray() as V3\n  k.cyl('brass', 0.017, 0.03, add(pos, o, 0.015), o, 10)\n  k.box('copper', [0.03, 0.05, 0.004], add(add(pos, o, 0.032), [0, -0.012, 0]), o)\n  k.hex('nut', 0.022, 0.012, add(pos, o, 0.04), o)\n  const lug = add(add(pos, o, 0.035), [0, -0.035, 0])\n  const pit: V3 = [pos[0] + o[0] * pitOffset, ground, pos[2] + o[2] * pitOffset]\n  if (pos[1] - ground > 0.12) {\n    k.spline(earthLead(), [lug, add(lug, [0, -0.08, 0]), add([pit[0], ground + 0.25, pit[2]], o, -pitOffset * 0.3), [pit[0], ground + 0.1, pit[2]], [pit[0], ground + 0.03, pit[2]]], 0.0065, 6, 24)\n    k.cyl('concrete', 0.14, 0.05, [pit[0], ground + 0.025, pit[2]], 'y', 16)\n    k.cyl('castIron', 0.1, 0.008, [pit[0], ground + 0.054, pit[2]], 'y', 16)\n  }\n}\n\n/** ISO 14122-3 straight stair: first riser at `foot`, climbing along `dir` by `rise`. Channel stringers, grating treads, handrails. Returns the horizontal run. */\nexport function stair(k: Kit, foot: V3, dir: Axis, rise: number, width = 0.9, rails: 'both' | 'left' | 'right' | 'none' = 'both') {\n  const f = stairFlight(rise)\n  const n = f.steps\n  const g = f.going\n  const q = new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(1, 0, 0), axisVec(dir).setY(0).normalize())\n  const w = width / 2\n  const slope = f.riser / g\n  k.with(new THREE.Matrix4().compose(new THREE.Vector3(...foot), q, new THREE.Vector3(1, 1, 1)), () => {\n    const sd = 0.18\n    const yAt = (x: number) => f.riser + x * slope - 0.07\n    const x0 = (sd * 0.45 + 0.07 - f.riser) / slope\n    const run = (n - 1) * g\n    for (const s of [-1, 1]) {\n      const z = s * (w + 0.04)\n      member(k, [x0, yAt(x0), z], [run, yAt(run), z], 'UPN 180', 'galvanised', [-slope, 1, 0])\n      k.box('galvanised', [0.22, 0.015, 0.16], [x0 + 0.06, 0.0075, z])\n    }\n    for (let i = 1; i < n; i++) {\n      const y = i * f.riser\n      grating(k, [(i - 1) * g + g / 2 + 0.0125, y, 0], g + 0.025, width)\n      k.box('safetyYellow', [0.03, 0.032, width], [(i - 1) * g + 0.015, y - 0.016, 0])\n    }\n    const pts = (z: number): V3[] => [[0, f.riser * 0.5, z], [run, rise, z]]\n    if (rails === 'both' || rails === 'left') handrail(k, pts(w + 0.04), 'safetyYellow')\n    if (rails === 'both' || rails === 'right') handrail(k, pts(-w - 0.04), 'safetyYellow')\n  })\n  return (n - 1) * g\n}\n\n/** Shedded post insulator from `base` along `axis` for L: galvanised end caps, alternating sheds of radius ~2.2 r. */\nexport function insulator(k: Kit, base: V3, L: number, r: number, mat: MatKey, axis: Axis = 'y') {\n  const v = axisVec(axis).toArray() as V3\n  const cap = Math.min(0.08, L * 0.08)\n  const prof: [number, number][] = [[0, cap], [r, cap]]\n  const body = L - 2 * cap\n  const n = Math.max(3, Math.round(body / Math.max(0.045, r * 0.75)))\n  const pitch = body / n\n  let y = cap\n  for (let i = 0; i < n; i++) {\n    const big = i % 2 === 0 ? 2.3 : 1.85\n    prof.push([r * 1.05, y + pitch * 0.15], [r * big, y + pitch * 0.42], [r * (big - 0.1), y + pitch * 0.55], [r, y + pitch * 0.62])\n    y += pitch\n    prof.push([r, y])\n  }\n  prof.push([0, L - cap])\n  k.lathe(mat, prof, base, v, 20)\n  for (const t of [cap / 2, L - cap / 2]) k.cyl('galvanised', r * 1.25, cap, add(base, v, t), v, 18)\n  for (const t of [0.006, L - 0.006]) k.cyl('galvanised', r * 1.9, 0.012, add(base, v, t), v, 18)\n}\n\n/** Square lattice column of four angle legs with zig-zag bracing on every face, (cx, cz) centre, from y0 to y1. */\nexport function latticeColumn(k: Kit, cx: number, cz: number, y0: number, y1: number, w: number, leg = 'L100x100x10', brace = 'L50x50x5', mat: MatKey = 'galvanised') {\n  const h = w / 2\n  const c: [number, number][] = [[-h, -h], [h, -h], [h, h], [-h, h]]\n  for (const [x, z] of c) member(k, [cx + x, y0, cz + z], [cx + x, y1, cz + z], leg, mat, [-x, 0, -z])\n  const H = y1 - y0\n  const nb = Math.max(1, Math.round(H / w))\n  const dy = H / nb\n  for (let f = 0; f < 4; f++) {\n    const [ax, az] = c[f]\n    const [bx, bz] = c[(f + 1) % 4]\n    for (let i = 0; i < nb; i++) {\n      const ya = y0 + i * dy\n      const flip = (i + f) % 2 === 0\n      const p0: V3 = [cx + (flip ? ax : bx), ya, cz + (flip ? az : bz)]\n      const p1: V3 = [cx + (flip ? bx : ax), ya + dy, cz + (flip ? bz : az)]\n      member(k, p0, p1, brace, mat, [ax + bx, 0, az + bz])\n    }\n    member(k, [cx + ax, y1 - 0.03, cz + az], [cx + bx, y1 - 0.03, cz + bz], brace, mat)\n  }\n}\n\n/** Swivel joint between a and b: two ball-race housings, seal ring, grease nipples and plug bolts. od = pipe OD. */\nexport function swivel(k: Kit, a: V3, b: V3, od: number, mat: MatKey = 'flangeSteel') {\n  const A = new THREE.Vector3(...a)\n  const d = new THREE.Vector3(...b).sub(A)\n  const L = d.length()\n  d.normalize()\n  const v = d.toArray() as V3\n  const at = (t: number) => A.clone().addScaledVector(d, t).toArray() as V3\n  const R = od * 0.82\n  const ri = od * 0.44\n  ring(k, mat, ri, od * 0.56, L, at(L / 2), v)\n  k.cyl('pipeBore', ri, L, at(L / 2), v, 32, undefined, true)\n  ring(k, mat, od * 0.55, R, L * 0.36, at(L * 0.3), v)\n  ring(k, 'machined', od * 0.55, R * 0.96, L * 0.04, at(L * 0.5), v)\n  ring(k, mat, od * 0.55, R * 0.92, L * 0.3, at(L * 0.69), v)\n  for (const t of [0.12, 0.88]) ring(k, mat, od * 0.55, od * 0.7, L * 0.06, at(L * t), v)\n  const [u, w] = perpOf(d)\n  for (let i = 0; i < 6; i++) {\n    const ang = (i / 6) * Math.PI * 2\n    const r = new THREE.Vector3().addScaledVector(u, Math.cos(ang) * R).addScaledVector(w, Math.sin(ang) * R)\n    const p = new THREE.Vector3(...at(L * 0.3)).add(r)\n    k.hex('nut', Math.max(0.018, od * 0.06), 0.012, p.toArray() as V3, r.clone().normalize().toArray() as V3)\n  }\n  const gp = new THREE.Vector3(...at(L * 0.69)).addScaledVector(u, R * 0.92)\n  k.cyl('brass', Math.max(0.006, od * 0.02), 0.03, gp.clone().addScaledVector(u, 0.012).toArray() as V3, u.toArray() as V3, 8)\n}\n\nfunction perpOf(d: THREE.Vector3): [THREE.Vector3, THREE.Vector3] {\n  const ref = Math.abs(d.y) > 0.9 ? new THREE.Vector3(1, 0, 0) : new THREE.Vector3(0, 1, 0)\n  const u = new THREE.Vector3().crossVectors(d, ref).normalize()\n  return [u, new THREE.Vector3().crossVectors(d, u).normalize()]\n}\n\n/** Annular ring (hollow short cylinder) centred on pos along axis, open through the middle. */\nexport function ring(k: Kit, mat: MatKey, ri: number, ro: number, h: number, pos: V3, axis: Axis = 'y', seg = 36) {\n  const v = axisVec(axis)\n  const base = new THREE.Vector3(...pos).addScaledVector(v, -h / 2).toArray() as V3\n  k.lathe(mat, [[ro, 0], [ro, h], [ri, h], [ri, 0], [ro, 0]], base, v.toArray() as V3, seg)\n}\n\n/** Hydraulic cylinder from a (barrel end clevis) to b (rod eye). */\nexport function hydraulicCylinder(k: Kit, a: V3, b: V3, bore: number, mat: MatKey = 'actuatorBlue') {\n  const A = new THREE.Vector3(...a)\n  const B = new THREE.Vector3(...b)\n  const L = A.distanceTo(B)\n  if (L < 1e-3) return\n  const d = B.clone().sub(A).normalize()\n  const bl = Math.min(L * 0.62, L - 0.1)\n  const p = (t: number) => A.clone().addScaledVector(d, t).toArray() as V3\n  k.rod(mat, p(0.04), p(bl), bore / 2, 16)\n  k.rod(mat, p(0.04), p(0.1), bore * 0.62, 16)\n  k.rod(mat, p(bl - 0.06), p(bl), bore * 0.62, 16)\n  k.rod('stainless', p(bl), p(L - 0.04), bore * 0.28, 12)\n  const side = Math.abs(d.x) > 0.9 ? 'z' : 'x'\n  for (const t of [0.02, L - 0.02]) k.cyl('flangeSteel', bore * 0.45, bore * 0.6, p(t), side, 12)\n  k.rod('tubing', add(p(0.12), [0, bore * 0.6, 0]), add(p(bl - 0.08), [0, bore * 0.6, 0]), 0.006, 6)\n}\n\n/**\n * Trapezoidal profiled sheet (wall or roof cladding): profile runs along `u` for `length`, ribs stand out along `n`,\n * extruded `height` along `w`; `origin` is the (0, 0, 0) corner. Typical 35 mm rib at 200 mm pitch.\n */\nexport function profiledSheet(k: Kit, mat: MatKey, length: number, height: number, origin: V3, u: V3, n: V3, w: V3, pitch = 0.2, depth = 0.035) {\n  const top = pitch * 0.2\n  const slope = pitch * 0.15\n  const pts: [number, number][] = [[0, 0]]\n  const ribs = Math.max(1, Math.round(length / pitch))\n  const sc = length / (ribs * pitch)\n  for (let i = 0; i < ribs; i++) {\n    const a = i * pitch * sc\n    const m = a + (pitch * sc) / 2\n    pts.push([m - (top / 2 + slope) * sc, 0], [m - (top / 2) * sc, depth], [m + (top / 2) * sc, depth], [m + (top / 2 + slope) * sc, 0])\n  }\n  pts.push([length, 0])\n  const sh = new THREE.Shape()\n  pts.forEach(([x, y], i) => (i ? sh.lineTo(x, y) : sh.moveTo(x, y)))\n  for (let i = pts.length - 1; i >= 0; i--) sh.lineTo(pts[i][0], pts[i][1] - 0.0015)\n  sh.closePath()\n  const m = new THREE.Matrix4().makeBasis(new THREE.Vector3(...u), new THREE.Vector3(...n), new THREE.Vector3(...w)).setPosition(...origin)\n  k.extrude(mat, sh, height, m, 1)\n}\n"
    }
  ],
  "categories": [
    "onshore"
  ],
  "meta": {
    "export": "BundWall",
    "anchor": "base",
    "standards": [
      "NFPA 30",
      "API 2610",
      "EN 1992-3",
      "EI 19",
      "ISO 14122"
    ]
  }
}