@pascal-app/core 0.6.0 → 0.7.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 (81) hide show
  1. package/dist/events/bus.d.ts +38 -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 +2 -0
  6. package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
  7. package/dist/hooks/spatial-grid/spatial-grid-manager.js +164 -6
  8. package/dist/index.d.ts +8 -15
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +7 -14
  11. package/dist/lib/door-operation.d.ts +7 -0
  12. package/dist/lib/door-operation.d.ts.map +1 -0
  13. package/dist/lib/door-operation.js +25 -0
  14. package/dist/lib/slab-polygon.d.ts +3 -0
  15. package/dist/lib/slab-polygon.d.ts.map +1 -0
  16. package/dist/lib/slab-polygon.js +58 -0
  17. package/dist/material-library.d.ts +5 -3
  18. package/dist/material-library.d.ts.map +1 -1
  19. package/dist/material-library.js +26 -49
  20. package/dist/schema/asset-url.d.ts +34 -0
  21. package/dist/schema/asset-url.d.ts.map +1 -0
  22. package/dist/schema/asset-url.js +79 -0
  23. package/dist/schema/asset-url.test.d.ts +2 -0
  24. package/dist/schema/asset-url.test.d.ts.map +1 -0
  25. package/dist/schema/asset-url.test.js +138 -0
  26. package/dist/schema/index.d.ts +7 -5
  27. package/dist/schema/index.d.ts.map +1 -1
  28. package/dist/schema/index.js +5 -3
  29. package/dist/schema/material.d.ts +3 -2
  30. package/dist/schema/material.d.ts.map +1 -1
  31. package/dist/schema/material.js +13 -11
  32. package/dist/schema/nodes/ceiling.d.ts +1 -1
  33. package/dist/schema/nodes/column.d.ts +520 -0
  34. package/dist/schema/nodes/column.d.ts.map +1 -0
  35. package/dist/schema/nodes/column.js +385 -0
  36. package/dist/schema/nodes/door.d.ts +73 -1
  37. package/dist/schema/nodes/door.d.ts.map +1 -1
  38. package/dist/schema/nodes/door.js +39 -2
  39. package/dist/schema/nodes/fence.d.ts +1 -1
  40. package/dist/schema/nodes/guide.d.ts +17 -0
  41. package/dist/schema/nodes/guide.d.ts.map +1 -1
  42. package/dist/schema/nodes/guide.js +11 -1
  43. package/dist/schema/nodes/item.d.ts +8 -0
  44. package/dist/schema/nodes/item.d.ts.map +1 -1
  45. package/dist/schema/nodes/item.js +18 -1
  46. package/dist/schema/nodes/level.d.ts +1 -1
  47. package/dist/schema/nodes/level.d.ts.map +1 -1
  48. package/dist/schema/nodes/level.js +6 -0
  49. package/dist/schema/nodes/roof-segment.d.ts +1 -1
  50. package/dist/schema/nodes/roof.d.ts +4 -4
  51. package/dist/schema/nodes/scan.d.ts.map +1 -1
  52. package/dist/schema/nodes/scan.js +2 -1
  53. package/dist/schema/nodes/site.d.ts +1 -0
  54. package/dist/schema/nodes/site.d.ts.map +1 -1
  55. package/dist/schema/nodes/slab.d.ts +1 -1
  56. package/dist/schema/nodes/spawn.d.ts +24 -0
  57. package/dist/schema/nodes/spawn.d.ts.map +1 -0
  58. package/dist/schema/nodes/spawn.js +8 -0
  59. package/dist/schema/nodes/stair-segment.d.ts +1 -1
  60. package/dist/schema/nodes/stair.d.ts +8 -8
  61. package/dist/schema/nodes/wall.d.ts +3 -3
  62. package/dist/schema/nodes/window.d.ts +56 -1
  63. package/dist/schema/nodes/window.d.ts.map +1 -1
  64. package/dist/schema/nodes/window.js +29 -0
  65. package/dist/schema/types.d.ts +324 -21
  66. package/dist/schema/types.d.ts.map +1 -1
  67. package/dist/schema/types.js +4 -0
  68. package/dist/store/actions/node-actions.d.ts.map +1 -1
  69. package/dist/store/actions/node-actions.js +6 -5
  70. package/dist/store/use-interactive.d.ts +43 -0
  71. package/dist/store/use-interactive.d.ts.map +1 -1
  72. package/dist/store/use-interactive.js +66 -0
  73. package/dist/store/use-scene.d.ts.map +1 -1
  74. package/dist/store/use-scene.js +60 -2
  75. package/dist/systems/stair/stair-opening-sync.d.ts.map +1 -1
  76. package/dist/systems/stair/stair-opening-sync.js +81 -20
  77. package/dist/systems/stair/stair-opening-sync.test.d.ts +2 -0
  78. package/dist/systems/stair/stair-opening-sync.test.d.ts.map +1 -0
  79. package/dist/systems/stair/stair-opening-sync.test.js +65 -0
  80. package/dist/systems/stair/stair-system.js +1 -1
  81. package/package.json +31 -3
