@pascal-app/core 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/events/bus.d.ts +4 -2
  2. package/dist/events/bus.d.ts.map +1 -1
  3. package/dist/hooks/scene-registry/scene-registry.d.ts +2 -0
  4. package/dist/hooks/scene-registry/scene-registry.d.ts.map +1 -1
  5. package/dist/hooks/scene-registry/scene-registry.js +3 -0
  6. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +1 -1
  7. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
  8. package/dist/hooks/spatial-grid/spatial-grid-sync.js +11 -3
  9. package/dist/index.d.ts +6 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +4 -8
  12. package/dist/materials.d.ts +10 -0
  13. package/dist/materials.d.ts.map +1 -0
  14. package/dist/materials.js +22 -0
  15. package/dist/schema/index.d.ts +3 -1
  16. package/dist/schema/index.d.ts.map +1 -1
  17. package/dist/schema/index.js +3 -1
  18. package/dist/schema/material.d.ts +2 -2
  19. package/dist/schema/nodes/ceiling.d.ts +1 -1
  20. package/dist/schema/nodes/door.d.ts +1 -1
  21. package/dist/schema/nodes/item.d.ts +2 -2
  22. package/dist/schema/nodes/level.d.ts +1 -1
  23. package/dist/schema/nodes/level.d.ts.map +1 -1
  24. package/dist/schema/nodes/level.js +2 -0
  25. package/dist/schema/nodes/roof-segment.d.ts +1 -1
  26. package/dist/schema/nodes/roof.d.ts +1 -1
  27. package/dist/schema/nodes/site.d.ts +1 -1
  28. package/dist/schema/nodes/slab.d.ts +1 -1
  29. package/dist/schema/nodes/stair-segment.d.ts +81 -0
  30. package/dist/schema/nodes/stair-segment.d.ts.map +1 -0
  31. package/dist/schema/nodes/stair-segment.js +42 -0
  32. package/dist/schema/nodes/stair.d.ts +56 -0
  33. package/dist/schema/nodes/stair.d.ts.map +1 -0
  34. package/dist/schema/nodes/stair.js +22 -0
  35. package/dist/schema/nodes/wall.d.ts +1 -1
  36. package/dist/schema/nodes/window.d.ts +1 -1
  37. package/dist/schema/types.d.ts +128 -10
  38. package/dist/schema/types.d.ts.map +1 -1
  39. package/dist/schema/types.js +4 -0
  40. package/dist/store/actions/node-actions.d.ts.map +1 -1
  41. package/dist/store/actions/node-actions.js +25 -29
  42. package/dist/store/use-live-transforms.d.ts +14 -0
  43. package/dist/store/use-live-transforms.d.ts.map +1 -0
  44. package/dist/store/use-live-transforms.js +20 -0
  45. package/dist/store/use-scene.d.ts +2 -5
  46. package/dist/store/use-scene.d.ts.map +1 -1
  47. package/dist/store/use-scene.js +25 -15
  48. package/dist/systems/door/door-system.d.ts.map +1 -1
  49. package/dist/systems/door/door-system.js +1 -17
  50. package/dist/systems/roof/roof-system.d.ts.map +1 -1
  51. package/dist/systems/roof/roof-system.js +18 -0
  52. package/dist/systems/slab/slab-system.d.ts.map +1 -1
  53. package/dist/systems/slab/slab-system.js +71 -26
  54. package/dist/systems/stair/stair-system.d.ts +2 -0
  55. package/dist/systems/stair/stair-system.d.ts.map +1 -0
  56. package/dist/systems/stair/stair-system.js +354 -0
  57. package/dist/systems/wall/wall-system.d.ts.map +1 -1
  58. package/dist/systems/wall/wall-system.js +2 -0
  59. package/dist/systems/window/window-system.d.ts.map +1 -1
  60. package/dist/systems/window/window-system.js +8 -24
  61. package/dist/utils/clone-scene-graph.d.ts +25 -1
  62. package/dist/utils/clone-scene-graph.d.ts.map +1 -1
  63. package/dist/utils/clone-scene-graph.js +160 -5
  64. package/package.json +6 -1
@@ -1,5 +1,5 @@
1
1
  import type { ThreeEvent } from '@react-three/fiber';
2
- import type { BuildingNode, CeilingNode, DoorNode, ItemNode, LevelNode, RoofNode, RoofSegmentNode, SiteNode, SlabNode, WallNode, WindowNode, ZoneNode } from '../schema';
2
+ import type { BuildingNode, CeilingNode, DoorNode, ItemNode, LevelNode, RoofNode, RoofSegmentNode, SiteNode, SlabNode, StairNode, StairSegmentNode, WallNode, WindowNode, ZoneNode } from '../schema';
3
3
  import type { AnyNode } from '../schema/types';
