Refine elevator sync and viewer rebuild handling

This commit is contained in:
sudhir
2026-05-13 22:28:19 +05:30
parent 9838d2cd4f
commit ce69433a1a
8 changed files with 76 additions and 40 deletions
@@ -1,6 +1,7 @@
import { z } from 'zod'
export const SurfaceHoleMetadata = z.object({
// Stair/elevator auto-openings use stairId/elevatorId so sync can replace only its own holes.
source: z.enum(['manual', 'stair', 'elevator']).default('manual'),
stairId: z.string().optional(),
elevatorId: z.string().optional(),
@@ -1,15 +1,16 @@
import { resolveLevelId } from '../../hooks/spatial-grid/spatial-grid-sync'
import type { AnyNode, AnyNodeId, CeilingNode, ElevatorNode, SlabNode } from '../../schema'
import type {
AnyNode,
AnyNodeId,
CeilingNode,
ElevatorNode,
SlabNode,
SurfaceHoleMetadata,
} from '../../schema'
import { resolveElevatorServiceLevels } from './elevator-service'
type Point2D = [number, number]
type SurfaceHoleMetadata = {
source: 'manual' | 'stair' | 'elevator'
elevatorId?: string
stairId?: string
}
const ELEVATOR_OPENING_PADDING = 0.08
const DEFAULT_ELEVATOR_SHAFT_WALL_THICKNESS = 0.09
@@ -6,17 +6,12 @@ import type {
SlabNode,
StairNode,
StairSegmentNode,
SurfaceHoleMetadata,
} from '../../schema'
import { DEFAULT_WALL_HEIGHT } from '../wall/wall-footprint'
type Point2D = [number, number]
type SurfaceHoleMetadata = {
source: 'manual' | 'stair' | 'elevator'
elevatorId?: string
stairId?: string
}
type SegmentTransform = {
position: [number, number, number]
rotation: number