@pascal-app/core 0.5.0 → 0.6.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 (99) hide show
  1. package/dist/events/bus.d.ts +39 -4
  2. package/dist/events/bus.d.ts.map +1 -1
  3. package/dist/events/bus.js +1 -1
  4. package/dist/hooks/scene-registry/scene-registry.d.ts +1 -0
  5. package/dist/hooks/scene-registry/scene-registry.d.ts.map +1 -1
  6. package/dist/hooks/scene-registry/scene-registry.js +1 -0
  7. package/dist/hooks/spatial-grid/spatial-grid.d.ts +2 -0
  8. package/dist/hooks/spatial-grid/spatial-grid.d.ts.map +1 -1
  9. package/dist/hooks/spatial-grid/spatial-grid.js +43 -20
  10. package/dist/index.d.ts +6 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +5 -1
  13. package/dist/lib/polygon-geometry.d.ts +3 -0
  14. package/dist/lib/polygon-geometry.d.ts.map +1 -0
  15. package/dist/lib/polygon-geometry.js +90 -0
  16. package/dist/lib/space-detection.d.ts +10 -17
  17. package/dist/lib/space-detection.d.ts.map +1 -1
  18. package/dist/lib/space-detection.js +666 -453
  19. package/dist/material-library.d.ts +18 -0
  20. package/dist/material-library.d.ts.map +1 -0
  21. package/dist/material-library.js +603 -0
  22. package/dist/schema/index.d.ts +10 -4
  23. package/dist/schema/index.d.ts.map +1 -1
  24. package/dist/schema/index.js +6 -4
  25. package/dist/schema/material.d.ts +109 -0
  26. package/dist/schema/material.d.ts.map +1 -1
  27. package/dist/schema/material.js +52 -0
  28. package/dist/schema/nodes/ceiling.d.ts +10 -0
  29. package/dist/schema/nodes/ceiling.d.ts.map +1 -1
  30. package/dist/schema/nodes/ceiling.js +6 -0
  31. package/dist/schema/nodes/door.d.ts +1 -0
  32. package/dist/schema/nodes/door.d.ts.map +1 -1
  33. package/dist/schema/nodes/fence.d.ts +85 -0
  34. package/dist/schema/nodes/fence.d.ts.map +1 -0
  35. package/dist/schema/nodes/fence.js +34 -0
  36. package/dist/schema/nodes/item.d.ts +2 -2
  37. package/dist/schema/nodes/level.d.ts +1 -1
  38. package/dist/schema/nodes/level.d.ts.map +1 -1
  39. package/dist/schema/nodes/level.js +2 -0
  40. package/dist/schema/nodes/roof-segment.d.ts +2 -0
  41. package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
  42. package/dist/schema/nodes/roof-segment.js +1 -0
  43. package/dist/schema/nodes/roof.d.ts +108 -0
  44. package/dist/schema/nodes/roof.d.ts.map +1 -1
  45. package/dist/schema/nodes/roof.js +58 -2
  46. package/dist/schema/nodes/site.d.ts +1 -1
  47. package/dist/schema/nodes/slab.d.ts +10 -0
  48. package/dist/schema/nodes/slab.d.ts.map +1 -1
  49. package/dist/schema/nodes/slab.js +7 -0
  50. package/dist/schema/nodes/stair-segment.d.ts +2 -0
  51. package/dist/schema/nodes/stair-segment.d.ts.map +1 -1
  52. package/dist/schema/nodes/stair-segment.js +1 -0
  53. package/dist/schema/nodes/stair.d.ts +164 -0
  54. package/dist/schema/nodes/stair.d.ts.map +1 -1
  55. package/dist/schema/nodes/stair.js +106 -5
  56. package/dist/schema/nodes/surface-hole-metadata.d.ts +10 -0
  57. package/dist/schema/nodes/surface-hole-metadata.d.ts.map +1 -0
  58. package/dist/schema/nodes/surface-hole-metadata.js +5 -0
  59. package/dist/schema/nodes/wall.d.ts +87 -1
  60. package/dist/schema/nodes/wall.d.ts.map +1 -1
  61. package/dist/schema/nodes/wall.js +45 -4
  62. package/dist/schema/nodes/window.d.ts +1 -0
  63. package/dist/schema/nodes/window.d.ts.map +1 -1
  64. package/dist/schema/types.d.ts +406 -4
  65. package/dist/schema/types.d.ts.map +1 -1
  66. package/dist/schema/types.js +2 -0
  67. package/dist/store/actions/node-actions.d.ts +1 -1
  68. package/dist/store/actions/node-actions.d.ts.map +1 -1
  69. package/dist/store/actions/node-actions.js +175 -0
  70. package/dist/store/history-control.d.ts +14 -0
  71. package/dist/store/history-control.d.ts.map +1 -0
  72. package/dist/store/history-control.js +22 -0
  73. package/dist/store/use-scene.d.ts.map +1 -1
  74. package/dist/store/use-scene.js +249 -3
  75. package/dist/systems/ceiling/ceiling-system.d.ts.map +1 -1
  76. package/dist/systems/ceiling/ceiling-system.js +7 -0
  77. package/dist/systems/fence/fence-system.d.ts +2 -0
  78. package/dist/systems/fence/fence-system.d.ts.map +1 -0
  79. package/dist/systems/fence/fence-system.js +187 -0
  80. package/dist/systems/roof/roof-system.d.ts.map +1 -1
  81. package/dist/systems/roof/roof-system.js +31 -1
  82. package/dist/systems/slab/slab-system.d.ts.map +1 -1
  83. package/dist/systems/slab/slab-system.js +45 -8
  84. package/dist/systems/stair/stair-opening-sync.d.ts +6 -0
  85. package/dist/systems/stair/stair-opening-sync.d.ts.map +1 -0
  86. package/dist/systems/stair/stair-opening-sync.js +515 -0
  87. package/dist/systems/stair/stair-system.d.ts.map +1 -1
  88. package/dist/systems/stair/stair-system.js +432 -10
  89. package/dist/systems/wall/wall-curve.d.ts +43 -0
  90. package/dist/systems/wall/wall-curve.d.ts.map +1 -0
  91. package/dist/systems/wall/wall-curve.js +176 -0
  92. package/dist/systems/wall/wall-footprint.d.ts.map +1 -1
  93. package/dist/systems/wall/wall-footprint.js +16 -2
  94. package/dist/systems/wall/wall-mitering.d.ts +7 -0
  95. package/dist/systems/wall/wall-mitering.d.ts.map +1 -1
  96. package/dist/systems/wall/wall-mitering.js +76 -3
  97. package/dist/systems/wall/wall-system.d.ts.map +1 -1
  98. package/dist/systems/wall/wall-system.js +202 -2
  99. package/package.json +3 -3
