Fix slab updates for curved wall changes

This commit is contained in:
sudhir
2026-04-16 11:21:28 +05:30
parent b4bf196d31
commit 5c92d071f7
+4 -3
View File
@@ -1,3 +1,4 @@
import { getClampedWallCurveOffset, sampleWallCenterline } from '../systems/wall/wall-curve'
import { SlabNode, type SlabNode as SlabNodeType, type WallNode } from '../schema'
type Point2D = { x: number; y: number }
@@ -178,9 +179,8 @@ function getWallDirection(wall: Pick<WallNode, 'start' | 'end'>) {
}
function getDirectedWallBoundaryPoints(wall: WallNode, forward: boolean) {
const start = pointFromTuple(wall.start)
const end = pointFromTuple(wall.end)
return forward ? [start, end] : [end, start]
const points = sampleWallCenterline(wall).map((point) => ({ x: point.x, y: point.y }))
return forward ? points : [...points].reverse()
}
function extractRoomPolygons(walls: WallNode[]): Point2D[][] {
@@ -394,6 +394,7 @@ function wallGeometrySignature(wall: WallNode) {
wall.end[0].toFixed(4),
wall.end[1].toFixed(4),
(wall.thickness ?? 0.2).toFixed(4),
getClampedWallCurveOffset(wall).toFixed(4),
].join('|')
}