4
4
  export interface GridEvent {
5
5
  position: [number, number, number];
@@ -23,6 +23,8 @@ export type SlabEvent = NodeEvent<SlabNode>;
23
23
  export type CeilingEvent = NodeEvent<CeilingNode>;
24
24
  export type RoofEvent = NodeEvent<RoofNode>;
25
25
  export type RoofSegmentEvent = NodeEvent<RoofSegmentNode>;
26
+ export type StairEvent = NodeEvent<StairNode>;
27
+ export type StairSegmentEvent = NodeEvent<StairSegmentNode>;
26
28
  export type WindowEvent = NodeEvent<WindowNode>;
27
29
  export type DoorEvent = NodeEvent<DoorNode>;
28
30
  export declare const eventSuffixes: readonly ["click", "move", "enter", "leave", "pointerdown", "pointerup", "context-menu", "double-click"];
@@ -61,7 +63,7 @@ type PresetEvents = {
61
63
  thumbnailUrl: string;
62
64
  };
63
65
  };
64
- type EditorEvents = GridEvents & NodeEvents<'wall', WallEvent> & NodeEvents<'item', ItemEvent> & NodeEvents<'site', SiteEvent> & NodeEvents<'building', BuildingEvent> & NodeEvents<'level', LevelEvent> & NodeEvents<'zone', ZoneEvent> & NodeEvents<'slab', SlabEvent> & NodeEvents<'ceiling', CeilingEvent> & NodeEvents<'roof', RoofEvent> & NodeEvents<'roof-segment', RoofSegmentEvent> & NodeEvents<'window', WindowEvent> & NodeEvents<'door', DoorEvent> & CameraControlEvents & ToolEvents & PresetEvents;
66
+ type EditorEvents = GridEvents & NodeEvents<'wall', WallEvent> & NodeEvents<'item', ItemEvent> & NodeEvents<'site', SiteEvent> & NodeEvents<'building', BuildingEvent> & NodeEvents<'level', LevelEvent> & NodeEvents<'zone', ZoneEvent> & NodeEvents<'slab', SlabEvent> & NodeEvents<'ceiling', CeilingEvent> & NodeEvents<'roof', RoofEvent> & NodeEvents<'roof-segment', RoofSegmentEvent> & NodeEvents<'stair', StairEvent> & NodeEvents<'stair-segment', StairSegmentEvent> & NodeEvents<'window', WindowEvent> & NodeEvents<'door', DoorEvent> & CameraControlEvents & ToolEvents & PresetEvents;
65
67
  export declare const emitter: import("mitt").Emitter<EditorEvents>;
66
68
  export {};
67
69
  //# sourceMappingURL=bus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bus.d.ts","sourceRoot":"","sources":["../../src/events/bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,EACT,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAG9C,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,WAAW,EAAE,UAAU,CAAC,YAAY,CAAC,CAAA;CACtC;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IACpD,IAAI,EAAE,CAAC,CAAA;IACP,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,WAAW,EAAE,UAAU,CAAC,YAAY,CAAC,CAAA;CACtC;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AAC3C,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AAC3C,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AAC3C,MAAM,MAAM,aAAa,GAA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jE,0BAA0B,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAA;CACvE,CAAA;AAED,KAAK,YAAY,GAAG,UAAU,GAC5B,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAC7B,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAC7B,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAC7B,UAAU,CAAC,UAAU,EAAE,aAAa,CAAC,GACrC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,GAC/B,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAC7B,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAC7B,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,GACnC,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAC7B,UAAU,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAC5C,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,GAC/B,UAAU,CAAC,eAAe,EAAE,iBAAiB,CAAC,GAC9C,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,GACjC,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,GAC7B,mBAAmB,GACnB,UAAU,GACV,YAAY,CAAA;AAEd,eAAO,MAAM,OAAO,sCAAuB,CAAA"}