@@ -0,0 +1,18 @@
1
+ import { type MaterialPresetPayload, type MaterialTarget } from './schema/material';
2
+ export type MaterialCatalogItem = {
3
+ id: string;
4
+ label: string;
5
+ description?: string;
6
+ targets: MaterialTarget[];
7
+ previewThumbnailUrl?: string;
8
+ previewColor?: string;
9
+ preset: MaterialPresetPayload;
10
+ };
11
+ export declare const MATERIAL_CATALOG: MaterialCatalogItem[];
12
+ export declare function getMaterialsForTarget(target: MaterialTarget): MaterialCatalogItem[];
13
+ export declare function getCatalogMaterialById(id?: string): MaterialCatalogItem | undefined;
14
+ export declare const LIBRARY_MATERIAL_REF_PREFIX = "library:";
15
+ export declare function toLibraryMaterialRef(id: string): string;
16
+ export declare function getLibraryMaterialIdFromRef(materialRef?: string | null): string | null;
17
+ export declare function getMaterialPresetByRef(materialRef?: string | null): MaterialPresetPayload | null;
18
+ //# sourceMappingURL=material-library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"material-library.d.ts","sourceRoot":"","sources":["../src/material-library.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,qBAAqB,CAAA;CAC9B,CAAA;AAkCD,eAAO,MAAM,gBAAgB,EAAE,mBAAmB,EAuiBjD,CAAA;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,mBAAmB,EAAE,CAEnF;AAED,wBAAgB,sBAAsB,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAGnF;AAED,eAAO,MAAM,2BAA2B,aAAa,CAAA;AAErD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,UAE9C;AAED,wBAAgB,2BAA2B,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,iBAItE;AAED,wBAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,qBAAqB,GAAG,IAAI,CAIhG"}
@@ -0,0 +1,603 @@
1
+ import { MaterialTarget as MaterialTargetSchema, } from './schema/material';
2
+ const WALL_TARGETS = [
3
+ MaterialTargetSchema.enum.wall,
4
+ ];
5
+ const SLAB_TARGETS = [
6
+ MaterialTargetSchema.enum.slab,
7
+ ];
8
+ const WALL_AND_SLAB_TARGETS = [
9
+ MaterialTargetSchema.enum.wall,
10
+ MaterialTargetSchema.enum.slab,
11
+ ];
12
+ const STAIR_TARGETS = [
13
+ MaterialTargetSchema.enum.stair,
14
+ MaterialTargetSchema.enum['stair-segment'],
15
+ ];
16
+ const STAIR_AND_FENCE_TARGETS = [
17
+ ...STAIR_TARGETS,
18
+ MaterialTargetSchema.enum.fence,
19
+ ];
20
+ const ROOF_TARGETS = [
21
+ MaterialTargetSchema.enum.roof,
22
+ MaterialTargetSchema.enum['roof-segment'],
23
+ ];
24
+ const CEILING_TARGETS = [
25
+ MaterialTargetSchema.enum.ceiling,
26
+ ];
27
+ export const MATERIAL_CATALOG = [
28
+ {
29
+ id: 'wall-wood1',
30
+ label: 'Wood',
31
+ description: 'Warm wood finish',
32
+ targets: [...WALL_TARGETS, ...SLAB_TARGETS, ...STAIR_AND_FENCE_TARGETS, ...ROOF_TARGETS],
33
+ previewThumbnailUrl: '/material/wood1/wood1_thumbnail.webp',
34
+ preset: {
35
+ maps: {
36
+ albedoMap: '/material/wood1/albedoMap_basecolor.jpg',
37
+ normalMap: '/material/wood1/normalMap_normal.jpg',
38
+ },
39
+ mapProperties: {
40
+ color: '#ffffff',
41
+ roughness: 0.575,
42
+ metalness: 0,
43
+ repeatX: 1,
44
+ repeatY: 1,
45
+ rotation: 0,
46
+ wrapS: 'Repeat',
47
+ wrapT: 'Repeat',
48
+ normalScaleX: 1,
49
+ normalScaleY: 1,
50
+ emissiveIntensity: 1,
51
+ displacementScale: 0.02,
52
+ transparent: true,
53
+ flipY: true,
54
+ bumpScale: 1,
55
+ emissiveColor: '#000000',
56
+ aoMapIntensity: 1,
57
+ side: 0,
58
+ opacity: 1,
59
+ lightMapIntensity: 1,
60
+ },
61
+ },
62
+ },
63
+ {
64
+ id: 'wall-wood2',
65
+ label: 'Wood',
66
+ description: 'Textured wood finish',
67
+ targets: [...WALL_TARGETS, ...SLAB_TARGETS, ...STAIR_AND_FENCE_TARGETS, ...ROOF_TARGETS],
68
+ previewThumbnailUrl: '/material/wood2/wood2_thumbnail.webp',
69
+ preset: {
70
+ maps: {
71
+ albedoMap: '/material/wood2/albedoMap_Wood.jpg',
72
+ normalMap: '/material/wood2/normalMap_Wood.jpg',
73
+ aoMap: '/material/wood2/aoMap_Wood.jpg',
74
+ },
75
+ mapProperties: {
76
+ color: '#ffffff',
77
+ roughness: 0.467,
78
+ metalness: 0,
79
+ repeatX: 1,
80
+ repeatY: 1,
81
+ rotation: 0,
82
+ wrapS: 'Repeat',
83
+ wrapT: 'Repeat',
84
+ normalScaleX: 2,
85
+ normalScaleY: 2,
86
+ emissiveIntensity: 1,
87
+ displacementScale: 0.02,
88
+ transparent: true,
89
+ flipY: true,
90
+ bumpScale: 1,
91
+ emissiveColor: '#000000',
92
+ aoMapIntensity: 2,
93
+ side: 0,
94
+ opacity: 1,
95
+ lightMapIntensity: 1,
96
+ },
97
+ },
98
+ },
99
+ {
100
+ id: 'wall-wood3',
101
+ label: 'Wood',
102
+ description: 'Knotted timber finish',
103
+ targets: [...WALL_TARGETS, ...SLAB_TARGETS, ...STAIR_AND_FENCE_TARGETS, ...ROOF_TARGETS],
104
+ previewThumbnailUrl: '/material/wood3/wood3_thumbnail.webp',
105
+ preset: {
106
+ maps: {
107
+ albedoMap: '/material/wood3/albedoMap_knotted-timber.jpg',
108
+ },
109
+ mapProperties: {
110
+ color: '#ffffff',
111
+ roughness: 0.489,
112
+ metalness: 0,
113
+ repeatX: 1,
114
+ repeatY: 1,
115
+ rotation: 0,
116
+ wrapS: 'Repeat',
117
+ wrapT: 'Repeat',
118
+ normalScaleX: 0.2,
119
+ normalScaleY: 0.2,
120
+ emissiveIntensity: 1,
121
+ displacementScale: 0.02,
122
+ transparent: true,
123
+ flipY: true,
124
+ bumpScale: 1,
125
+ emissiveColor: '#000000',
126
+ aoMapIntensity: 2,
127
+ side: 0,
128
+ opacity: 1,
129
+ lightMapIntensity: 1,
130
+ },
131
+ },
132
+ },
133
+ {
134
+ id: 'wall-wood4',
135
+ label: 'Wood',
136
+ description: 'Oak stretcher finish',
137
+ targets: [...WALL_TARGETS, ...SLAB_TARGETS, ...STAIR_AND_FENCE_TARGETS],
138
+ previewThumbnailUrl: '/material/wood4/wood4_thumbnail.webp',
139
+ preset: {
140
+ maps: {
141
+ albedoMap: '/material/wood4/albedoMap_oak-stretcher.jpg',
142
+ },
143
+ mapProperties: {
144
+ color: '#ffffff',
145
+ roughness: 0.378,
146
+ metalness: 0,
147
+ repeatX: 1,
148
+ repeatY: 1,
149
+ rotation: 0,
150
+ wrapS: 'Repeat',
151
+ wrapT: 'Repeat',
152
+ normalScaleX: 1,
153
+ normalScaleY: 1,
154
+ emissiveIntensity: 1,
155
+ displacementScale: 0.02,
156
+ transparent: true,
157
+ flipY: true,
158
+ bumpScale: 1,
159
+ emissiveColor: '#000000',
160
+ aoMapIntensity: 1,
161
+ side: 0,
162
+ opacity: 1,
163
+ lightMapIntensity: 1,
164
+ },
165
+ },
166
+ },
167
+ {
168
+ id: 'wall-wood5',
169
+ label: 'Wood',
170
+ description: 'Rich grain wood finish',
171
+ targets: [...WALL_TARGETS, ...SLAB_TARGETS, ...STAIR_AND_FENCE_TARGETS],
172
+ previewThumbnailUrl: '/material/wood5/wood5_thumnail.webp',
173
+ preset: {
174
+ maps: {
175
+ albedoMap: '/material/wood5/albedoMap_3_base_color.webp',
176
+ normalMap: '/material/wood5/normalMap_3_normal.jpg',
177
+ aoMap: '/material/wood5/aoMap_3_ao.jpg',
178
+ },
179
+ mapProperties: {
180
+ color: '#ffffff',
181
+ roughness: 0.6,
182
+ metalness: 0,
183
+ repeatX: 1,
184
+ repeatY: 1,
185
+ rotation: 0,
186
+ wrapS: 'Repeat',
187
+ wrapT: 'Repeat',
188
+ normalScaleX: 1,
189
+ normalScaleY: 1,
190
+ emissiveIntensity: 1,
191
+ displacementScale: 0.02,
192
+ transparent: true,
193
+ flipY: true,
194
+ bumpScale: 1,
195
+ emissiveColor: '#000000',
196
+ aoMapIntensity: 10,
197
+ side: 0,
198
+ opacity: 1,
199
+ lightMapIntensity: 1,
200
+ },
201
+ },
202
+ },
203
+ {
204
+ id: 'wall-granite1',
205
+ label: 'Granite',
206
+ description: 'Polished granite finish',
207
+ targets: SLAB_TARGETS,
208
+ previewThumbnailUrl: '/material/granite1/granite_thumbnail.webp',
209
+ preset: {
210
+ maps: {
211
+ albedoMap: '/material/granite1/albedoMap_Granite.jpg',
212
+ },
213
+ mapProperties: {
214
+ color: '#ffffff',
215
+ roughness: 0.189,
216
+ metalness: 0,
217
+ repeatX: 1,
218
+ repeatY: 1,
219
+ rotation: 0,
220
+ wrapS: 'Repeat',
221
+ wrapT: 'Repeat',
222
+ normalScaleX: 1,
223
+ normalScaleY: 1,
224
+ emissiveIntensity: 1,
225
+ displacementScale: 0.02,
226
+ transparent: true,
227
+ flipY: true,
228
+ bumpScale: 1,
229
+ emissiveColor: '#000000',
230
+ aoMapIntensity: 1,
231
+ side: 0,
232
+ opacity: 1,
233
+ lightMapIntensity: 1,
234
+ },
235
+ },
236
+ },
237
+ {
238
+ id: 'wall-marble1',
239
+ label: 'Marble',
240
+ description: 'Smooth marble finish',
241
+ targets: [...SLAB_TARGETS, ...STAIR_AND_FENCE_TARGETS],
242
+ previewThumbnailUrl: '/material/marble1/marble1_thumbnail.webp',
243
+ preset: {
244
+ maps: {
245
+ albedoMap: '/material/marble1/albedoMap_marble.jpg',
246
+ },
247
+ mapProperties: {
248
+ color: '#ffffff',
249
+ roughness: 0.133,
250
+ metalness: 0,
251
+ repeatX: 1,
252
+ repeatY: 1,
253
+ rotation: 0,
254
+ wrapS: 'Repeat',
255
+ wrapT: 'Repeat',
256
+ normalScaleX: 1,
257
+ normalScaleY: 1,
258
+ emissiveIntensity: 1,
259
+ displacementScale: 0.02,
260
+ transparent: true,
261
+ flipY: true,
262
+ bumpScale: 1,
263
+ emissiveColor: '#000000',
264
+ aoMapIntensity: 1,
265
+ side: 0,
266
+ opacity: 1,
267
+ lightMapIntensity: 1,
268
+ },
269
+ },
270
+ },
271
+ {
272
+ id: 'wall-marble2',
273
+ label: 'Marble',
274
+ description: 'Soft marble finish',
275
+ targets: [...SLAB_TARGETS, ...STAIR_AND_FENCE_TARGETS],
276
+ previewThumbnailUrl: '/material/marble2/marble2_thumbnail.webp',
277
+ preset: {
278
+ maps: {
279
+ albedoMap: '/material/marble2/albedoMap_marble.jpg',
280
+ },
281
+ mapProperties: {
282
+ color: '#ffffff',
283
+ roughness: 0.122,
284
+ metalness: 0,
285
+ repeatX: 1,
286
+ repeatY: 1,
287
+ rotation: 0,
288
+ wrapS: 'Repeat',
289
+ wrapT: 'Repeat',
290
+ normalScaleX: 1,
291
+ normalScaleY: 1,
292
+ emissiveIntensity: 1,
293
+ displacementScale: 0.02,
294
+ transparent: true,
295
+ flipY: true,
296
+ bumpScale: 1,
297
+ emissiveColor: '#000000',
298
+ aoMapIntensity: 1,
299
+ side: 0,
300
+ opacity: 1,
301
+ lightMapIntensity: 1,
302
+ },
303
+ },
304
+ },
305
+ {
306
+ id: 'wall-parquet1',
307
+ label: 'Parquet',
308
+ description: 'Parquet wood finish',
309
+ targets: SLAB_TARGETS,
310
+ previewThumbnailUrl: '/material/parquet1/parquet_thumnail.webp',
311
+ preset: {
312
+ maps: {
313
+ albedoMap: '/material/parquet1/albedoMap_parquet.jpg',
314
+ },
315
+ mapProperties: {
316
+ color: '#ffffff',
317
+ roughness: 0.644,
318
+ metalness: 0.4,
319
+ repeatX: 1,
320
+ repeatY: 1,
321
+ rotation: 0,
322
+ wrapS: 'Repeat',
323
+ wrapT: 'Repeat',
324
+ normalScaleX: 1,
325
+ normalScaleY: 1,
326
+ emissiveIntensity: 1,
327
+ displacementScale: 0.02,
328
+ transparent: true,
329
+ flipY: true,
330
+ bumpScale: 1,
331
+ emissiveColor: '#000000',
332
+ aoMapIntensity: 1,
333
+ side: 0,
334
+ opacity: 1,
335
+ lightMapIntensity: 1,
336
+ },
337
+ },
338
+ },
339
+ {
340
+ id: 'wall-parquet2',
341
+ label: 'Parquet',
342
+ description: 'Soft parquet finish',
343
+ targets: SLAB_TARGETS,
344
+ previewThumbnailUrl: '/material/parquet2/parquet2_thumbnail.webp',
345
+ preset: {
346
+ maps: {
347
+ albedoMap: '/material/parquet2/albedoMap_parquet.jpg',
348
+ },
349
+ mapProperties: {
350
+ color: '#ffffff',
351
+ roughness: 0.6,
352
+ metalness: 0,
353
+ repeatX: 1,
354
+ repeatY: 1,
355
+ rotation: 0,
356
+ wrapS: 'Repeat',
357
+ wrapT: 'Repeat',
358
+ normalScaleX: 1,
359
+ normalScaleY: 1,
360
+ emissiveIntensity: 1,
361
+ displacementScale: 0.02,
362
+ transparent: true,
363
+ flipY: true,
364
+ bumpScale: 1,
365
+ emissiveColor: '#000000',
366
+ aoMapIntensity: 1,
367
+ side: 0,
368
+ opacity: 1,
369
+ lightMapIntensity: 1,
370
+ },
371
+ },
372
+ },
373
+ {
374
+ id: 'wall-wallpaper1',
375
+ label: 'Wallpaper',
376
+ description: 'Soft wallpaper finish',
377
+ targets: WALL_TARGETS,
378
+ previewThumbnailUrl: '/material/wallpaper1/wallpaper1_thumbnail.webp',
379
+ preset: {
380
+ maps: {
381
+ albedoMap: '/material/wallpaper1/albedoMap_1.webp',
382
+ normalMap: '/material/wallpaper1/normalMap_NormalMap.webp',
383
+ },
384
+ mapProperties: {
385
+ color: '#ffffff',
386
+ roughness: 0.911,
387
+ metalness: 0,
388
+ repeatX: 1,
389
+ repeatY: 1,
390
+ rotation: 0,
391
+ wrapS: 'Repeat',
392
+ wrapT: 'Repeat',
393
+ normalScaleX: 1,
394
+ normalScaleY: 1,
395
+ emissiveIntensity: 1,
396
+ displacementScale: 0.02,
397
+ transparent: true,
398
+ flipY: true,
399
+ bumpScale: 1,
400
+ emissiveColor: '#000000',
401
+ aoMapIntensity: 1,
402
+ side: 0,
403
+ opacity: 1,
404
+ lightMapIntensity: 1,
405
+ },
406
+ },
407
+ },
408
+ {
409
+ id: 'wall-wallpaper2',
410
+ label: 'Wallpaper',
411
+ description: 'Decorative wallpaper finish',
412
+ targets: WALL_TARGETS,
413
+ previewThumbnailUrl: '/material/wallpaper2/wallpaper2_thumnail.webp',
414
+ preset: {
415
+ maps: {
416
+ albedoMap: '/material/wallpaper2/albedoMap_5.webp',
417
+ },
418
+ mapProperties: {
419
+ color: '#ffffff',
420
+ roughness: 0.889,
421
+ metalness: 0.255,
422
+ repeatX: 1,
423
+ repeatY: 1,
424
+ rotation: 0,
425
+ wrapS: 'Repeat',
426
+ wrapT: 'Repeat',
427
+ normalScaleX: 1,
428
+ normalScaleY: 1,
429
+ emissiveIntensity: 1,
430
+ displacementScale: 0.02,
431
+ transparent: true,
432
+ flipY: true,
433
+ bumpScale: 1,
434
+ emissiveColor: '#000000',
435
+ aoMapIntensity: 1,
436
+ side: 0,
437
+ opacity: 1,
438
+ lightMapIntensity: 1,
439
+ },
440
+ },
441
+ },
442
+ {
443
+ id: 'wall-wallpaper3',
444
+ label: 'Wallpaper',
445
+ description: 'Patterned wallpaper finish',
446
+ targets: WALL_TARGETS,
447
+ previewThumbnailUrl: '/material/wallpaper3/wallpaper3_thumbnail.webp',
448
+ preset: {
449
+ maps: {
450
+ albedoMap: '/material/wallpaper3/albedoMap_wallpaper3.avif',
451
+ },
452
+ mapProperties: {
453
+ color: '#ffffff',
454
+ roughness: 0.887,
455
+ metalness: 0.35,
456
+ repeatX: 1,
457
+ repeatY: 1,
458
+ rotation: 0,
459
+ wrapS: 'Repeat',
460
+ wrapT: 'Repeat',
461
+ normalScaleX: 1,
462
+ normalScaleY: 1,
463
+ emissiveIntensity: 1,
464
+ displacementScale: 0.02,
465
+ transparent: true,
466
+ flipY: true,
467
+ bumpScale: 1,
468
+ emissiveColor: '#000000',
469
+ aoMapIntensity: 1,
470
+ side: 0,
471
+ opacity: 1,
472
+ lightMapIntensity: 1,
473
+ },
474
+ },
475
+ },
476
+ {
477
+ id: 'preset-white',
478
+ label: 'White',
479
+ description: 'Clean painted finish',
480
+ targets: [
481
+ ...WALL_TARGETS,
482
+ ...SLAB_TARGETS,
483
+ ...ROOF_TARGETS,
484
+ ...STAIR_AND_FENCE_TARGETS,
485
+ ...CEILING_TARGETS,
486
+ ],
487
+ previewColor: '#ffffff',
488
+ preset: {
489
+ maps: {},
490
+ mapProperties: {
491
+ color: '#ffffff',
492
+ roughness: 0.9,
493
+ metalness: 0,
494
+ repeatX: 1,
495
+ repeatY: 1,
496
+ rotation: 0,
497
+ wrapS: 'Repeat',
498
+ wrapT: 'Repeat',
499
+ normalScaleX: 1,
500
+ normalScaleY: 1,
501
+ emissiveIntensity: 1,
502
+ displacementScale: 0.02,
503
+ transparent: false,
504
+ flipY: true,
505
+ bumpScale: 1,
506
+ emissiveColor: '#000000',
507
+ aoMapIntensity: 1,
508
+ side: 0,
509
+ opacity: 1,
510
+ lightMapIntensity: 1,
511
+ },
512
+ },
513
+ },
514
+ {
515
+ id: 'preset-metal',
516
+ label: 'Metal',
517
+ description: 'Brushed metal finish',
518
+ targets: [...WALL_TARGETS, ...SLAB_TARGETS],
519
+ previewColor: '#c0c0c0',
520
+ preset: {
521
+ maps: {},
522
+ mapProperties: {
523
+ color: '#c7ccd2',
524
+ roughness: 0.26,
525
+ metalness: 0.82,
526
+ repeatX: 1,
527
+ repeatY: 1,
528
+ rotation: 0,
529
+ wrapS: 'Repeat',
530
+ wrapT: 'Repeat',
531
+ normalScaleX: 1,
532
+ normalScaleY: 1,
533
+ emissiveIntensity: 1,
534
+ displacementScale: 0.02,
535
+ transparent: false,
536
+ flipY: true,
537
+ bumpScale: 1,
538
+ emissiveColor: '#000000',
539
+ aoMapIntensity: 1,
540
+ side: 0,
541
+ opacity: 1,
542
+ lightMapIntensity: 1,
543
+ },
544
+ },
545
+ },
546
+ {
547
+ id: 'preset-glass',
548
+ label: 'Glass',
549
+ description: 'Light glass finish',
550
+ targets: [...WALL_TARGETS, ...SLAB_TARGETS],
551
+ previewColor: '#87ceeb',
552
+ preset: {
553
+ maps: {},
554
+ mapProperties: {
555
+ color: '#87ceeb',
556
+ roughness: 0.1,
557
+ metalness: 0.1,
558
+ repeatX: 1,
559
+ repeatY: 1,
560
+ rotation: 0,
561
+ wrapS: 'Repeat',
562
+ wrapT: 'Repeat',
563
+ normalScaleX: 1,
564
+ normalScaleY: 1,
565
+ emissiveIntensity: 1,
566
+ displacementScale: 0.02,
567
+ transparent: true,
568
+ flipY: true,
569
+ bumpScale: 1,
570
+ emissiveColor: '#000000',
571
+ aoMapIntensity: 1,
572
+ side: 2,
573
+ opacity: 0.3,
574
+ lightMapIntensity: 1,
575
+ },
576
+ },
577
+ },
578
+ ];
579
+ export function getMaterialsForTarget(target) {
580
+ return MATERIAL_CATALOG.filter((item) => item.targets.includes(target));
581
+ }
582
+ export function getCatalogMaterialById(id) {
583
+ if (!id)
584
+ return undefined;
585
+ return MATERIAL_CATALOG.find((item) => item.id === id);
586
+ }
587
+ export const LIBRARY_MATERIAL_REF_PREFIX = 'library:';
588
+ export function toLibraryMaterialRef(id) {
589
+ return `${LIBRARY_MATERIAL_REF_PREFIX}${id}`;
590
+ }
591
+ export function getLibraryMaterialIdFromRef(materialRef) {
592
+ if (!materialRef)
593
+ return null;
594
+ if (!materialRef.startsWith(LIBRARY_MATERIAL_REF_PREFIX))
595
+ return null;
596
+ return materialRef.slice(LIBRARY_MATERIAL_REF_PREFIX.length);
597
+ }
598
+ export function getMaterialPresetByRef(materialRef) {
599
+ const materialId = getLibraryMaterialIdFromRef(materialRef);
600
+ if (!materialId)
601
+ return null;
602
+ return getCatalogMaterialById(materialId)?.preset ?? null;
603
+ }
@@ -1,22 +1,28 @@
1
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
- export { DEFAULT_MATERIALS, MaterialPreset, MaterialProperties, MaterialSchema, resolveMaterial, } from './material';
4
+ export type { MaterialMapProperties, MaterialMaps, MaterialPresetPayload, MaterialTarget as MaterialTargetValue, TextureWrapMode as TextureWrapModeValue, } from './material';
5
+ export { DEFAULT_MATERIALS, MaterialMapPropertiesSchema, MaterialMapsSchema, MaterialPreset, MaterialPresetPayloadSchema, MaterialProperties, MaterialSchema, MaterialTarget, resolveMaterial, TextureWrapMode, } from './material';
5
6
  export { BuildingNode } from './nodes/building';
