mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
Fix prerelease smoke regressions
This commit is contained in:
@@ -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 }];
|
||||
|
||||
Reference in New Issue
Block a user