@@ -12,6 +12,8 @@ export declare const sceneRegistry: {
12
12
  zone: Set<string>;
13
13
  roof: Set<string>;
14
14
  'roof-segment': Set<string>;
15
+ stair: Set<string>;
16
+ 'stair-segment': Set<string>;
15
17
  scan: Set<string>;
16
18
  guide: Set<string>;
17
19
  window: Set<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"scene-registry.d.ts","sourceRoot":"","sources":["../../../src/hooks/scene-registry/scene-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;IAuBxB,gFAAgF;;CAOjF,CAAA;AAED,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,OAAO,aAAa,CAAC,MAAM,EACvC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,QAkBrC"}
1
+ {"version":3,"file":"scene-registry.d.ts","sourceRoot":"","sources":["../../../src/hooks/scene-registry/scene-registry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;IAyBxB,gFAAgF;;CAOjF,CAAA;AAED,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,OAAO,aAAa,CAAC,MAAM,EACvC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,QAkBrC"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { useLayoutEffect } from 'react';
2
3
  export const sceneRegistry = {
3
4
  // Master lookup: ID -> Object3D
@@ -15,6 +16,8 @@ export const sceneRegistry = {
15
16
  zone: new Set(),
16
17
  roof: new Set(),
17
18
  'roof-segment': new Set(),
19
+ stair: new Set(),
20
+ 'stair-segment': new Set(),
18
21
  scan: new Set(),
19
22
  guide: new Set(),
20
23
  window: new Set(),
@@ -1,4 +1,4 @@
1
1
  import { type AnyNode } from '../../schema';
2
2
  export declare function resolveLevelId(node: AnyNode, nodes: Record<string, AnyNode>): string;
3
- export declare function initSpatialGridSync(): void;
3
+ export declare function initSpatialGridSync(): () => void;
4
4
  //# sourceMappingURL=spatial-grid-sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spatial-grid-sync.d.ts","sourceRoot":"","sources":["../../../src/hooks/spatial-grid/spatial-grid-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAMb,MAAM,cAAc,CAAA;AAQrB,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAmBpF;AAGD,wBAAgB,mBAAmB,SA8ElC"}
1
+ {"version":3,"file":"spatial-grid-sync.d.ts","sourceRoot":"","sources":["../../../src/hooks/spatial-grid/spatial-grid-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAMb,MAAM,cAAc,CAAA;AAQrB,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAmBpF;AAKD,wBAAgB,mBAAmB,IAAI,MAAM,IAAI,CAgFhD"}
@@ -21,7 +21,9 @@ export function resolveLevelId(node, nodes) {
21
21
  }
22
22
  return 'default'; // fallback for orphaned items
23
23
  }
24
- // Call this once at app initialization
24
+ // Call this once at app initialization. Returns an unsubscribe function that
25
+ // detaches the scene-store listener (useful when the editor is unmounted so
26
+ // the spatial grid singleton does not hold stale references to old scenes).
25
27
  export function initSpatialGridSync() {
26
28
  const store = useScene;
27
29
  // 1. Initial sync - process all existing nodes
@@ -33,7 +35,7 @@ export function initSpatialGridSync() {
33
35
  // 2. Then subscribe to future changes
34
36
  const markDirty = (id) => store.getState().markDirty(id);
35
37
  // Subscribe to all changes
36
- store.subscribe((state, prevState) => {
38
+ const unsubscribe = store.subscribe((state, prevState) => {
37
39
  // Detect added nodes
38
40
  for (const [id, node] of Object.entries(state.nodes)) {
39
41
  if (!prevState.nodes[id]) {
@@ -88,12 +90,13 @@ export function initSpatialGridSync() {
88
90
  }
89
91
  }
90
92
  });
93
+ return unsubscribe;
91
94
  }
92
95
  function arraysEqual(a, b) {
93
96
  return a.length === b.length && a.every((v, i) => v === b[i]);
94
97
  }
95
98
  /**
96
- * Mark all floor items and walls that overlap a slab polygon as dirty.
99
+ * Mark all floor items, walls, and stairs that may be affected by a slab change as dirty.
97
100
  */
98
101
  function markNodesOverlappingSlab(slab, nodes, markDirty) {
99
102
  if (slab.polygon.length < 3)
@@ -119,5 +122,10 @@ function markNodesOverlappingSlab(slab, nodes, markDirty) {
119
122
  markDirty(node.id);
120
123
  }
121
124
  }
125
+ else if (node.type === 'stair') {
126
+ if (resolveLevelId(node, nodes) !== slabLevelId)
127
+ continue;
128
+ markDirty(node.id);
129
+ }
122
130
  }
123
131
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { BuildingEvent, CameraControlEvent, CeilingEvent, DoorEvent, EventSuffix, GridEvent, ItemEvent, LevelEvent, NodeEvent, RoofEvent, RoofSegmentEvent, SiteEvent, SlabEvent, WallEvent, WindowEvent, ZoneEvent, } from './events/bus';
1
+ export type { BuildingEvent, CameraControlEvent, CeilingEvent, DoorEvent, EventSuffix, GridEvent, ItemEvent, LevelEvent, NodeEvent, RoofEvent, RoofSegmentEvent, SiteEvent, SlabEvent, StairEvent, StairSegmentEvent, WallEvent, WindowEvent, ZoneEvent, } from './events/bus';
2
2
  export { emitter, eventSuffixes } from './events/bus';
3
3
  export { sceneRegistry, useRegistry, } from './hooks/scene-registry/scene-registry';
4
4
  export { pointInPolygon, spatialGridManager } from './hooks/spatial-grid/spatial-grid-manager';
@@ -6,18 +6,22 @@ export { initSpatialGridSync, resolveLevelId, } from './hooks/spatial-grid/spati
6
6
  export { useSpatialQuery } from './hooks/spatial-grid/use-spatial-query';
7
7
  export { loadAssetUrl, saveAsset } from './lib/asset-storage';
8
8
  export { detectSpacesForLevel, initSpaceDetectionSync, type Space, wallTouchesOthers, } from './lib/space-detection';
9
+ export { baseMaterial, glassMaterial } from './materials';
9
10
  export * from './schema';
10
11
  export { type ControlValue, type ItemInteractiveState, useInteractive, } from './store/use-interactive';
12
+ export { default as useLiveTransforms, type LiveTransform } from './store/use-live-transforms';
11
13
  export { clearSceneHistory, default as useScene } from './store/use-scene';
12
14
  export { CeilingSystem } from './systems/ceiling/ceiling-system';
13
15
  export { DoorSystem } from './systems/door/door-system';
14
16
  export { ItemSystem } from './systems/item/item-system';
15
17
  export { RoofSystem } from './systems/roof/roof-system';
16
18
  export { SlabSystem } from './systems/slab/slab-system';
19
+ export { StairSystem } from './systems/stair/stair-system';
17
20
  export { DEFAULT_WALL_HEIGHT, DEFAULT_WALL_THICKNESS, getWallPlanFootprint, getWallThickness, } from './systems/wall/wall-footprint';
18
21
  export { calculateLevelMiters, type Point2D, pointToKey, type WallMiterData, } from './systems/wall/wall-mitering';
19
22
  export { WallSystem } from './systems/wall/wall-system';
20
23
  export { WindowSystem } from './systems/window/window-system';
21
- export { cloneSceneGraph } from './utils/clone-scene-graph';
24
+ export type { SceneGraph } from './utils/clone-scene-graph';
25
+ export { cloneLevelSubtree, cloneSceneGraph, forkSceneGraph } from './utils/clone-scene-graph';
22
26
  export { isObject } from './utils/types';
23
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,GACV,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAErD,OAAO,EACL,aAAa,EACb,WAAW,GACZ,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAA;AAC9F,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAExE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,EACL,oBAAoB,EACpB,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UAAU,EACV,KAAK,aAAa,GACnB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
package/dist/index.js CHANGED
@@ -1,28 +1,24 @@
1
- // Store
2
- // Events
3
1
  export { emitter, eventSuffixes } from './events/bus';
4
- // Hooks
5
2
  export { sceneRegistry, useRegistry, } from './hooks/scene-registry/scene-registry';
6
3
  export { pointInPolygon, spatialGridManager } from './hooks/spatial-grid/spatial-grid-manager';
7
4
  export { initSpatialGridSync, resolveLevelId, } from './hooks/spatial-grid/spatial-grid-sync';
8
5
  export { useSpatialQuery } from './hooks/spatial-grid/use-spatial-query';
9
- // Asset storage
10
6
  export { loadAssetUrl, saveAsset } from './lib/asset-storage';
11
- // Space detection
12
7
  export { detectSpacesForLevel, initSpaceDetectionSync, wallTouchesOthers, } from './lib/space-detection';
13
- // Schema
8
+ export { baseMaterial, glassMaterial } from './materials';
14
9
  export * from './schema';
15
10
  export { useInteractive, } from './store/use-interactive';
11
+ export { default as useLiveTransforms } from './store/use-live-transforms';
16
12
  export { clearSceneHistory, default as useScene } from './store/use-scene';
17
- // Systems
18
13
  export { CeilingSystem } from './systems/ceiling/ceiling-system';
19
14
  export { DoorSystem } from './systems/door/door-system';
20
15
  export { ItemSystem } from './systems/item/item-system';
21
16
  export { RoofSystem } from './systems/roof/roof-system';
22
17
  export { SlabSystem } from './systems/slab/slab-system';
18
+ export { StairSystem } from './systems/stair/stair-system';
23
19
  export { DEFAULT_WALL_HEIGHT, DEFAULT_WALL_THICKNESS, getWallPlanFootprint, getWallThickness, } from './systems/wall/wall-footprint';
24
20
  export { calculateLevelMiters, pointToKey, } from './systems/wall/wall-mitering';
25
21
  export { WallSystem } from './systems/wall/wall-system';
26
22
  export { WindowSystem } from './systems/window/window-system';
27
- export { cloneSceneGraph } from './utils/clone-scene-graph';
23
+ export { cloneLevelSubtree, cloneSceneGraph, forkSceneGraph } from './utils/clone-scene-graph';
28
24
  export { isObject } from './utils/types';
@@ -0,0 +1,10 @@
1
+ import { MeshStandardNodeMaterial } from 'three/webgpu';
2
+ /**
3
+ * Shared base material for structural elements: walls, frames, slabs, roof.
4
+ */
5
+ export declare const baseMaterial: MeshStandardNodeMaterial;
6
+ /**
7
+ * Shared glass material for windows, glazed door panels, and glass items.
8
+ */
9
+ export declare const glassMaterial: MeshStandardNodeMaterial;
10
+ //# sourceMappingURL=materials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"materials.d.ts","sourceRoot":"","sources":["../src/materials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,YAAY,0BAIvB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,0BASxB,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { DoubleSide, MeshStandardNodeMaterial } from 'three/webgpu';
2
+ /**
3
+ * Shared base material for structural elements: walls, frames, slabs, roof.
4
+ */
5
+ export const baseMaterial = new MeshStandardNodeMaterial({
6
+ color: '#f2f0ed',
7
+ roughness: 0.5,
8
+ metalness: 0,
9
+ });
10
+ /**
11
+ * Shared glass material for windows, glazed door panels, and glass items.
12
+ */
13
+ export const glassMaterial = new MeshStandardNodeMaterial({
14
+ name: 'glass',
15
+ color: 'lightblue',
16
+ roughness: 0.05,
17
+ metalness: 0.1,
18
+ transparent: true,
19
+ opacity: 0.35,
20
+ side: DoubleSide,
21
+ depthWrite: false,
22
+ });
@@ -1,4 +1,4 @@
1
- export { BaseNode, generateId, nodeType, objectId } from './base';
1
+ export { BaseNode, generateId, Material, nodeType, objectId } from './base';
2
2
  export { CameraSchema } from './camera';
3
3
  export { type Collection, type CollectionId, generateCollectionId } from './collections';
4
4
  export { DEFAULT_MATERIALS, MaterialPreset, MaterialProperties, MaterialSchema, resolveMaterial, } from './material';
@@ -14,6 +14,8 @@ export { RoofSegmentNode, RoofType } from './nodes/roof-segment';
14
14
  export { ScanNode } from './nodes/scan';
15
15
  export { SiteNode } from './nodes/site';
16
16
  export { SlabNode } from './nodes/slab';
17
+ export { StairNode } from './nodes/stair';
18
+ export { AttachmentSide, StairSegmentNode, StairSegmentType } from './nodes/stair-segment';
17
19
  export { WallNode } from './nodes/wall';
18
20
  export { WindowNode } from './nodes/window';
19
21
  export { ZoneNode } from './nodes/zone';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAExF,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,YAAY,EACV,eAAe,EACf,KAAK,EACL,UAAU,EACV,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,OAAO,E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Ae,CAAA;AACzC,YAAY,EACV,eAAe,EACf,KAAK,EACL,UAAU,EACV,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
@@ -1,5 +1,5 @@
1
1
  // Base
2
- export { BaseNode, generateId, nodeType, objectId } from './base';
2
+ export { BaseNode, generateId, Material, nodeType, objectId } from './base';
3
3
  // Camera
4
4
  export { CameraSchema } from './camera';
5
5
  // Collections
@@ -18,6 +18,8 @@ export { ScanNode } from './nodes/scan';
18
18
  // Nodes
19
19
  export { SiteNode } from './nodes/site';
20
20
  export { SlabNode } from './nodes/slab';
21
+ export { StairNode } from './nodes/stair';
22
+ export { AttachmentSide, StairSegmentNode, StairSegmentType } from './nodes/stair-segment';
21
23
  export { WallNode } from './nodes/wall';
22
24
  export { WindowNode } from './nodes/window';
23
25
  export { ZoneNode } from './nodes/zone';
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const MaterialPreset: z.ZodEnum<{
3
+ custom: "custom";
3
4
  white: "white";
4
5
  brick: "brick";
5
6
  concrete: "concrete";
@@ -9,7 +10,6 @@ export declare const MaterialPreset: z.ZodEnum<{
9
10
  plaster: "plaster";
10
11
  tile: "tile";
11
12
  marble: "marble";
12
- custom: "custom";
13
13
  }>;
14
14
  export type MaterialPreset = z.infer<typeof MaterialPreset>;
15
15
  export declare const MaterialProperties: z.ZodObject<{
@@ -27,6 +27,7 @@ export declare const MaterialProperties: z.ZodObject<{
27
27
  export type MaterialProperties = z.infer<typeof MaterialProperties>;
28
28
  export declare const MaterialSchema: z.ZodObject<{
29
29
  preset: z.ZodOptional<z.ZodEnum<{
30
+ custom: "custom";
30
31
  white: "white";
31
32
  brick: "brick";
32
33
  concrete: "concrete";
@@ -36,7 +37,6 @@ export declare const MaterialSchema: z.ZodObject<{
36
37
  plaster: "plaster";
37
38
  tile: "tile";
38
39
  marble: "marble";
39
- custom: "custom";
40
40
  }>>;
41
41
  properties: z.ZodOptional<z.ZodObject<{
42
42
  color: z.ZodDefault<z.ZodString>;
@@ -20,6 +20,7 @@ export declare const CeilingNode: z.ZodObject<{
20
20
  children: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodTemplateLiteral<`item_${string}`>>>>;
21
21
  material: z.ZodOptional<z.ZodObject<{
22
22
  preset: z.ZodOptional<z.ZodEnum<{
23
+ custom: "custom";
23
24
  white: "white";
24
25
  brick: "brick";
25
26
  concrete: "concrete";
@@ -29,7 +30,6 @@ export declare const CeilingNode: z.ZodObject<{
29
30
  plaster: "plaster";
30
31
  tile: "tile";
31
32
  marble: "marble";
32
- custom: "custom";
33
33
  }>>;
34
34
  properties: z.ZodOptional<z.ZodObject<{
35
35
  color: z.ZodDefault<z.ZodString>;
@@ -32,6 +32,7 @@ export declare const DoorNode: z.ZodObject<{
32
32
  type: z.ZodDefault<z.ZodLiteral<"door">>;
33
33
  material: z.ZodOptional<z.ZodObject<{
34
34
  preset: z.ZodOptional<z.ZodEnum<{
35
+ custom: "custom";
35
36
  white: "white";
36
37
  brick: "brick";
37
38
  concrete: "concrete";
@@ -41,7 +42,6 @@ export declare const DoorNode: z.ZodObject<{
41
42
  plaster: "plaster";
42
43
  tile: "tile";
43
44
  marble: "marble";
44
- custom: "custom";
45
45
  }>>;
46
46
  properties: z.ZodOptional<z.ZodObject<{
47
47
  color: z.ZodDefault<z.ZodString>;
@@ -146,9 +146,9 @@ declare const assetSchema: z.ZodObject<{
146
146
  src: z.ZodString;
147
147
  dimensions: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
148
148
  attachTo: z.ZodOptional<z.ZodEnum<{
149
- ceiling: "ceiling";
150
149
  wall: "wall";
151
150
  "wall-side": "wall-side";
151
+ ceiling: "ceiling";
152
152
  }>>;
153
153
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
154
154
  offset: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
@@ -241,9 +241,9 @@ export declare const ItemNode: z.ZodObject<{
241
241
  src: z.ZodString;
242
242
  dimensions: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
243
243
  attachTo: z.ZodOptional<z.ZodEnum<{
244
- ceiling: "ceiling";
245
244
  wall: "wall";
246
245
  "wall-side": "wall-side";
246
+ ceiling: "ceiling";
247
247
  }>>;
248
248
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
249
249
  offset: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
@@ -17,7 +17,7 @@ export declare const LevelNode: z.ZodObject<{
17
17
  metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
18
18
  id: z.ZodDefault<z.ZodTemplateLiteral<`level_${string}`>>;
19
19
  type: z.ZodDefault<z.ZodLiteral<"level">>;
20
- children: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodDefault<z.ZodTemplateLiteral<`wall_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`zone_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`slab_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`ceiling_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`roof_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`scan_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`guide_${string}`>>]>>>;
20
+ children: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodDefault<z.ZodTemplateLiteral<`wall_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`zone_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`slab_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`ceiling_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`roof_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`stair_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`scan_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`guide_${string}`>>]>>>;
21
21
  level: z.ZodDefault<z.ZodNumber>;
22
22
  }, z.core.$strip>;
23
23
  export type LevelNode = z.infer<typeof LevelNode>;
@@ -1 +1 @@
1
- {"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/level.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;iBAwBrB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA"}
1
+ {"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/level.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;iBAyBrB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -6,6 +6,7 @@ import { GuideNode } from './guide';
6
6
  import { RoofNode } from './roof';
7
7
  import { ScanNode } from './scan';
8
8
  import { SlabNode } from './slab';
9
+ import { StairNode } from './stair';
9
10
  import { WallNode } from './wall';
10
11
  import { ZoneNode } from './zone';
11
12
  export const LevelNode = BaseNode.extend({
@@ -18,6 +19,7 @@ export const LevelNode = BaseNode.extend({
18
19
  SlabNode.shape.id,
19
20
  CeilingNode.shape.id,
20
21
  RoofNode.shape.id,
22
+ StairNode.shape.id,
21
23
  ScanNode.shape.id,
22
24
  GuideNode.shape.id,
23
25
  ]))
@@ -29,6 +29,7 @@ export declare const RoofSegmentNode: z.ZodObject<{
29
29
  type: z.ZodDefault<z.ZodLiteral<"roof-segment">>;
30
30
  material: z.ZodOptional<z.ZodObject<{
31
31
  preset: z.ZodOptional<z.ZodEnum<{
32
+ custom: "custom";
32
33
  white: "white";
33
34
  brick: "brick";
34
35
  concrete: "concrete";
@@ -38,7 +39,6 @@ export declare const RoofSegmentNode: z.ZodObject<{
38
39
  plaster: "plaster";
39
40
  tile: "tile";
40
41
  marble: "marble";
41
- custom: "custom";
42
42
  }>>;
43
43
  properties: z.ZodOptional<z.ZodObject<{
44
44
  color: z.ZodDefault<z.ZodString>;
@@ -19,6 +19,7 @@ export declare const RoofNode: z.ZodObject<{
19
19
  type: z.ZodDefault<z.ZodLiteral<"roof">>;
20
20
  material: z.ZodOptional<z.ZodObject<{
21
21
  preset: z.ZodOptional<z.ZodEnum<{
22
+ custom: "custom";
22
23
  white: "white";
23
24
  brick: "brick";
24
25
  concrete: "concrete";
@@ -28,7 +29,6 @@ export declare const RoofNode: z.ZodObject<{
28
29
  plaster: "plaster";
29
30
  tile: "tile";
30
31
  marble: "marble";
31
- custom: "custom";
32
32
  }>>;
33
33
  properties: z.ZodOptional<z.ZodObject<{
34
34
  color: z.ZodDefault<z.ZodString>;
@@ -79,9 +79,9 @@ export declare const SiteNode: z.ZodObject<{
79
79
  src: z.ZodString;
80
80
  dimensions: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
81
81
  attachTo: z.ZodOptional<z.ZodEnum<{
82
- ceiling: "ceiling";
83
82
  wall: "wall";
84
83
  "wall-side": "wall-side";
84
+ ceiling: "ceiling";
85
85
  }>>;
86
86
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
87
87
  offset: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
@@ -19,6 +19,7 @@ export declare const SlabNode: z.ZodObject<{
19
19
  type: z.ZodDefault<z.ZodLiteral<"slab">>;
20
20
  material: z.ZodOptional<z.ZodObject<{
21
21
  preset: z.ZodOptional<z.ZodEnum<{
22
+ custom: "custom";
22
23
  white: "white";
23
24
  brick: "brick";
24
25
  concrete: "concrete";
@@ -28,7 +29,6 @@ export declare const SlabNode: z.ZodObject<{
28
29
  plaster: "plaster";
29
30
  tile: "tile";
30
31
  marble: "marble";
31
- custom: "custom";
32
32
  }>>;
33
33
  properties: z.ZodOptional<z.ZodObject<{
34
34
  color: z.ZodDefault<z.ZodString>;
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ export declare const StairSegmentType: z.ZodEnum<{
3
+ stair: "stair";
4
+ landing: "landing";
5
+ }>;
6
+ export type StairSegmentType = z.infer<typeof StairSegmentType>;
7
+ export declare const AttachmentSide: z.ZodEnum<{
8
+ front: "front";
9
+ left: "left";
10
+ right: "right";
11
+ }>;
12
+ export type AttachmentSide = z.infer<typeof AttachmentSide>;
13
+ export declare const StairSegmentNode: z.ZodObject<{
14
+ object: z.ZodDefault<z.ZodLiteral<"node">>;
15
+ name: z.ZodOptional<z.ZodString>;
16
+ parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
17
+ visible: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
18
+ camera: z.ZodOptional<z.ZodObject<{
19
+ position: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
20
+ target: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
21
+ mode: z.ZodDefault<z.ZodEnum<{
22
+ perspective: "perspective";
23
+ orthographic: "orthographic";
24
+ }>>;
25
+ fov: z.ZodOptional<z.ZodNumber>;
26
+ zoom: z.ZodOptional<z.ZodNumber>;
27
+ }, z.core.$strip>>;
28
+ metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
29
+ id: z.ZodDefault<z.ZodTemplateLiteral<`sseg_${string}`>>;
30
+ type: z.ZodDefault<z.ZodLiteral<"stair-segment">>;
31
+ material: z.ZodOptional<z.ZodObject<{
32
+ preset: z.ZodOptional<z.ZodEnum<{
33
+ custom: "custom";
34
+ white: "white";
35
+ brick: "brick";
36
+ concrete: "concrete";
37
+ wood: "wood";
38
+ glass: "glass";
39
+ metal: "metal";
40
+ plaster: "plaster";
41
+ tile: "tile";
42
+ marble: "marble";
43
+ }>>;
44
+ properties: z.ZodOptional<z.ZodObject<{
45
+ color: z.ZodDefault<z.ZodString>;
46
+ roughness: z.ZodDefault<z.ZodNumber>;
47
+ metalness: z.ZodDefault<z.ZodNumber>;
48
+ opacity: z.ZodDefault<z.ZodNumber>;
49
+ transparent: z.ZodDefault<z.ZodBoolean>;
50
+ side: z.ZodDefault<z.ZodEnum<{
51
+ front: "front";
52
+ back: "back";
53
+ double: "double";
54
+ }>>;
55
+ }, z.core.$strip>>;
56
+ texture: z.ZodOptional<z.ZodObject<{
57
+ url: z.ZodString;
58
+ repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
59
+ scale: z.ZodOptional<z.ZodNumber>;
60
+ }, z.core.$strip>>;
61
+ }, z.core.$strip>>;
62
+ position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
63
+ rotation: z.ZodDefault<z.ZodNumber>;
64
+ segmentType: z.ZodDefault<z.ZodEnum<{
65
+ stair: "stair";
66
+ landing: "landing";
67
+ }>>;
68
+ width: z.ZodDefault<z.ZodNumber>;
69
+ length: z.ZodDefault<z.ZodNumber>;
70
+ height: z.ZodDefault<z.ZodNumber>;
71
+ stepCount: z.ZodDefault<z.ZodNumber>;
72
+ attachmentSide: z.ZodDefault<z.ZodEnum<{
73
+ front: "front";
74
+ left: "left";
75
+ right: "right";
76
+ }>>;
77
+ fillToFloor: z.ZodDefault<z.ZodBoolean>;
78
+ thickness: z.ZodDefault<z.ZodNumber>;
79
+ }, z.core.$strip>;
80
+ export type StairSegmentNode = z.infer<typeof StairSegmentNode>;
81
+ //# sourceMappingURL=stair-segment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stair-segment.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/stair-segment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,gBAAgB;;;EAA+B,CAAA;AAE5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,cAAc;;;;EAAqC,CAAA;AAEhE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqC5B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
@@ -0,0 +1,42 @@
1
+ import dedent from 'dedent';
2
+ import { z } from 'zod';
3
+ import { BaseNode, nodeType, objectId } from '../base';
4
+ import { MaterialSchema } from '../material';
5
+ export const StairSegmentType = z.enum(['stair', 'landing']);
6
+ export const AttachmentSide = z.enum(['front', 'left', 'right']);
7
+ export const StairSegmentNode = BaseNode.extend({
8
+ id: objectId('sseg'),
9
+ type: nodeType('stair-segment'),
10
+ material: MaterialSchema.optional(),
11
+ position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
12
+ // Rotation around Y axis in radians
13
+ rotation: z.number().default(0),
14
+ // Stair or landing
15
+ segmentType: StairSegmentType.default('stair'),
16
+ // Width of the stair flight / landing
17
+ width: z.number().default(1.0),
18
+ // Horizontal run (depth along travel direction)
19
+ length: z.number().default(3.0),
20
+ // Vertical rise (0 for landings)
21
+ height: z.number().default(2.5),
22
+ // Number of steps (only used for stair type)
23
+ stepCount: z.number().default(10),
24
+ // Which side of the previous segment to attach to
25
+ attachmentSide: AttachmentSide.default('front'),
26
+ // Whether to fill the underside down to floor level
27
+ fillToFloor: z.boolean().default(true),
28
+ // Thickness of the stair slab when not filled to floor
29
+ thickness: z.number().default(0.25),
30
+ }).describe(dedent `
31
+ Stair segment node - an individual flight or landing within a stair group.
32
+ Each segment generates a complete stair/landing geometry.
33
+ Multiple segments chain together to form complex staircase shapes (L-shape, U-shape, etc.).
34
+ - segmentType: stair (with steps) or landing (flat platform)
35
+ - width: width of the flight/landing
36
+ - length: horizontal run distance
37
+ - height: vertical rise (0 for landings)
38
+ - stepCount: number of steps (stair type only)
39
+ - attachmentSide: front, left, or right - which side of the previous segment to attach to
40
+ - fillToFloor: whether to fill the underside down to the absolute floor level
41
+ - thickness: slab thickness when not filled to floor
42
+ `);