Fix prerelease smoke regressions

This commit is contained in:
Matysh
2026-08-08 21:42:49 +03:00
parent e177c14603
commit ddbd3288fe
7 changed files with 40 additions and 12 deletions
+12
View File
@@ -348,6 +348,18 @@ test('opening face side is known without wall thickness and can be inverted for
assert.equal(bottomInner.side, -1, 'the bottom wall room side is -Y');
});
test('opening face keeps the first room side on an ambiguous shared wall', () => {
const rooms = [
{ id: 'large-first', poly: [[0, 0], [10, 0], [10, 8], [0, 8]] },
{ id: 'small-second', poly: [[3, 8], [7, 8], [7, 11], [3, 11]] },
];
const opening = { x: 5, y: 8, angle: 0, length: 2 };
const natural = openingInnerFaceOffset(rooms, opening, [], pitch, cellCm, pitch);
const flipped = openingInnerFaceOffset(rooms, { ...opening, flip_v: true }, [], pitch, cellCm, pitch);
assert.equal(natural.side, -1, 'the first room is above the wall, so its inner face is -Y');
assert.equal(flipped.side, 1, 'flip_v selects the opposite face without an area-based side swap');
});
test('openingTunnelGeometry: an outer thick wall gives the one room both tunnel halves', () => {
const rooms = [{ id: 'r', poly: [[0, 0], [10, 0], [10, 6], [0, 6]] }];
const walls = [{ key: wallKey([0, 0], [10, 0], pitch), cm: 20 }];