perf: taper multi-wall exterior corridors

Keep the finite #272 exit as a safe subset of the square connector while removing two contour corners per bevel. The simpler canonical path preserves the zero-hole and finite-ray contracts and restores headroom in the large-house Glow gate.

Issue: #272
User-Visible: no
This commit is contained in:
Sergey Matyunin
2026-08-24 00:10:57 +03:00
parent 22d0f05650
commit b05eb68c3a
4 changed files with 10 additions and 12 deletions
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+5 -7
View File
@@ -2075,18 +2075,16 @@ function multiWallBevelCutsAt(
);
const ux = dx / length, uy = dy / length;
const vx = -uy, vy = ux;
// A tiny local corridor overlaps the triangle just before `hit`
// and the exterior sector just after it. Keeping this as a second
// patch avoids rotating the long bevel edges across an acute arm.
// This tapered connector is a strict subset of the original square
// corridor: it keeps the same finite cross-section at `hit` and the
// same exterior reach, but avoids two extra contour corners in every
// large-plan junction path.
const connector = stableJunctionPatch([
[hit[0] - ux * bridge + vx * bridge,
hit[1] - uy * bridge + vy * bridge],
[hit[0] - ux * bridge - vx * bridge,
hit[1] - uy * bridge - vy * bridge],
[hit[0] + ux * bridge - vx * bridge,
hit[1] + uy * bridge - vy * bridge],
[hit[0] + ux * bridge + vx * bridge,
hit[1] + uy * bridge + vy * bridge],
[hit[0] + ux * bridge, hit[1] + uy * bridge],
], map.coordinateScale);
if (connector) cuts.push(connector);
}
+1 -1
View File
@@ -1583,7 +1583,7 @@ test('issue #197 keeps the full masonry when one virtual-junction patch has ULP
// #271 removes only the area that the old node-wide 8H rectangles invented
// after finite ray endpoints; all semantic #197/#249/#261 probes above stay.
// #272 additionally opens any point-contact bevel cut to the exterior.
closeTo(geometryArea(geometry.geom), 124242.78593276718, 1e-6);
closeTo(geometryArea(geometry.geom), 124243.7732289006, 1e-6);
closeTo(geometryArea(geometry.paperGeom), 727303.8153386558, 1e-6);
assert.equal(
JSON.stringify({ rooms, walls, cuts, openings, extraBodies }), before,