6
7
  export { CeilingNode } from './nodes/ceiling';
7
8
  export { DoorNode, DoorSegment } from './nodes/door';
9
+ export { FenceBaseStyle, FenceNode, FenceStyle } from './nodes/fence';
8
10
  export { GuideNode } from './nodes/guide';
9
11
  export type { AnimationEffect, Asset, AssetInput, Control, Effect, Interactive, LightEffect, SliderControl, TemperatureControl, ToggleControl, } from './nodes/item';
10
12
  export { getScaledDimensions, ItemNode } from './nodes/item';
11
13
  export { LevelNode } from './nodes/level';
12
- export { RoofNode } from './nodes/roof';
14
+ export { getEffectiveRoofSurfaceMaterial, RoofNode } from './nodes/roof';
15
+ export type { RoofSurfaceMaterialRole, RoofSurfaceMaterialSpec } from './nodes/roof';
13
16
  export { RoofSegmentNode, RoofType } from './nodes/roof-segment';
14
17
  export { ScanNode } from './nodes/scan';
15
18
  export { SiteNode } from './nodes/site';
16
19
  export { SlabNode } from './nodes/slab';
17
- export { StairNode } from './nodes/stair';
20
+ export { getEffectiveStairSurfaceMaterial, StairNode, StairRailingMode, StairSlabOpeningMode, StairTopLandingMode, StairType, } from './nodes/stair';
21
+ export type { StairSurfaceMaterialRole, StairSurfaceMaterialSpec } from './nodes/stair';
18
22
  export { AttachmentSide, StairSegmentNode, StairSegmentType } from './nodes/stair-segment';
19
- export { WallNode } from './nodes/wall';
23
+ export { SurfaceHoleMetadata } from './nodes/surface-hole-metadata';
24
+ export type { WallSurfaceMaterialSpec, WallSurfaceSide } from './nodes/wall';
25
+ export { getEffectiveWallSurfaceMaterial, getWallSurfaceMaterialSignature, WallNode, } from './nodes/wall';
20
26
  export { WindowNode } from './nodes/window';
21
27
  export { ZoneNode } from './nodes/zone';
22
28
  export type { AnyNodeId, AnyNodeType } from './types';
@@ -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,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAE3E,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,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;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