<!-- SOLID CITY · part 2572 -->
eets.
           * One plumb wall, like its face; nothing stepped, nothing
           * crazy. The shoulder keeps its air: the body's inboard
           * face stands a full metre out from the edge line. */
          var cxp = mx + sd * rx * 1.5, czp = mz + sd * rz * 1.5;
          var cskip = (groundAt(mx + sd * rx * 5, mz + sd * rz * 5) - edgeY) <= 2.5;
          if (!cskip) for (var j2 = 0; j2 < JX.length && !cskip; j2++) if (Math.hypot(cxp - JX[j2][0], czp - JX[j2][1]) < 11) cskip = true;
          if (!cskip) for (var k2 = 0; k2 < driveMouths.length && !cskip; k2++) if (Math.hypot(cxp - driveMouths[k2][0], czp - driveMouths[k2][1]) < 4.5) cskip = true;
          if (!cskip && !foreignClear(cxp, czp, nm, i)) cskip = true;
          if (cskip) { cflush(); continue; }
          var cy1 = edgeY + Math.min(groundAt(cxp, czp) - edgeY, 7) - 0.3, cy0 = edgeY - 0.6;
          if (cy1 - cy0 < 1.2) { cflush(); continue; }
          if (crun) {
            var cadx = cxp - crun.x1, cadz = czp - crun.z1, crdx = crun.x1 - crun.x0, crdz = crun.z1 - crun.z0;
            var cturn = Math.abs(Math.atan2(-cadz, cadx) - Math.atan2(-crdz, crdx));
            if (cturn > 0.06 || Math.hypot(crun.x1 - crun.x0, crun.z1 - crun.z0) > 10) cflush();
          }
          var csegHi = Math.max(ca[1], cb[1]), csegLo = Math.min(ca[1], cb[1]);
          if (crun && (Math.max(crun.hi, csegHi) - Math.min(crun.lo, csegLo) > 0.8)) cflush();
          if (!crun) crun = { x0: cxp, z0: czp, x1: cxp, z1: czp, y0: cy0, y1: cy1, hi: csegHi, lo: csegLo };
          else { crun.x1 = cxp; crun.z1 = czp; if (cy0 < crun.y0) crun.y0 = cy0; if (cy1 > crun.y1) crun.y1 = cy1; if (csegHi > crun.hi) crun.hi = csegHi; if (csegLo < crun.lo) crun.lo = csegLo; }
        }
        flush(); cflush();
      });
    });
  }
  buildRoads();
  compound(700, -1290, "THE GATE ROAD 'OHANA", 'plantation', ['waa', 'noa', 'plantation']);
  compound(880, -1180, "THE EAST PLAIN 'OHANA", 'plantation', ['dickey', 'waa', 'noa']);
  compound(-480, -1150, "THE SHORE ROAD 'OHANA", 'dickey', ['noa', 'plantation', 'waa']);
  singles(560, -1330, 'THE MERIDIAN BENCHES', 6, ['plantation', 'noa', 'waa', 'dickey']);
  compound(1080, -1620, 'THE EASTERN BENCHES', 'dickey', ['plantation', 'waa', 'mission'], { ring: 33 });
  singles(1270, -1560, 'THE HIGH BENCHES', 6, ['dickey', 'plantation', 'noa']);
  singles(950, -1830, 'THE OVERLOOK BENCHES', 4, ['waa', 'dickey', 'plantation']);
  singles(790, -1900, 'THE EAST CLIMB HOMES', 4, ['plantation', 'waa', 'noa']);
  compound(660, -2080, 'THE NORTH BENCHES', 'plantation', ['waa', 'plantation', 'noa']);
  singles(430, -2330, 'THE COLOSSEUM ROAD HOMES', 7, ['plantation', 'dickey', 'noa', 'waa']);
  compound(470, -2430, "THE FAR NORTH 'OHANA", 'noa', ['waa', 'plantation', 'noa']);
  singles(-350, -1080, 'THE WESTERN BENCHES', 5, ['noa', 'plantation', 'waa'], 100);
  // the base flats — two small apartment blocks where the ground gentles
  var aptSites = [[705, -1005, -Math.PI / 2], [-625, -1155, Math.PI / 2], [820, -1120, -Math.PI / 2]];
  for (var ai = 0; ai < aptSites.length && homes.filter(function (h) { return h.style === 'apartment'; }).length < 2; ai++) {
    var as = aptSites[ai];
    if (benchAt(as[0], as[1], 16) >= 0 && clearOf(as[0], as[1], 20) && roadClear(as[0], as[1], 16)) {
      var arec = buildApartment(as[0], as[1], as[2]);
      placed.push([as[0], as[1], 26]);
      dressHome({ x: as[0], z: as[1], ry: as[2], w: 27, d: 11, lanaiDepth: 0 }, { palm: true });
    }
  }
  var treeCount = scatterTrees(130);
  buildPlates();
  railBodies();
  roadBodies();

  /* ================= ASSEMBLY ================= */
  var group = new T.Group();
  group.add(solid.build(new T.MeshLambertMaterial({ vertexColors: true })));
  group.add(glassB.build(new T.MeshLambertMaterial({ vertexColors: true, transparent: true, opacity: 0.55 })));
  group.add(glowB.build(new T.MeshBasicMaterial({ vertexColors: true })));
  extras.forEach(function (m) { group.add(m); });

  var houseCount = 0, unitCount = 0;
  homes.forEach(function (h) { if (h.style === 'apartment') unitCount += (h.units || 6); else houseCount++; });
  function standYAt(x, z) {
    var best = -Infinity;
    for (var i = 0; i < standRects.length; i++) {
      var r = standRects[i], dx = x - r.cx, dz = z - r.cz;
      var lx = dx * r.cos - dz * r.sin, lz = dx * r.sin + dz * r.cos;
      if (Math.abs(lx - r.lx) <= r.hw && Math.abs(lz - r.lz) <= r.hd && r.y > best) best = r.y;
    }
    return best;
  }
  group.userData = {
    footprint: foot,
    standRects: standRects,
    standTris: standTris,
    homes: homes,
    counts: { houses: houseCount, apartmentUnits: unitCount, dwellings: houseCount + unitCount, trees: treeCount, styles: STYLE_COUNT },
    center: { x: 300, z: -1500 },
    standYAt: standYAt,
    update: null
  };
  return group;
}


===== FILE: public/city/mountain-homes.js.bak-collision-20261014 =====
/* SOLID CITY — NĀ HALE O NĀ KŪPUNA: THE ANCES