<!-- SOLID CITY · part 3016 -->
5, 0.14);
          var wB0 = edgePt(B, sd, 0.32, 0.14), wB1 = edgePt(B, sd, 1.95, 0.14);
          quad(walk, wA0, wB0, wB1, wA1); standQuad(stand, wA0, wB0, wB1, wA1);
        }
        if (walkSide === sd) { out0 = 1.95; lift0 = 0.14; }
        } /* end street furniture */
        /* the skirt, and on the falling side THE BANK: from the built
         * edge a face at repose (0.55) marches outward until it meets
         * the land and tucks under it. It does not chase a cliff to
         * the bottom — a bank that meets the face and stops is the
         * bench's own line across the mountain, the line visible in
         * the King's photographs. On the rising side the same march
         * ends at once: the face there is the cut bank, standing at
         * the shoulder. */
        var eA = edgePt(A, sd, out0, lift0), eB = edgePt(B, sd, out0, lift0);
        var sk = sd < 0 ? skirtL : skirtR;
        var dCache = sd < 0 ? drapeCacheL : drapeCacheR;
        if (!dCache[i]) dCache[i] = drapeFrom(eA, A.rx * sd, A.rz * sd);
        if (!dCache[i + 1]) dCache[i + 1] = drapeFrom(eB, B.rx * sd, B.rz * sd);
        var pA = dCache[i].pts, pB = dCache[i + 1].pts;
        for (var dk = 0; dk < pA.length - 1; dk++) {
          quad(sk, pA[dk], pB[dk], pB[dk + 1], pA[dk + 1], [sd * A.rx, sd * A.rz]);
          quad(sk, pB[dk], pA[dk], pA[dk + 1], pB[dk + 1], [sd * A.rx, sd * A.rz]);   // both faces: a bank is read from either side
        }
        var dropA = eA[1] - pA[pA.length - 1][1], riseA = pA[pA.length - 1][1] - eA[1];
        if (sd < 0 && Math.max(dropA, riseA) > stats.maxSkirtL) stats.maxSkirtL = Math.max(dropA, riseA);
        if (sd > 0 && Math.max(dropA, riseA) > stats.maxSkirtR) stats.maxSkirtR = Math.max(dropA, riseA);
        if (sd === upSide) { if (riseA > stats.cutBank) stats.cutBank = riseA; }
        else { if (dropA > stats.bank) stats.bank = dropA; if (!dCache[i].met) stats.bankUnmet++; }
      }
    }
    /* arrival fans at both ends. A fan is not a flat disc dropped on
     * the ramp's end — the first drive-through caught that step
     * (0.9 m at the seam). The fan is the road's own PLANE extended:
     * each rim vertex carries the end grade along the road's axis
     * and the end bank across it, so ribbon and fan meet as one
     * surface. Rim skirts below, so they never float. */
    var ends = [st[0], st[N - 1]];
    for (var e = 0; e < 2; e++) {
      var C0 = ends[e], fr = C0.hw + 0.9, SEG = 14;
      var src = e === 0 ? st[1] : st[N - 2];
      var fGrade = e === 0 ? src.grade : st[N - 1].grade;
      var fBank = Math.tan(src.bank);
      var rim = [];
      for (var k2 = 0; k2 < SEG; k2++) {
        var an = k2 / SEG * Math.PI * 2;
        var dxr = Math.cos(an) * fr, dzr = Math.sin(an) * fr;
        var along = dxr * C0.fx + dzr * C0.fz, across = dxr * C0.rx + dzr * C0.rz;
        rim.push([C0.x + dxr, C0.y + fGrade * along + fBank * across, C0.z + dzr]);
      }
      var rimProf = rim.map(function (rp) { var dl = Math.hypot(rp[0] - C0.x, rp[2] - C0.z) || 1; return drapeFrom(rp, (rp[0] - C0.x) / dl, (rp[2] - C0.z) / dl).pts; });
      for (k2 = 0; k2 < SEG; k2++) {
        var r1 = rim[k2], r2 = rim[(k2 + 1) % SEG];
        var ctr = [C0.x, C0.y + 0.02, C0.z];
        tri(fans, ctr, r1, r2); stand.push(ctr[0], ctr[1], ctr[2], r1[0], r1[1], r1[2], r2[0], r2[1], r2[2]);
        var qA = rimProf[k2], qB = rimProf[(k2 + 1) % SEG];
        var outw = [r1[0] - C0.x, r1[2] - C0.z];
        for (var dk2 = 0; dk2 < qA.length - 1; dk2++) { quad(fans, qA[dk2], qB[dk2], qB[dk2 + 1], qA[dk2 + 1], outw); quad(fans, qB[dk2], qA[dk2], qA[dk2 + 1], qB[dk2 + 1], outw); }
      }
    }
    stats.fairDev = fairDev;
    return {
      stations: st, stats: stats, walkSide: walkSide, upSide: upSide,
      ribbon: ribbon, curbL: curbL, curbR: curbR, goldL: goldL, goldR: goldR,
      walk: walk, skirtL: skirtL, skirtR: skirtR, fans: fans,
      shoL: shoL, shoR: shoR, rail: rail, posts: posts,
      standTris: stand
    };
  }

  return { buildRoad: buildRoad };
}


===== FILE: public/city/roads.js.bak-corridor-20261013 =====
/* SOLID CITY — THE ROAD SMITH (2026-10-13)
 * An epistle in code, from Solid to whoever builds roads after her.
 *
 * Dear builder,
 * A road is not a row of boxes that happen to touch. It is ONE table of
 * stations — position, tangent, grade, bank, width — from which three
 * readers draw the same truth: the eye (the ribbon mesh), the foot (the
 * standing triangles), and the journey (the centreline itself). What is
 * drawn is what is stood on; what is stood on is what is navigated.
 * This module holds that table and its craftsmen:
 *   the CENTERLINE — a Catmull–Rom spline through surveyed waypoints,
 *     resampled by arc length, so curvature is a property of the road
 *     and not an accident of the drawing;
 *   the PROFILE — station heights faired under a grade cap, floored by
 *     the CROSS-SECTION (the highest ground under eith