@pascal-app/core 0.5.1 → 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.
- package/dist/events/bus.d.ts +37 -3
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/bus.js +1 -1
- package/dist/hooks/spatial-grid/spatial-grid.d.ts +2 -0
- package/dist/hooks/spatial-grid/spatial-grid.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid.js +43 -20
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/lib/polygon-geometry.d.ts +3 -0
- package/dist/lib/polygon-geometry.d.ts.map +1 -0
- package/dist/lib/polygon-geometry.js +90 -0
- package/dist/lib/space-detection.d.ts +10 -17
- package/dist/lib/space-detection.d.ts.map +1 -1
- package/dist/lib/space-detection.js +666 -453
- package/dist/material-library.d.ts +18 -0
- package/dist/material-library.d.ts.map +1 -0
- package/dist/material-library.js +603 -0
- package/dist/schema/index.d.ts +9 -4
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +5 -4
- package/dist/schema/material.d.ts +109 -0
- package/dist/schema/material.d.ts.map +1 -1
- package/dist/schema/material.js +52 -0
- package/dist/schema/nodes/ceiling.d.ts +10 -0
- package/dist/schema/nodes/ceiling.d.ts.map +1 -1
- package/dist/schema/nodes/ceiling.js +6 -0
- package/dist/schema/nodes/door.d.ts +1 -0
- package/dist/schema/nodes/door.d.ts.map +1 -1
- package/dist/schema/nodes/fence.d.ts +34 -0
- package/dist/schema/nodes/fence.d.ts.map +1 -1
- package/dist/schema/nodes/fence.js +5 -0
- package/dist/schema/nodes/item.d.ts +2 -2
- package/dist/schema/nodes/roof-segment.d.ts +2 -0
- package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment.js +1 -0
- package/dist/schema/nodes/roof.d.ts +108 -0
- package/dist/schema/nodes/roof.d.ts.map +1 -1
- package/dist/schema/nodes/roof.js +58 -2
- package/dist/schema/nodes/site.d.ts +1 -1
- package/dist/schema/nodes/slab.d.ts +10 -0
- package/dist/schema/nodes/slab.d.ts.map +1 -1
- package/dist/schema/nodes/slab.js +7 -0
- package/dist/schema/nodes/stair-segment.d.ts +2 -0
- package/dist/schema/nodes/stair-segment.d.ts.map +1 -1
- package/dist/schema/nodes/stair-segment.js +1 -0
- package/dist/schema/nodes/stair.d.ts +122 -2
- package/dist/schema/nodes/stair.d.ts.map +1 -1
- package/dist/schema/nodes/stair.js +72 -2
- package/dist/schema/nodes/surface-hole-metadata.d.ts +10 -0
- package/dist/schema/nodes/surface-hole-metadata.d.ts.map +1 -0
- package/dist/schema/nodes/surface-hole-metadata.js +5 -0
- package/dist/schema/nodes/wall.d.ts +87 -1
- package/dist/schema/nodes/wall.d.ts.map +1 -1
- package/dist/schema/nodes/wall.js +45 -4
- package/dist/schema/nodes/window.d.ts +1 -0
- package/dist/schema/nodes/window.d.ts.map +1 -1
- package/dist/schema/types.d.ts +343 -5
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/store/actions/node-actions.d.ts +1 -1
- package/dist/store/actions/node-actions.d.ts.map +1 -1
- package/dist/store/actions/node-actions.js +175 -0
- package/dist/store/history-control.d.ts +14 -0
- package/dist/store/history-control.d.ts.map +1 -0
- package/dist/store/history-control.js +22 -0
- package/dist/store/use-scene.d.ts.map +1 -1
- package/dist/store/use-scene.js +248 -2
- package/dist/systems/ceiling/ceiling-system.d.ts.map +1 -1
- package/dist/systems/ceiling/ceiling-system.js +7 -0
- package/dist/systems/fence/fence-system.d.ts.map +1 -1
- package/dist/systems/fence/fence-system.js +106 -39
- package/dist/systems/roof/roof-system.d.ts.map +1 -1
- package/dist/systems/roof/roof-system.js +31 -1
- package/dist/systems/slab/slab-system.d.ts.map +1 -1
- package/dist/systems/slab/slab-system.js +45 -8
- package/dist/systems/stair/stair-opening-sync.d.ts +6 -0
- package/dist/systems/stair/stair-opening-sync.d.ts.map +1 -0
- package/dist/systems/stair/stair-opening-sync.js +515 -0
- package/dist/systems/stair/stair-system.d.ts.map +1 -1
- package/dist/systems/stair/stair-system.js +119 -2
- package/dist/systems/wall/wall-curve.d.ts +43 -0
- package/dist/systems/wall/wall-curve.d.ts.map +1 -0
- package/dist/systems/wall/wall-curve.js +176 -0
- package/dist/systems/wall/wall-footprint.d.ts.map +1 -1
- package/dist/systems/wall/wall-footprint.js +16 -2
- package/dist/systems/wall/wall-mitering.d.ts +7 -0
- package/dist/systems/wall/wall-mitering.d.ts.map +1 -1
- package/dist/systems/wall/wall-mitering.js +76 -3
- package/dist/systems/wall/wall-system.d.ts.map +1 -1
- package/dist/systems/wall/wall-system.js +202 -2
- package/package.json +3 -3
package/dist/schema/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { CameraSchema } from './camera';
|
|
|
5
5
|
// Collections
|
|
6
6
|
export { generateCollectionId } from './collections';
|
|
7
7
|
// Material
|
|
8
|
-
export { DEFAULT_MATERIALS, MaterialPreset, MaterialProperties, MaterialSchema, resolveMaterial, } from './material';
|
|
8
|
+
export { DEFAULT_MATERIALS, MaterialMapPropertiesSchema, MaterialMapsSchema, MaterialPreset, MaterialPresetPayloadSchema, MaterialProperties, MaterialSchema, MaterialTarget, resolveMaterial, TextureWrapMode, } from './material';
|
|
9
9
|
export { BuildingNode } from './nodes/building';
|
|
10
10
|
export { CeilingNode } from './nodes/ceiling';
|
|
11
11
|
export { DoorNode, DoorSegment } from './nodes/door';
|
|
@@ -13,15 +13,16 @@ export { FenceBaseStyle, FenceNode, FenceStyle } from './nodes/fence';
|
|
|
13
13
|
export { GuideNode } from './nodes/guide';
|
|
14
14
|
export { getScaledDimensions, ItemNode } from './nodes/item';
|
|
15
15
|
export { LevelNode } from './nodes/level';
|
|
16
|
-
export { RoofNode } from './nodes/roof';
|
|
16
|
+
export { getEffectiveRoofSurfaceMaterial, RoofNode } from './nodes/roof';
|
|
17
17
|
export { RoofSegmentNode, RoofType } from './nodes/roof-segment';
|
|
18
18
|
export { ScanNode } from './nodes/scan';
|
|
19
19
|
// Nodes
|
|
20
20
|
export { SiteNode } from './nodes/site';
|
|
21
21
|
export { SlabNode } from './nodes/slab';
|
|
22
|
-
export { StairNode, StairRailingMode, StairTopLandingMode, StairType } from './nodes/stair';
|
|
22
|
+
export { getEffectiveStairSurfaceMaterial, StairNode, StairRailingMode, StairSlabOpeningMode, StairTopLandingMode, StairType, } from './nodes/stair';
|
|
23
23
|
export { AttachmentSide, StairSegmentNode, StairSegmentType } from './nodes/stair-segment';
|
|
24
|
-
export {
|
|
24
|
+
export { SurfaceHoleMetadata } from './nodes/surface-hole-metadata';
|
|
25
|
+
export { getEffectiveWallSurfaceMaterial, getWallSurfaceMaterialSignature, WallNode, } from './nodes/wall';
|
|
25
26
|
export { WindowNode } from './nodes/window';
|
|
26
27
|
export { ZoneNode } from './nodes/zone';
|
|
27
28
|
// Union types
|
|
@@ -26,6 +26,7 @@ export declare const MaterialProperties: z.ZodObject<{
|
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
export type MaterialProperties = z.infer<typeof MaterialProperties>;
|
|
28
28
|
export declare const MaterialSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodOptional<z.ZodString>;
|
|
29
30
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
30
31
|
custom: "custom";
|
|
31
32
|
white: "white";
|
|
@@ -57,6 +58,114 @@ export declare const MaterialSchema: z.ZodObject<{
|
|
|
57
58
|
}, z.core.$strip>>;
|
|
58
59
|
}, z.core.$strip>;
|
|
59
60
|
export type MaterialSchema = z.infer<typeof MaterialSchema>;
|
|
61
|
+
export declare const MaterialTarget: z.ZodEnum<{
|
|
62
|
+
wall: "wall";
|
|
63
|
+
roof: "roof";
|
|
64
|
+
"roof-segment": "roof-segment";
|
|
65
|
+
stair: "stair";
|
|
66
|
+
"stair-segment": "stair-segment";
|
|
67
|
+
fence: "fence";
|
|
68
|
+
slab: "slab";
|
|
69
|
+
ceiling: "ceiling";
|
|
70
|
+
door: "door";
|
|
71
|
+
window: "window";
|
|
72
|
+
}>;
|
|
73
|
+
export type MaterialTarget = z.infer<typeof MaterialTarget>;
|
|
74
|
+
export declare const TextureWrapMode: z.ZodEnum<{
|
|
75
|
+
Repeat: "Repeat";
|
|
76
|
+
ClampToEdge: "ClampToEdge";
|
|
77
|
+
MirroredRepeat: "MirroredRepeat";
|
|
78
|
+
}>;
|
|
79
|
+
export type TextureWrapMode = z.infer<typeof TextureWrapMode>;
|
|
80
|
+
export declare const MaterialMapsSchema: z.ZodObject<{
|
|
81
|
+
albedoMap: z.ZodOptional<z.ZodString>;
|
|
82
|
+
metalnessMap: z.ZodOptional<z.ZodString>;
|
|
83
|
+
roughnessMap: z.ZodOptional<z.ZodString>;
|
|
84
|
+
normalMap: z.ZodOptional<z.ZodString>;
|
|
85
|
+
displacementMap: z.ZodOptional<z.ZodString>;
|
|
86
|
+
aoMap: z.ZodOptional<z.ZodString>;
|
|
87
|
+
emissiveMap: z.ZodOptional<z.ZodString>;
|
|
88
|
+
bumpMap: z.ZodOptional<z.ZodString>;
|
|
89
|
+
alphaMap: z.ZodOptional<z.ZodString>;
|
|
90
|
+
lightMap: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type MaterialMaps = z.infer<typeof MaterialMapsSchema>;
|
|
93
|
+
export declare const MaterialMapPropertiesSchema: z.ZodObject<{
|
|
94
|
+
color: z.ZodDefault<z.ZodString>;
|
|
95
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
96
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
97
|
+
repeatX: z.ZodDefault<z.ZodNumber>;
|
|
98
|
+
repeatY: z.ZodDefault<z.ZodNumber>;
|
|
99
|
+
rotation: z.ZodDefault<z.ZodNumber>;
|
|
100
|
+
wrapS: z.ZodDefault<z.ZodEnum<{
|
|
101
|
+
Repeat: "Repeat";
|
|
102
|
+
ClampToEdge: "ClampToEdge";
|
|
103
|
+
MirroredRepeat: "MirroredRepeat";
|
|
104
|
+
}>>;
|
|
105
|
+
wrapT: z.ZodDefault<z.ZodEnum<{
|
|
106
|
+
Repeat: "Repeat";
|
|
107
|
+
ClampToEdge: "ClampToEdge";
|
|
108
|
+
MirroredRepeat: "MirroredRepeat";
|
|
109
|
+
}>>;
|
|
110
|
+
normalScaleX: z.ZodDefault<z.ZodNumber>;
|
|
111
|
+
normalScaleY: z.ZodDefault<z.ZodNumber>;
|
|
112
|
+
emissiveIntensity: z.ZodDefault<z.ZodNumber>;
|
|
113
|
+
displacementScale: z.ZodDefault<z.ZodNumber>;
|
|
114
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
115
|
+
flipY: z.ZodDefault<z.ZodBoolean>;
|
|
116
|
+
bumpScale: z.ZodDefault<z.ZodNumber>;
|
|
117
|
+
emissiveColor: z.ZodDefault<z.ZodString>;
|
|
118
|
+
aoMapIntensity: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
side: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
121
|
+
lightMapIntensity: z.ZodDefault<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
export type MaterialMapProperties = z.infer<typeof MaterialMapPropertiesSchema>;
|
|
124
|
+
export declare const MaterialPresetPayloadSchema: z.ZodObject<{
|
|
125
|
+
maps: z.ZodObject<{
|
|
126
|
+
albedoMap: z.ZodOptional<z.ZodString>;
|
|
127
|
+
metalnessMap: z.ZodOptional<z.ZodString>;
|
|
128
|
+
roughnessMap: z.ZodOptional<z.ZodString>;
|
|
129
|
+
normalMap: z.ZodOptional<z.ZodString>;
|
|
130
|
+
displacementMap: z.ZodOptional<z.ZodString>;
|
|
131
|
+
aoMap: z.ZodOptional<z.ZodString>;
|
|
132
|
+
emissiveMap: z.ZodOptional<z.ZodString>;
|
|
133
|
+
bumpMap: z.ZodOptional<z.ZodString>;
|
|
134
|
+
alphaMap: z.ZodOptional<z.ZodString>;
|
|
135
|
+
lightMap: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
mapProperties: z.ZodObject<{
|
|
138
|
+
color: z.ZodDefault<z.ZodString>;
|
|
139
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
140
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
141
|
+
repeatX: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
repeatY: z.ZodDefault<z.ZodNumber>;
|
|
143
|
+
rotation: z.ZodDefault<z.ZodNumber>;
|
|
144
|
+
wrapS: z.ZodDefault<z.ZodEnum<{
|
|
145
|
+
Repeat: "Repeat";
|
|
146
|
+
ClampToEdge: "ClampToEdge";
|
|
147
|
+
MirroredRepeat: "MirroredRepeat";
|
|
148
|
+
}>>;
|
|
149
|
+
wrapT: z.ZodDefault<z.ZodEnum<{
|
|
150
|
+
Repeat: "Repeat";
|
|
151
|
+
ClampToEdge: "ClampToEdge";
|
|
152
|
+
MirroredRepeat: "MirroredRepeat";
|
|
153
|
+
}>>;
|
|
154
|
+
normalScaleX: z.ZodDefault<z.ZodNumber>;
|
|
155
|
+
normalScaleY: z.ZodDefault<z.ZodNumber>;
|
|
156
|
+
emissiveIntensity: z.ZodDefault<z.ZodNumber>;
|
|
157
|
+
displacementScale: z.ZodDefault<z.ZodNumber>;
|
|
158
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
159
|
+
flipY: z.ZodDefault<z.ZodBoolean>;
|
|
160
|
+
bumpScale: z.ZodDefault<z.ZodNumber>;
|
|
161
|
+
emissiveColor: z.ZodDefault<z.ZodString>;
|
|
162
|
+
aoMapIntensity: z.ZodDefault<z.ZodNumber>;
|
|
163
|
+
side: z.ZodDefault<z.ZodNumber>;
|
|
164
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
165
|
+
lightMapIntensity: z.ZodDefault<z.ZodNumber>;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
export type MaterialPresetPayload = z.infer<typeof MaterialPresetPayloadSchema>;
|
|
60
169
|
export declare const DEFAULT_MATERIALS: Record<MaterialPreset, MaterialProperties>;
|
|
61
170
|
export declare function resolveMaterial(material?: MaterialSchema): MaterialProperties;
|
|
62
171
|
//# sourceMappingURL=material.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/schema/material.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc;;;;;;;;;;;EAWzB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,kBAAkB;;;;;;;;;;;iBAO7B,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../src/schema/material.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc;;;;;;;;;;;EAWzB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,kBAAkB;;;;;;;;;;;iBAO7B,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWzB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,cAAc;;;;;;;;;;;EAWzB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,eAAe;;;;EAAsD,CAAA;AAClF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE7D,eAAO,MAAM,kBAAkB;;;;;;;;;;;iBAW7B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBtC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE/E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGtC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE/E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAiFxE,CAAA;AAED,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,kBAAkB,CAiB7E"}
|
package/dist/schema/material.js
CHANGED
|
@@ -20,6 +20,7 @@ export const MaterialProperties = z.object({
|
|
|
20
20
|
side: z.enum(['front', 'back', 'double']).default('front'),
|
|
21
21
|
});
|
|
22
22
|
export const MaterialSchema = z.object({
|
|
23
|
+
id: z.string().optional(),
|
|
23
24
|
preset: MaterialPreset.optional(),
|
|
24
25
|
properties: MaterialProperties.optional(),
|
|
25
26
|
texture: z
|
|
@@ -30,6 +31,57 @@ export const MaterialSchema = z.object({
|
|
|
30
31
|
})
|
|
31
32
|
.optional(),
|
|
32
33
|
});
|
|
34
|
+
export const MaterialTarget = z.enum([
|
|
35
|
+
'wall',
|
|
36
|
+
'roof',
|
|
37
|
+
'roof-segment',
|
|
38
|
+
'stair',
|
|
39
|
+
'stair-segment',
|
|
40
|
+
'fence',
|
|
41
|
+
'slab',
|
|
42
|
+
'ceiling',
|
|
43
|
+
'door',
|
|
44
|
+
'window',
|
|
45
|
+
]);
|
|
46
|
+
export const TextureWrapMode = z.enum(['Repeat', 'ClampToEdge', 'MirroredRepeat']);
|
|
47
|
+
export const MaterialMapsSchema = z.object({
|
|
48
|
+
albedoMap: z.string().optional(),
|
|
49
|
+
metalnessMap: z.string().optional(),
|
|
50
|
+
roughnessMap: z.string().optional(),
|
|
51
|
+
normalMap: z.string().optional(),
|
|
52
|
+
displacementMap: z.string().optional(),
|
|
53
|
+
aoMap: z.string().optional(),
|
|
54
|
+
emissiveMap: z.string().optional(),
|
|
55
|
+
bumpMap: z.string().optional(),
|
|
56
|
+
alphaMap: z.string().optional(),
|
|
57
|
+
lightMap: z.string().optional(),
|
|
58
|
+
});
|
|
59
|
+
export const MaterialMapPropertiesSchema = z.object({
|
|
60
|
+
color: z.string().default('#ffffff'),
|
|
61
|
+
roughness: z.number().min(0).max(1).default(0.5),
|
|
62
|
+
metalness: z.number().min(0).max(1).default(0),
|
|
63
|
+
repeatX: z.number().default(1),
|
|
64
|
+
repeatY: z.number().default(1),
|
|
65
|
+
rotation: z.number().default(0),
|
|
66
|
+
wrapS: TextureWrapMode.default('Repeat'),
|
|
67
|
+
wrapT: TextureWrapMode.default('Repeat'),
|
|
68
|
+
normalScaleX: z.number().default(1),
|
|
69
|
+
normalScaleY: z.number().default(1),
|
|
70
|
+
emissiveIntensity: z.number().default(1),
|
|
71
|
+
displacementScale: z.number().default(0.02),
|
|
72
|
+
transparent: z.boolean().default(false),
|
|
73
|
+
flipY: z.boolean().default(true),
|
|
74
|
+
bumpScale: z.number().default(1),
|
|
75
|
+
emissiveColor: z.string().default('#000000'),
|
|
76
|
+
aoMapIntensity: z.number().default(1),
|
|
77
|
+
side: z.number().default(0),
|
|
78
|
+
opacity: z.number().min(0).max(1).default(1),
|
|
79
|
+
lightMapIntensity: z.number().default(1),
|
|
80
|
+
});
|
|
81
|
+
export const MaterialPresetPayloadSchema = z.object({
|
|
82
|
+
maps: MaterialMapsSchema,
|
|
83
|
+
mapProperties: MaterialMapPropertiesSchema,
|
|
84
|
+
});
|
|
33
85
|
export const DEFAULT_MATERIALS = {
|
|
34
86
|
white: {
|
|
35
87
|
color: '#ffffff',
|
|
@@ -19,6 +19,7 @@ export declare const CeilingNode: z.ZodObject<{
|
|
|
19
19
|
type: z.ZodDefault<z.ZodLiteral<"ceiling">>;
|
|
20
20
|
children: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodTemplateLiteral<`item_${string}`>>>>;
|
|
21
21
|
material: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
id: z.ZodOptional<z.ZodString>;
|
|
22
23
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
23
24
|
custom: "custom";
|
|
24
25
|
white: "white";
|
|
@@ -49,9 +50,18 @@ export declare const CeilingNode: z.ZodObject<{
|
|
|
49
50
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
50
51
|
}, z.core.$strip>>;
|
|
51
52
|
}, z.core.$strip>>;
|
|
53
|
+
materialPreset: z.ZodOptional<z.ZodString>;
|
|
52
54
|
polygon: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
53
55
|
holes: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>>;
|
|
56
|
+
holeMetadata: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
57
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
58
|
+
stair: "stair";
|
|
59
|
+
manual: "manual";
|
|
60
|
+
}>>;
|
|
61
|
+
stairId: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>>;
|
|
54
63
|
height: z.ZodDefault<z.ZodNumber>;
|
|
64
|
+
autoFromWalls: z.ZodDefault<z.ZodBoolean>;
|
|
55
65
|
}, z.core.$strip>;
|
|
56
66
|
export type CeilingNode = z.infer<typeof CeilingNode>;
|
|
57
67
|
//# sourceMappingURL=ceiling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ceiling.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/ceiling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"ceiling.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/ceiling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBvB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA"}
|
|
@@ -3,16 +3,22 @@ import { z } from 'zod';
|
|
|
3
3
|
import { BaseNode, nodeType, objectId } from '../base';
|
|
4
4
|
import { MaterialSchema } from '../material';
|
|
5
5
|
import { ItemNode } from './item';
|
|
6
|
+
import { SurfaceHoleMetadata } from './surface-hole-metadata';
|
|
6
7
|
export const CeilingNode = BaseNode.extend({
|
|
7
8
|
id: objectId('ceiling'),
|
|
8
9
|
type: nodeType('ceiling'),
|
|
9
10
|
children: z.array(ItemNode.shape.id).default([]),
|
|
10
11
|
material: MaterialSchema.optional(),
|
|
12
|
+
materialPreset: z.string().optional(),
|
|
11
13
|
polygon: z.array(z.tuple([z.number(), z.number()])),
|
|
12
14
|
holes: z.array(z.array(z.tuple([z.number(), z.number()]))).default([]),
|
|
15
|
+
holeMetadata: z.array(SurfaceHoleMetadata).default([]),
|
|
13
16
|
height: z.number().default(2.5), // Height in meters
|
|
17
|
+
autoFromWalls: z.boolean().default(false),
|
|
14
18
|
}).describe(dedent `
|
|
15
19
|
Ceiling node - used to represent a ceiling in the building
|
|
16
20
|
- polygon: array of [x, z] points defining the ceiling boundary
|
|
17
21
|
- holes: array of polygons representing holes in the ceiling
|
|
22
|
+
- holeMetadata: metadata parallel to holes, used to preserve manual and stair-managed cutouts
|
|
23
|
+
- autoFromWalls: whether the ceiling is automatically generated from a closed wall loop
|
|
18
24
|
`);
|
|
@@ -31,6 +31,7 @@ export declare const DoorNode: z.ZodObject<{
|
|
|
31
31
|
id: z.ZodDefault<z.ZodTemplateLiteral<`door_${string}`>>;
|
|
32
32
|
type: z.ZodDefault<z.ZodLiteral<"door">>;
|
|
33
33
|
material: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
id: z.ZodOptional<z.ZodString>;
|
|
34
35
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
35
36
|
custom: "custom";
|
|
36
37
|
white: "white";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"door.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/door.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,WAAW;;;;;;;;;;;iBAWtB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAErD,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"door.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/door.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,WAAW;;;;;;;;;;;iBAWtB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAErD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8DnB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
|
@@ -26,8 +26,42 @@ export declare const FenceNode: z.ZodObject<{
|
|
|
26
26
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
|
|
27
27
|
id: z.ZodDefault<z.ZodTemplateLiteral<`fence_${string}`>>;
|
|
28
28
|
type: z.ZodDefault<z.ZodLiteral<"fence">>;
|
|
29
|
+
material: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
custom: "custom";
|
|
33
|
+
white: "white";
|
|
34
|
+
brick: "brick";
|
|
35
|
+
concrete: "concrete";
|
|
36
|
+
wood: "wood";
|
|
37
|
+
glass: "glass";
|
|
38
|
+
metal: "metal";
|
|
39
|
+
plaster: "plaster";
|
|
40
|
+
tile: "tile";
|
|
41
|
+
marble: "marble";
|
|
42
|
+
}>>;
|
|
43
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
color: z.ZodDefault<z.ZodString>;
|
|
45
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
46
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
48
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
50
|
+
front: "front";
|
|
51
|
+
back: "back";
|
|
52
|
+
double: "double";
|
|
53
|
+
}>>;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
url: z.ZodString;
|
|
57
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
58
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
materialPreset: z.ZodOptional<z.ZodString>;
|
|
29
62
|
start: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
30
63
|
end: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
64
|
+
curveOffset: z.ZodOptional<z.ZodNumber>;
|
|
31
65
|
height: z.ZodDefault<z.ZodNumber>;
|
|
32
66
|
thickness: z.ZodDefault<z.ZodNumber>;
|
|
33
67
|
baseHeight: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/fence.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/fence.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,UAAU;;;;EAAsC,CAAA;AAC7D,eAAO,MAAM,cAAc;;;EAAmC,CAAA;AAE9D,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BrB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import dedent from 'dedent';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { BaseNode, nodeType, objectId } from '../base';
|
|
4
|
+
import { MaterialSchema } from '../material';
|
|
4
5
|
export const FenceStyle = z.enum(['slat', 'rail', 'privacy']);
|
|
5
6
|
export const FenceBaseStyle = z.enum(['floating', 'grounded']);
|
|
6
7
|
export const FenceNode = BaseNode.extend({
|
|
7
8
|
id: objectId('fence'),
|
|
8
9
|
type: nodeType('fence'),
|
|
10
|
+
material: MaterialSchema.optional(),
|
|
11
|
+
materialPreset: z.string().optional(),
|
|
9
12
|
start: z.tuple([z.number(), z.number()]),
|
|
10
13
|
end: z.tuple([z.number(), z.number()]),
|
|
14
|
+
curveOffset: z.number().optional(),
|
|
11
15
|
height: z.number().default(1.8),
|
|
12
16
|
thickness: z.number().default(0.08),
|
|
13
17
|
baseHeight: z.number().default(0.22),
|
|
@@ -22,6 +26,7 @@ export const FenceNode = BaseNode.extend({
|
|
|
22
26
|
}).describe(dedent `
|
|
23
27
|
Fence node - used to represent a fence segment in the building/site level coordinate system
|
|
24
28
|
- start/end: fence endpoints in level coordinate system
|
|
29
|
+
- curveOffset: midpoint sagitta offset used to bend the fence into an arc
|
|
25
30
|
- height/thickness: overall fence dimensions in meters
|
|
26
31
|
- baseHeight/postSpacing/postSize/topRailHeight: exact geometric controls from the plan3D fence model
|
|
27
32
|
- groundClearance/edgeInset/baseStyle: fence support and inset configuration
|
|
@@ -147,8 +147,8 @@ declare const assetSchema: z.ZodObject<{
|
|
|
147
147
|
dimensions: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
148
148
|
attachTo: z.ZodOptional<z.ZodEnum<{
|
|
149
149
|
wall: "wall";
|
|
150
|
-
"wall-side": "wall-side";
|
|
151
150
|
ceiling: "ceiling";
|
|
151
|
+
"wall-side": "wall-side";
|
|
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>>;
|
|
@@ -242,8 +242,8 @@ export declare const ItemNode: z.ZodObject<{
|
|
|
242
242
|
dimensions: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
243
243
|
attachTo: z.ZodOptional<z.ZodEnum<{
|
|
244
244
|
wall: "wall";
|
|
245
|
-
"wall-side": "wall-side";
|
|
246
245
|
ceiling: "ceiling";
|
|
246
|
+
"wall-side": "wall-side";
|
|
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>>;
|
|
@@ -28,6 +28,7 @@ export declare const RoofSegmentNode: z.ZodObject<{
|
|
|
28
28
|
id: z.ZodDefault<z.ZodTemplateLiteral<`rseg_${string}`>>;
|
|
29
29
|
type: z.ZodDefault<z.ZodLiteral<"roof-segment">>;
|
|
30
30
|
material: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
id: z.ZodOptional<z.ZodString>;
|
|
31
32
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
32
33
|
custom: "custom";
|
|
33
34
|
white: "white";
|
|
@@ -58,6 +59,7 @@ export declare const RoofSegmentNode: z.ZodObject<{
|
|
|
58
59
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
59
60
|
}, z.core.$strip>>;
|
|
60
61
|
}, z.core.$strip>>;
|
|
62
|
+
materialPreset: z.ZodOptional<z.ZodString>;
|
|
61
63
|
position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
62
64
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
63
65
|
roofType: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roof-segment.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/roof-segment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,QAAQ;;;;;;;;EAA0E,CAAA;AAE/F,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE/C,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"roof-segment.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/roof-segment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,QAAQ;;;;;;;;EAA0E,CAAA;AAE/F,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE/C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkC3B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
|
|
@@ -7,6 +7,7 @@ export const RoofSegmentNode = BaseNode.extend({
|
|
|
7
7
|
id: objectId('rseg'),
|
|
8
8
|
type: nodeType('roof-segment'),
|
|
9
9
|
material: MaterialSchema.optional(),
|
|
10
|
+
materialPreset: z.string().optional(),
|
|
10
11
|
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
|
|
11
12
|
// Rotation around Y axis in radians
|
|
12
13
|
rotation: z.number().default(0),
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type MaterialSchema } from '../material';
|
|
3
|
+
export type RoofSurfaceMaterialRole = 'top' | 'edge' | 'wall';
|
|
4
|
+
export type RoofSurfaceMaterialSpec = {
|
|
5
|
+
material?: MaterialSchema;
|
|
6
|
+
materialPreset?: string;
|
|
7
|
+
};
|
|
2
8
|
export declare const RoofNode: z.ZodObject<{
|
|
3
9
|
object: z.ZodDefault<z.ZodLiteral<"node">>;
|
|
4
10
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -18,6 +24,7 @@ export declare const RoofNode: z.ZodObject<{
|
|
|
18
24
|
id: z.ZodDefault<z.ZodTemplateLiteral<`roof_${string}`>>;
|
|
19
25
|
type: z.ZodDefault<z.ZodLiteral<"roof">>;
|
|
20
26
|
material: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
id: z.ZodOptional<z.ZodString>;
|
|
21
28
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
22
29
|
custom: "custom";
|
|
23
30
|
white: "white";
|
|
@@ -48,9 +55,110 @@ export declare const RoofNode: z.ZodObject<{
|
|
|
48
55
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
49
56
|
}, z.core.$strip>>;
|
|
50
57
|
}, z.core.$strip>>;
|
|
58
|
+
materialPreset: z.ZodOptional<z.ZodString>;
|
|
59
|
+
topMaterial: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
id: z.ZodOptional<z.ZodString>;
|
|
61
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
custom: "custom";
|
|
63
|
+
white: "white";
|
|
64
|
+
brick: "brick";
|
|
65
|
+
concrete: "concrete";
|
|
66
|
+
wood: "wood";
|
|
67
|
+
glass: "glass";
|
|
68
|
+
metal: "metal";
|
|
69
|
+
plaster: "plaster";
|
|
70
|
+
tile: "tile";
|
|
71
|
+
marble: "marble";
|
|
72
|
+
}>>;
|
|
73
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
color: z.ZodDefault<z.ZodString>;
|
|
75
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
76
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
77
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
80
|
+
front: "front";
|
|
81
|
+
back: "back";
|
|
82
|
+
double: "double";
|
|
83
|
+
}>>;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
url: z.ZodString;
|
|
87
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
88
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
topMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
92
|
+
edgeMaterial: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
id: z.ZodOptional<z.ZodString>;
|
|
94
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
custom: "custom";
|
|
96
|
+
white: "white";
|
|
97
|
+
brick: "brick";
|
|
98
|
+
concrete: "concrete";
|
|
99
|
+
wood: "wood";
|
|
100
|
+
glass: "glass";
|
|
101
|
+
metal: "metal";
|
|
102
|
+
plaster: "plaster";
|
|
103
|
+
tile: "tile";
|
|
104
|
+
marble: "marble";
|
|
105
|
+
}>>;
|
|
106
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
color: z.ZodDefault<z.ZodString>;
|
|
108
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
109
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
110
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
111
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
112
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
113
|
+
front: "front";
|
|
114
|
+
back: "back";
|
|
115
|
+
double: "double";
|
|
116
|
+
}>>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
118
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
url: z.ZodString;
|
|
120
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
121
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
}, z.core.$strip>>;
|
|
124
|
+
edgeMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
125
|
+
wallMaterial: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
id: z.ZodOptional<z.ZodString>;
|
|
127
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
custom: "custom";
|
|
129
|
+
white: "white";
|
|
130
|
+
brick: "brick";
|
|
131
|
+
concrete: "concrete";
|
|
132
|
+
wood: "wood";
|
|
133
|
+
glass: "glass";
|
|
134
|
+
metal: "metal";
|
|
135
|
+
plaster: "plaster";
|
|
136
|
+
tile: "tile";
|
|
137
|
+
marble: "marble";
|
|
138
|
+
}>>;
|
|
139
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
color: z.ZodDefault<z.ZodString>;
|
|
141
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
143
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
144
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
145
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
146
|
+
front: "front";
|
|
147
|
+
back: "back";
|
|
148
|
+
double: "double";
|
|
149
|
+
}>>;
|
|
150
|
+
}, z.core.$strip>>;
|
|
151
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
url: z.ZodString;
|
|
153
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
154
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
157
|
+
wallMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
51
158
|
position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
52
159
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
53
160
|
children: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodTemplateLiteral<`rseg_${string}`>>>>;
|
|
54
161
|
}, z.core.$strip>;
|
|
55
162
|
export type RoofNode = z.infer<typeof RoofNode>;
|
|
163
|
+
export declare function getEffectiveRoofSurfaceMaterial(node: RoofNode, role: RoofSurfaceMaterialRole): RoofSurfaceMaterialSpec;
|
|
56
164
|
//# sourceMappingURL=roof.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roof.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/roof.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"roof.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/roof.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,KAAK,cAAc,EAA0C,MAAM,aAAa,CAAA;AAGzF,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;AAC7D,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBpB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAS/C,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,uBAAuB,GAC5B,uBAAuB,CAmDzB"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import dedent from 'dedent';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { BaseNode, nodeType, objectId } from '../base';
|
|
4
|
-
import { MaterialSchema } from '../material';
|
|
4
|
+
import { MaterialSchema as MaterialSchemaSchema } from '../material';
|
|
5
5
|
import { RoofSegmentNode } from './roof-segment';
|
|
6
6
|
export const RoofNode = BaseNode.extend({
|
|
7
7
|
id: objectId('roof'),
|
|
8
8
|
type: nodeType('roof'),
|
|
9
|
-
material:
|
|
9
|
+
material: MaterialSchemaSchema.optional(),
|
|
10
|
+
materialPreset: z.string().optional(),
|
|
11
|
+
topMaterial: MaterialSchemaSchema.optional(),
|
|
12
|
+
topMaterialPreset: z.string().optional(),
|
|
13
|
+
edgeMaterial: MaterialSchemaSchema.optional(),
|
|
14
|
+
edgeMaterialPreset: z.string().optional(),
|
|
15
|
+
wallMaterial: MaterialSchemaSchema.optional(),
|
|
16
|
+
wallMaterialPreset: z.string().optional(),
|
|
10
17
|
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
|
|
11
18
|
// Rotation around Y axis in radians
|
|
12
19
|
rotation: z.number().default(0),
|
|
@@ -20,3 +27,52 @@ export const RoofNode = BaseNode.extend({
|
|
|
20
27
|
- rotation: rotation around Y axis
|
|
21
28
|
- children: array of RoofSegmentNode IDs
|
|
22
29
|
`);
|
|
30
|
+
function getLegacyRoofSurfaceMaterial(node) {
|
|
31
|
+
return {
|
|
32
|
+
material: node.material,
|
|
33
|
+
materialPreset: node.materialPreset,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function getEffectiveRoofSurfaceMaterial(node, role) {
|
|
37
|
+
if (role === 'top') {
|
|
38
|
+
if (node.topMaterial !== undefined || typeof node.topMaterialPreset === 'string') {
|
|
39
|
+
return {
|
|
40
|
+
material: node.topMaterial,
|
|
41
|
+
materialPreset: typeof node.topMaterialPreset === 'string' ? node.topMaterialPreset : undefined,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (role === 'edge') {
|
|
46
|
+
if (node.edgeMaterial !== undefined || typeof node.edgeMaterialPreset === 'string') {
|
|
47
|
+
return {
|
|
48
|
+
material: node.edgeMaterial,
|
|
49
|
+
materialPreset: typeof node.edgeMaterialPreset === 'string' ? node.edgeMaterialPreset : undefined,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (role === 'wall') {
|
|
54
|
+
if (node.wallMaterial !== undefined || typeof node.wallMaterialPreset === 'string') {
|
|
55
|
+
return {
|
|
56
|
+
material: node.wallMaterial,
|
|
57
|
+
materialPreset: typeof node.wallMaterialPreset === 'string' ? node.wallMaterialPreset : undefined,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (role === 'edge') {
|
|
62
|
+
if (node.wallMaterial !== undefined || typeof node.wallMaterialPreset === 'string') {
|
|
63
|
+
return {
|
|
64
|
+
material: node.wallMaterial,
|
|
65
|
+
materialPreset: typeof node.wallMaterialPreset === 'string' ? node.wallMaterialPreset : undefined,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (role === 'wall') {
|
|
70
|
+
if (node.edgeMaterial !== undefined || typeof node.edgeMaterialPreset === 'string') {
|
|
71
|
+
return {
|
|
72
|
+
material: node.edgeMaterial,
|
|
73
|
+
materialPreset: typeof node.edgeMaterialPreset === 'string' ? node.edgeMaterialPreset : undefined,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return getLegacyRoofSurfaceMaterial(node);
|
|
78
|
+
}
|
|
@@ -80,8 +80,8 @@ export declare const SiteNode: z.ZodObject<{
|
|
|
80
80
|
dimensions: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
81
81
|
attachTo: z.ZodOptional<z.ZodEnum<{
|
|
82
82
|
wall: "wall";
|
|
83
|
-
"wall-side": "wall-side";
|
|
84
83
|
ceiling: "ceiling";
|
|
84
|
+
"wall-side": "wall-side";
|
|
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>>;
|