<!-- SOLID CITY · part 2571 -->
thing. Clearances: 6.4 m from any other
   * centreline (stacked hairpin legs keep their air), 11 m at
   * the junction braids, 4.5 m at driveway mouths. */
  function roadBodies() {
    var JX = [[945, -1487.5], [915, -1285], [430, -1065]];
    var names = Object.keys(smithRoads);
    var cells = {};
    function cellKey(x, z) { return Math.floor(x / 16) + ',' + Math.floor(z / 16); }
    names.forEach(function (nm) {
      var sts = smithRoads[nm].stations;
      for (var i = 0; i < sts.length - 1; i++) {
        var mx = (sts[i].x + sts[i + 1].x) / 2, mz = (sts[i].z + sts[i + 1].z) / 2;
        var k = cellKey(mx, mz);
        (cells[k] = cells[k] || []).push({ nm: nm, i: i, x1: sts[i].x, z1: sts[i].z, x2: sts[i + 1].x, z2: sts[i + 1].z });
      }
    });
    function segDist(px, pz, s) {
      var dx = s.x2 - s.x1, dz = s.z2 - s.z1, L2 = dx * dx + dz * dz;
      var t = L2 ? ((px - s.x1) * dx + (pz - s.z1) * dz) / L2 : 0; t = Math.max(0, Math.min(1, t));
      return Math.hypot(px - (s.x1 + dx * t), pz - (s.z1 + dz * t));
    }
    function foreignClear(px, pz, ownNm, ownI) {
      var cx = Math.floor(px / 16), cz = Math.floor(pz / 16);
      for (var a = -1; a <= 1; a++) for (var b = -1; b <= 1; b++) {
        var list = cells[(cx + a) + ',' + (cz + b)]; if (!list) continue;
        for (var q = 0; q < list.length; q++) {
          var s = list[q];
          if (s.nm === ownNm && Math.abs(s.i - ownI) <= 12) continue;
          if (segDist(px, pz, s) < 6.4) return false;
        }
      }
      return true;
    }
    names.forEach(function (nm) {
      var sts = smithRoads[nm].stations;
      [-1, 1].forEach(function (sd) {
        var run = null, crun = null;
        function flush() {
          if (!run) return;
          var dx = run.x1 - run.x0, dz = run.z1 - run.z0;
          foot.push([(run.x0 + run.x1) / 2, (run.z0 + run.z1) / 2, Math.hypot(dx, dz) + 0.2, 1.1, run.y0, run.y1, Math.atan2(-dz, dx)]);
          run = null;
        }
        function cflush() {
          if (!crun) return;
          var dx = crun.x1 - crun.x0, dz = crun.z1 - crun.z0;
          foot.push([(crun.x0 + crun.x1) / 2, (crun.z0 + crun.z1) / 2, Math.hypot(dx, dz) + 0.2, 1.1, crun.y0, crun.y1, Math.atan2(-dz, dx)]);
          crun = null;
        }
        for (var i = 0; i < sts.length - 1; i++) {
          var A = sts[i], B = sts[i + 1];
          var ca = sd < 0 ? A.L : A.R, cb = sd < 0 ? B.L : B.R;
          var mx = (ca[0] + cb[0]) / 2, mz = (ca[2] + cb[2]) / 2;
          var rx = (A.rx + B.rx) / 2, rz = (A.rz + B.rz) / 2, rl = Math.hypot(rx, rz) || 1; rx /= rl; rz /= rl;
          var edgeY = (ca[1] + cb[1]) / 2;
          var drop = edgeY - groundAt(mx + sd * rx * 2.2, mz + sd * rz * 2.2);
          var skip = drop < 1.0;
          if (!skip) for (var j = 0; j < JX.length && !skip; j++) { if (Math.hypot(ca[0] - JX[j][0], ca[2] - JX[j][1]) < 11 || Math.hypot(cb[0] - JX[j][0], cb[2] - JX[j][1]) < 11) skip = true; }
          if (!skip) for (var k = 0; k < driveMouths.length && !skip; k++) if (Math.hypot(mx - driveMouths[k][0], mz - driveMouths[k][1]) < 4.5) skip = true;
          if (!skip && (!foreignClear(ca[0], ca[2], nm, i) || !foreignClear(cb[0], cb[2], nm, i))) skip = true;
          if (skip) { flush(); }
          else {
            var y1 = Math.max(ca[1], cb[1]) - 0.5, y0 = Math.min(groundAt(ca[0], ca[2]), groundAt(cb[0], cb[2])) - 0.6;
            if (y1 - y0 < 0.7) { flush(); }
            else {
              if (run) {
                var adx = cb[0] - run.x1, adz = cb[2] - run.z1, rdx = run.x1 - run.x0, rdz = run.z1 - run.z0;
                var turn = Math.abs(Math.atan2(-adz, adx) - Math.atan2(-rdz, rdx));
                if (turn > 0.06 || Math.hypot(run.x1 - run.x0, run.z1 - run.z0) > 10) flush();
              }
              /* a run's rise is capped at 0.8 m: the body's top is set
               * by its highest edge, and at the run's low end that top
               * must stay a full metre under the local surface, or the
               * collision step would nudge a walker on the shoulder.
               * On steep ground the runs simply shorten. */
              var segHi = Math.max(ca[1], cb[1]), segLo = Math.min(ca[1], cb[1]);
              if (run && (Math.max(run.hi, segHi) - Math.min(run.lo, segLo) > 0.8)) flush();
              if (!run) run = { x0: ca[0], z0: ca[2], x1: cb[0], z1: cb[2], y0: y0, y1: y1, hi: segHi, lo: segLo };
              else { run.x1 = cb[0]; run.z1 = cb[2]; if (y0 < run.y0) run.y0 = y0; if (y1 > run.y1) run.y1 = y1; if (segHi > run.hi) run.hi = segHi; if (segLo < run.lo) run.lo = segLo; }
            }
          }
          /* THE CLIFF'S BODY (the same sitting): where the cut is
           * deep — the far land still 2.5 m up at five metres out,
           * the smith's own cliff measure — a plumb body stands
           * behind the wall's face: centred 1.5 m out, from just
           * under the road to just under the land the wall m