@@ -1,5 +1,6 @@
1
1
  import dedent from 'dedent';
2
2
  import { z } from 'zod';
3
+ import { AssetUrl } from '../asset-url';
3
4
  import { BaseNode, nodeType, objectId } from '../base';
4
5
  // --- Control descriptors ---
5
6
  const toggleControlSchema = z.object({
@@ -57,7 +58,10 @@ const assetSchema = z.object({
57
58
  category: z.string(),
58
59
  name: z.string(),
59
60
  thumbnail: z.string(),
60
- src: z.string(),
61
+ // Optional top-down 2D image shown inside the item's footprint on the
62
+ // floor plan. When present, replaces the default diagonal-cross marker.
63
+ floorPlanUrl: z.string().optional(),
64
+ src: AssetUrl,
61
65
  dimensions: z.tuple([z.number(), z.number(), z.number()]).default([1, 1, 1]), // [w, h, d]
62
66
  attachTo: z.enum(['wall', 'wall-side', 'ceiling']).optional(),
63
67
  tags: z.array(z.string()).optional(),
@@ -99,6 +103,19 @@ export const ItemNode = BaseNode.extend({
99
103
  - scale: corrective scale for the model
100
104
  - tags: tags associated with the item
101
105
  `);
106
+ export const LOW_PROFILE_ITEM_SURFACE_MAX_HEIGHT = 0.1;
107
+ /**
108
+ * Low, floor-resting items like rugs and parking mats can receive items visually,
109
+ * but should not become item parents or block normal floor placement.
110
+ */
111
+ export function isLowProfileItemSurface(item) {
112
+ if (item.asset.attachTo)
113
+ return false;
114
+ const surfaceHeight = item.asset.surface
115
+ ? item.asset.surface.height * item.scale[1]
116
+ : getScaledDimensions(item)[1];
117
+ return surfaceHeight <= LOW_PROFILE_ITEM_SURFACE_MAX_HEIGHT;
118
+ }
102
119
  /**
103
120
  * Returns the effective world-space dimensions of an item after applying its scale.
104
121
  * Use this everywhere item.asset.dimensions is used for spatial calculations.
@@ -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<`fence_${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}`>>]>>>;
20
+ children: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodDefault<z.ZodTemplateLiteral<`wall_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`fence_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`column_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`item_${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}`>>, z.ZodDefault<z.ZodTemplateLiteral<`spawn_${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;AAYvB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;iBA0BrB,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;AAevB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;iBA6BrB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -2,11 +2,14 @@ import dedent from 'dedent';
2
2
  import { z } from 'zod';
3
3
  import { BaseNode, nodeType, objectId } from '../base';
4
4
  import { CeilingNode } from './ceiling';
5
+ import { ColumnNode } from './column';
5
6
  import { FenceNode } from './fence';
6
7
  import { GuideNode } from './guide';
8
+ import { ItemNode } from './item';
7
9
  import { RoofNode } from './roof';
8
10
  import { ScanNode } from './scan';
9
11
  import { SlabNode } from './slab';
12
+ import { SpawnNode } from './spawn';
10
13
  import { StairNode } from './stair';
11
14
  import { WallNode } from './wall';
12
15
  import { ZoneNode } from './zone';
@@ -17,6 +20,8 @@ export const LevelNode = BaseNode.extend({
17
20
  .array(z.union([
18
21
  WallNode.shape.id,
19
22
  FenceNode.shape.id,
23
+ ColumnNode.shape.id,
24
+ ItemNode.shape.id,
20
25
  ZoneNode.shape.id,
21
26
  SlabNode.shape.id,
22
27
  CeilingNode.shape.id,
@@ -24,6 +29,7 @@ export const LevelNode = BaseNode.extend({
24
29
  StairNode.shape.id,
25
30
  ScanNode.shape.id,
26
31
  GuideNode.shape.id,
32
+ SpawnNode.shape.id,
27
33
  ]))
28
34
  .default([]),
29
35
  // Specific props
@@ -30,7 +30,6 @@ export declare const RoofSegmentNode: z.ZodObject<{
30
30
  material: z.ZodOptional<z.ZodObject<{
31
31
  id: z.ZodOptional<z.ZodString>;
32
32
  preset: z.ZodOptional<z.ZodEnum<{
33
- custom: "custom";
34
33
  white: "white";
35
34
  brick: "brick";
36
35
  concrete: "concrete";
@@ -40,6 +39,7 @@ export declare const RoofSegmentNode: z.ZodObject<{
40
39
  plaster: "plaster";
41
40
  tile: "tile";
42
41
  marble: "marble";
42
+ custom: "custom";
43
43
  }>>;
44
44
  properties: z.ZodOptional<z.ZodObject<{
45
45
  color: z.ZodDefault<z.ZodString>;
@@ -26,7 +26,6 @@ export declare const RoofNode: z.ZodObject<{
26
26
  material: z.ZodOptional<z.ZodObject<{
27
27
  id: z.ZodOptional<z.ZodString>;
28
28
  preset: z.ZodOptional<z.ZodEnum<{
29
- custom: "custom";
30
29
  white: "white";
31
30
  brick: "brick";
32
31
  concrete: "concrete";
@@ -36,6 +35,7 @@ export declare const RoofNode: z.ZodObject<{
36
35
  plaster: "plaster";
37
36
  tile: "tile";
38
37
  marble: "marble";
38
+ custom: "custom";
39
39
  }>>;
40
40
  properties: z.ZodOptional<z.ZodObject<{
41
41
  color: z.ZodDefault<z.ZodString>;
@@ -59,7 +59,6 @@ export declare const RoofNode: z.ZodObject<{
59
59
  topMaterial: z.ZodOptional<z.ZodObject<{
60
60
  id: z.ZodOptional<z.ZodString>;
61
61
  preset: z.ZodOptional<z.ZodEnum<{
62
- custom: "custom";
63
62
  white: "white";
64
63
  brick: "brick";
65
64
  concrete: "concrete";
@@ -69,6 +68,7 @@ export declare const RoofNode: z.ZodObject<{
69
68
  plaster: "plaster";
70
69
  tile: "tile";
71
70
  marble: "marble";
71
+ custom: "custom";
72
72
  }>>;
73
73
  properties: z.ZodOptional<z.ZodObject<{
74
74
  color: z.ZodDefault<z.ZodString>;
@@ -92,7 +92,6 @@ export declare const RoofNode: z.ZodObject<{
92
92
  edgeMaterial: z.ZodOptional<z.ZodObject<{
93
93
  id: z.ZodOptional<z.ZodString>;
94
94
  preset: z.ZodOptional<z.ZodEnum<{
95
- custom: "custom";
96
95
  white: "white";
97
96
  brick: "brick";
98
97
  concrete: "concrete";
@@ -102,6 +101,7 @@ export declare const RoofNode: z.ZodObject<{
102
101
  plaster: "plaster";
103
102
  tile: "tile";
104
103
  marble: "marble";
104
+ custom: "custom";
105
105
  }>>;
106
106
  properties: z.ZodOptional<z.ZodObject<{
107
107
  color: z.ZodDefault<z.ZodString>;
@@ -125,7 +125,6 @@ export declare const RoofNode: z.ZodObject<{
125
125
  wallMaterial: z.ZodOptional<z.ZodObject<{
126
126
  id: z.ZodOptional<z.ZodString>;
127
127
  preset: z.ZodOptional<z.ZodEnum<{
128
- custom: "custom";
129
128
  white: "white";
130
129
  brick: "brick";
131
130
  concrete: "concrete";
@@ -135,6 +134,7 @@ export declare const RoofNode: z.ZodObject<{
135
134
  plaster: "plaster";
136
135
  tile: "tile";
137
136
  marble: "marble";
137
+ custom: "custom";
138
138
  }>>;
139
139
  properties: z.ZodOptional<z.ZodObject<{
140
140
  color: z.ZodDefault<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;iBAQnB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
1
+ {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;iBAQnB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
@@ -1,9 +1,10 @@
1
1
  import { z } from 'zod';
2
+ import { AssetUrl } from '../asset-url';
2
3
  import { BaseNode, nodeType, objectId } from '../base';
3
4
  export const ScanNode = BaseNode.extend({
4
5
  id: objectId('scan'),
5
6
  type: nodeType('scan'),
6
- url: z.string(),
7
+ url: AssetUrl,
7
8
  position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
8
9
  rotation: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
9
10
  scale: z.number().default(1),
@@ -76,6 +76,7 @@ export declare const SiteNode: z.ZodObject<{
76
76
  category: z.ZodString;
77
77
  name: z.ZodString;
78
78
  thumbnail: z.ZodString;
79
+ floorPlanUrl: z.ZodOptional<z.ZodString>;
79
80
  src: z.ZodString;
80
81
  dimensions: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
81
82
  attachTo: z.ZodOptional<z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/site.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiBvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBpB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
1
+ {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/site.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiBvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBpB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
@@ -20,7 +20,6 @@ export declare const SlabNode: z.ZodObject<{
20
20
  material: z.ZodOptional<z.ZodObject<{
21
21
  id: z.ZodOptional<z.ZodString>;
22
22
  preset: z.ZodOptional<z.ZodEnum<{
23
- custom: "custom";
24
23
  white: "white";
25
24
  brick: "brick";
26
25
  concrete: "concrete";
@@ -30,6 +29,7 @@ export declare const SlabNode: z.ZodObject<{
30
29
  plaster: "plaster";
31
30
  tile: "tile";
32
31
  marble: "marble";
32
+ custom: "custom";
33
33
  }>>;
34
34
  properties: z.ZodOptional<z.ZodObject<{
35
35
  color: z.ZodDefault<z.ZodString>;
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const SpawnNode: z.ZodObject<{
3
+ object: z.ZodDefault<z.ZodLiteral<"node">>;
4
+ name: z.ZodOptional<z.ZodString>;
5
+ parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
6
+ visible: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
7
+ camera: z.ZodOptional<z.ZodObject<{
8
+ position: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
9
+ target: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
10
+ mode: z.ZodDefault<z.ZodEnum<{
11
+ perspective: "perspective";
12
+ orthographic: "orthographic";
13
+ }>>;
14
+ fov: z.ZodOptional<z.ZodNumber>;
15
+ zoom: z.ZodOptional<z.ZodNumber>;
16
+ }, z.core.$strip>>;
17
+ metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
18
+ id: z.ZodDefault<z.ZodTemplateLiteral<`spawn_${string}`>>;
19
+ type: z.ZodDefault<z.ZodLiteral<"spawn">>;
20
+ position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
21
+ rotation: z.ZodDefault<z.ZodNumber>;
22
+ }, z.core.$strip>;
23
+ export type SpawnNode = z.infer<typeof SpawnNode>;
24
+ //# sourceMappingURL=spawn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;iBAKpB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { BaseNode, nodeType, objectId } from '../base';
3
+ export const SpawnNode = BaseNode.extend({
4
+ id: objectId('spawn'),
5
+ type: nodeType('spawn'),
6
+ position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
7
+ rotation: z.number().default(0),
8
+ });
@@ -31,7 +31,6 @@ export declare const StairSegmentNode: z.ZodObject<{
31
31
  material: z.ZodOptional<z.ZodObject<{
32
32
  id: z.ZodOptional<z.ZodString>;
33
33
  preset: z.ZodOptional<z.ZodEnum<{
34
- custom: "custom";
35
34
  white: "white";
36
35
  brick: "brick";
37
36
  concrete: "concrete";
@@ -41,6 +40,7 @@ export declare const StairSegmentNode: z.ZodObject<{
41
40
  plaster: "plaster";
42
41
  tile: "tile";
43
42
  marble: "marble";
43
+ custom: "custom";
44
44
  }>>;
45
45
  properties: z.ZodOptional<z.ZodObject<{
46
46
  color: z.ZodDefault<z.ZodString>;
@@ -1,15 +1,15 @@
1
1
  import { z } from 'zod';
2
2
  import { type MaterialSchema } from '../material';
3
3
  export declare const StairRailingMode: z.ZodEnum<{
4
+ none: "none";
4
5
  left: "left";
5
6
  right: "right";
6
- none: "none";
7
7
  both: "both";
8
8
  }>;
9
9
  export declare const StairType: z.ZodEnum<{
10
10
  straight: "straight";
11
- curved: "curved";
12
11
  spiral: "spiral";
12
+ curved: "curved";
13
13
  }>;
14
14
  export declare const StairTopLandingMode: z.ZodEnum<{
15
15
  none: "none";
@@ -49,7 +49,6 @@ export declare const StairNode: z.ZodObject<{
49
49
  material: z.ZodOptional<z.ZodObject<{
50
50
  id: z.ZodOptional<z.ZodString>;
51
51
  preset: z.ZodOptional<z.ZodEnum<{
52
- custom: "custom";
53
52
  white: "white";
54
53
  brick: "brick";
55
54
  concrete: "concrete";
@@ -59,6 +58,7 @@ export declare const StairNode: z.ZodObject<{
59
58
  plaster: "plaster";
60
59
  tile: "tile";
61
60
  marble: "marble";
61
+ custom: "custom";
62
62
  }>>;
63
63
  properties: z.ZodOptional<z.ZodObject<{
64
64
  color: z.ZodDefault<z.ZodString>;
@@ -82,7 +82,6 @@ export declare const StairNode: z.ZodObject<{
82
82
  railingMaterial: z.ZodOptional<z.ZodObject<{
83
83
  id: z.ZodOptional<z.ZodString>;
84
84
  preset: z.ZodOptional<z.ZodEnum<{
85
- custom: "custom";
86
85
  white: "white";
87
86
  brick: "brick";
88
87
  concrete: "concrete";
@@ -92,6 +91,7 @@ export declare const StairNode: z.ZodObject<{
92
91
  plaster: "plaster";
93
92
  tile: "tile";
94
93
  marble: "marble";
94
+ custom: "custom";
95
95
  }>>;
96
96
  properties: z.ZodOptional<z.ZodObject<{
97
97
  color: z.ZodDefault<z.ZodString>;
@@ -115,7 +115,6 @@ export declare const StairNode: z.ZodObject<{
115
115
  treadMaterial: z.ZodOptional<z.ZodObject<{
116
116
  id: z.ZodOptional<z.ZodString>;
117
117
  preset: z.ZodOptional<z.ZodEnum<{
118
- custom: "custom";
119
118
  white: "white";
120
119
  brick: "brick";
121
120
  concrete: "concrete";
@@ -125,6 +124,7 @@ export declare const StairNode: z.ZodObject<{
125
124
  plaster: "plaster";
126
125
  tile: "tile";
127
126
  marble: "marble";
127
+ custom: "custom";
128
128
  }>>;
129
129
  properties: z.ZodOptional<z.ZodObject<{
130
130
  color: z.ZodDefault<z.ZodString>;
@@ -148,7 +148,6 @@ export declare const StairNode: z.ZodObject<{
148
148
  sideMaterial: z.ZodOptional<z.ZodObject<{
149
149
  id: z.ZodOptional<z.ZodString>;
150
150
  preset: z.ZodOptional<z.ZodEnum<{
151
- custom: "custom";
152
151
  white: "white";
153
152
  brick: "brick";
154
153
  concrete: "concrete";
@@ -158,6 +157,7 @@ export declare const StairNode: z.ZodObject<{
158
157
  plaster: "plaster";
159
158
  tile: "tile";
160
159
  marble: "marble";
160
+ custom: "custom";
161
161
  }>>;
162
162
  properties: z.ZodOptional<z.ZodObject<{
163
163
  color: z.ZodDefault<z.ZodString>;
@@ -182,8 +182,8 @@ export declare const StairNode: z.ZodObject<{
182
182
  rotation: z.ZodDefault<z.ZodNumber>;
183
183
  stairType: z.ZodDefault<z.ZodEnum<{
184
184
  straight: "straight";
185
- curved: "curved";
186
185
  spiral: "spiral";
186
+ curved: "curved";
187
187
  }>>;
188
188
  fromLevelId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
189
189
  toLevelId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -207,9 +207,9 @@ export declare const StairNode: z.ZodObject<{
207
207
  showCenterColumn: z.ZodDefault<z.ZodBoolean>;
208
208
  showStepSupports: z.ZodDefault<z.ZodBoolean>;
209
209
  railingMode: z.ZodDefault<z.ZodEnum<{
210
+ none: "none";
210
211
  left: "left";
211
212
  right: "right";
212
- none: "none";
213
213
  both: "both";
214
214
  }>>;
215
215
  railingHeight: z.ZodDefault<z.ZodNumber>;
@@ -22,7 +22,6 @@ export declare const WallNode: z.ZodObject<{
22
22
  material: z.ZodOptional<z.ZodObject<{
23
23
  id: z.ZodOptional<z.ZodString>;
24
24
  preset: z.ZodOptional<z.ZodEnum<{
25
- custom: "custom";
26
25
  white: "white";
27
26
  brick: "brick";
28
27
  concrete: "concrete";
@@ -32,6 +31,7 @@ export declare const WallNode: z.ZodObject<{
32
31
  plaster: "plaster";
33
32
  tile: "tile";
34
33
  marble: "marble";
34
+ custom: "custom";
35
35
  }>>;
36
36
  properties: z.ZodOptional<z.ZodObject<{
37
37
  color: z.ZodDefault<z.ZodString>;
@@ -55,7 +55,6 @@ export declare const WallNode: z.ZodObject<{
55
55
  interiorMaterial: z.ZodOptional<z.ZodObject<{
56
56
  id: z.ZodOptional<z.ZodString>;
57
57
  preset: z.ZodOptional<z.ZodEnum<{
58
- custom: "custom";
59
58
  white: "white";
60
59
  brick: "brick";
61
60
  concrete: "concrete";
@@ -65,6 +64,7 @@ export declare const WallNode: z.ZodObject<{
65
64
  plaster: "plaster";
66
65
  tile: "tile";
67
66
  marble: "marble";
67
+ custom: "custom";
68
68
  }>>;
69
69
  properties: z.ZodOptional<z.ZodObject<{
70
70
  color: z.ZodDefault<z.ZodString>;
@@ -88,7 +88,6 @@ export declare const WallNode: z.ZodObject<{
88
88
  exteriorMaterial: z.ZodOptional<z.ZodObject<{
89
89
  id: z.ZodOptional<z.ZodString>;
90
90
  preset: z.ZodOptional<z.ZodEnum<{
91
- custom: "custom";
92
91
  white: "white";
93
92
  brick: "brick";
94
93
  concrete: "concrete";
@@ -98,6 +97,7 @@ export declare const WallNode: z.ZodObject<{
98
97
  plaster: "plaster";
99
98
  tile: "tile";
100
99
  marble: "marble";
100
+ custom: "custom";
101
101
  }>>;
102
102
  properties: z.ZodOptional<z.ZodObject<{
103
103
  color: z.ZodDefault<z.ZodString>;
@@ -1,4 +1,17 @@
1
1
  import { z } from 'zod';
2
+ export declare const WindowType: z.ZodEnum<{
3
+ sliding: "sliding";
4
+ fixed: "fixed";
5
+ casement: "casement";
6
+ awning: "awning";
7
+ hopper: "hopper";
8
+ "single-hung": "single-hung";
9
+ "double-hung": "double-hung";
10
+ bay: "bay";
11
+ bow: "bow";
12
+ louvered: "louvered";
13
+ }>;
14
+ export type WindowType = z.infer<typeof WindowType>;
2
15
  export declare const WindowNode: z.ZodObject<{
3
16
  object: z.ZodDefault<z.ZodLiteral<"node">>;
4
17
  name: z.ZodOptional<z.ZodString>;
@@ -20,7 +33,6 @@ export declare const WindowNode: z.ZodObject<{
20
33
  material: z.ZodOptional<z.ZodObject<{
21
34
  id: z.ZodOptional<z.ZodString>;
22
35
  preset: z.ZodOptional<z.ZodEnum<{
23
- custom: "custom";
24
36
  white: "white";
25
37
  brick: "brick";
26
38
  concrete: "concrete";
@@ -30,6 +42,7 @@ export declare const WindowNode: z.ZodObject<{
30
42
  plaster: "plaster";
31
43
  tile: "tile";
32
44
  marble: "marble";
45
+ custom: "custom";
33
46
  }>>;
34
47
  properties: z.ZodOptional<z.ZodObject<{
35
48
  color: z.ZodDefault<z.ZodString>;
@@ -58,6 +71,48 @@ export declare const WindowNode: z.ZodObject<{
58
71
  wallId: z.ZodOptional<z.ZodString>;
59
72
  width: z.ZodDefault<z.ZodNumber>;
60
73
  height: z.ZodDefault<z.ZodNumber>;
74
+ openingKind: z.ZodDefault<z.ZodEnum<{
75
+ window: "window";
76
+ opening: "opening";
77
+ }>>;
78
+ windowType: z.ZodDefault<z.ZodEnum<{
79
+ sliding: "sliding";
80
+ fixed: "fixed";
81
+ casement: "casement";
82
+ awning: "awning";
83
+ hopper: "hopper";
84
+ "single-hung": "single-hung";
85
+ "double-hung": "double-hung";
86
+ bay: "bay";
87
+ bow: "bow";
88
+ louvered: "louvered";
89
+ }>>;
90
+ operationState: z.ZodDefault<z.ZodNumber>;
91
+ awningDirection: z.ZodDefault<z.ZodEnum<{
92
+ up: "up";
93
+ down: "down";
94
+ }>>;
95
+ casementStyle: z.ZodDefault<z.ZodEnum<{
96
+ french: "french";
97
+ single: "single";
98
+ }>>;
99
+ hingesSide: z.ZodDefault<z.ZodEnum<{
100
+ left: "left";
101
+ right: "right";
102
+ }>>;
103
+ openingShape: z.ZodDefault<z.ZodEnum<{
104
+ rectangle: "rectangle";
105
+ rounded: "rounded";
106
+ arch: "arch";
107
+ }>>;
108
+ openingRadiusMode: z.ZodDefault<z.ZodEnum<{
109
+ all: "all";
110
+ individual: "individual";
111
+ }>>;
112
+ openingCornerRadii: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
113
+ cornerRadius: z.ZodDefault<z.ZodNumber>;
114
+ archHeight: z.ZodDefault<z.ZodNumber>;
115
+ openingRevealRadius: z.ZodDefault<z.ZodNumber>;
61
116
  frameThickness: z.ZodDefault<z.ZodNumber>;
62
117
  frameDepth: z.ZodDefault<z.ZodNumber>;
63
118
  columnRatios: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
@@ -1 +1 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/window.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCrB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA"}
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/window.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,UAAU;;;;;;;;;;;EAWrB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAEnD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2DrB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA"}
@@ -2,6 +2,18 @@ import dedent from 'dedent';
2
2
  import { z } from 'zod';
3
3
  import { BaseNode, nodeType, objectId } from '../base';
4
4
  import { MaterialSchema } from '../material';
5
+ export const WindowType = z.enum([
6
+ 'fixed',
7
+ 'sliding',
8
+ 'casement',
9
+ 'awning',
10
+ 'hopper',
11
+ 'single-hung',
12
+ 'double-hung',
13
+ 'bay',
14
+ 'bow',
15
+ 'louvered',
16
+ ]);
5
17
  export const WindowNode = BaseNode.extend({
6
18
  id: objectId('window'),
7
19
  type: nodeType('window'),
@@ -14,6 +26,22 @@ export const WindowNode = BaseNode.extend({
14
26
  // Overall dimensions
15
27
  width: z.number().default(1.5),
16
28
  height: z.number().default(1.5),
29
+ // Opening mode - when set to "opening", the window is only a shaped cutout
30
+ openingKind: z.enum(['window', 'opening']).default('window'),
31
+ // Window family
32
+ windowType: WindowType.default('fixed'),
33
+ operationState: z.number().min(0).max(1).default(0),
34
+ awningDirection: z.enum(['up', 'down']).default('up'),
35
+ casementStyle: z.enum(['single', 'french']).default('single'),
36
+ hingesSide: z.enum(['left', 'right']).default('left'),
37
+ openingShape: z.enum(['rectangle', 'rounded', 'arch']).default('rectangle'),
38
+ openingRadiusMode: z.enum(['all', 'individual']).default('all'),
39
+ openingCornerRadii: z
40
+ .tuple([z.number(), z.number(), z.number(), z.number()])
41
+ .default([0.15, 0.15, 0.15, 0.15]),
42
+ cornerRadius: z.number().default(0.15),
43
+ archHeight: z.number().default(0.35),
44
+ openingRevealRadius: z.number().default(0.025),
17
45
  // Frame
18
46
  frameThickness: z.number().default(0.05),
19
47
  frameDepth: z.number().default(0.07),
@@ -32,6 +60,7 @@ export const WindowNode = BaseNode.extend({
32
60
  }).describe(dedent `Window node - a parametric window placed on a wall
33
61
  - position: center of the window in wall-local coordinate system
34
62
  - width/height: overall outer dimensions
63
+ - windowType: explicit window family, defaulting old windows to fixed
35
64
  - frameThickness: width of the frame members
36
65
  - frameDepth: how deep the frame sits within the wall
37
66
  - columnRatios/rowRatios: pane division ratios