@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
|
@@ -18,6 +18,7 @@ export declare const SlabNode: z.ZodObject<{
|
|
|
18
18
|
id: z.ZodDefault<z.ZodTemplateLiteral<`slab_${string}`>>;
|
|
19
19
|
type: z.ZodDefault<z.ZodLiteral<"slab">>;
|
|
20
20
|
material: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
id: z.ZodOptional<z.ZodString>;
|
|
21
22
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
22
23
|
custom: "custom";
|
|
23
24
|
white: "white";
|
|
@@ -48,9 +49,18 @@ export declare const SlabNode: z.ZodObject<{
|
|
|
48
49
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
49
50
|
}, z.core.$strip>>;
|
|
50
51
|
}, z.core.$strip>>;
|
|
52
|
+
materialPreset: z.ZodOptional<z.ZodString>;
|
|
51
53
|
polygon: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
52
54
|
holes: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>>;
|
|
55
|
+
holeMetadata: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
56
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
57
|
+
stair: "stair";
|
|
58
|
+
manual: "manual";
|
|
59
|
+
}>>;
|
|
60
|
+
stairId: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strip>>>;
|
|
53
62
|
elevation: z.ZodDefault<z.ZodNumber>;
|
|
63
|
+
autoFromWalls: z.ZodDefault<z.ZodBoolean>;
|
|
54
64
|
}, z.core.$strip>;
|
|
55
65
|
export type SlabNode = z.infer<typeof SlabNode>;
|
|
56
66
|
//# sourceMappingURL=slab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slab.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/slab.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"slab.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/slab.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBpB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
|
@@ -2,15 +2,22 @@ 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
|
+
import { SurfaceHoleMetadata } from './surface-hole-metadata';
|
|
5
6
|
export const SlabNode = BaseNode.extend({
|
|
6
7
|
id: objectId('slab'),
|
|
7
8
|
type: nodeType('slab'),
|
|
8
9
|
material: MaterialSchema.optional(),
|
|
10
|
+
materialPreset: z.string().optional(),
|
|
9
11
|
polygon: z.array(z.tuple([z.number(), z.number()])),
|
|
10
12
|
holes: z.array(z.array(z.tuple([z.number(), z.number()]))).default([]),
|
|
13
|
+
holeMetadata: z.array(SurfaceHoleMetadata).default([]),
|
|
11
14
|
elevation: z.number().default(0.05), // Elevation in meters
|
|
15
|
+
autoFromWalls: z.boolean().default(false),
|
|
12
16
|
}).describe(dedent `
|
|
13
17
|
Slab node - used to represent a slab/floor in the building
|
|
14
18
|
- polygon: array of [x, z] points defining the slab boundary
|
|
19
|
+
- holes: array of [x, z] polygons representing cutouts in the slab
|
|
20
|
+
- holeMetadata: metadata parallel to holes, used to preserve manual and stair-managed cutouts
|
|
15
21
|
- elevation: elevation in meters
|
|
22
|
+
- autoFromWalls: whether the slab is automatically generated from a closed wall loop
|
|
16
23
|
`);
|
|
@@ -29,6 +29,7 @@ export declare const StairSegmentNode: z.ZodObject<{
|
|
|
29
29
|
id: z.ZodDefault<z.ZodTemplateLiteral<`sseg_${string}`>>;
|
|
30
30
|
type: z.ZodDefault<z.ZodLiteral<"stair-segment">>;
|
|
31
31
|
material: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
id: z.ZodOptional<z.ZodString>;
|
|
32
33
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
33
34
|
custom: "custom";
|
|
34
35
|
white: "white";
|
|
@@ -59,6 +60,7 @@ export declare const StairSegmentNode: z.ZodObject<{
|
|
|
59
60
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
60
61
|
}, z.core.$strip>>;
|
|
61
62
|
}, z.core.$strip>>;
|
|
63
|
+
materialPreset: z.ZodOptional<z.ZodString>;
|
|
62
64
|
position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
63
65
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
64
66
|
segmentType: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stair-segment.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/stair-segment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,gBAAgB;;;EAA+B,CAAA;AAE5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,cAAc;;;;EAAqC,CAAA;AAEhE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"stair-segment.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/stair-segment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,gBAAgB;;;EAA+B,CAAA;AAE5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,cAAc;;;;EAAqC,CAAA;AAEhE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsC5B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
|
|
@@ -8,6 +8,7 @@ export const StairSegmentNode = BaseNode.extend({
|
|
|
8
8
|
id: objectId('sseg'),
|
|
9
9
|
type: nodeType('stair-segment'),
|
|
10
10
|
material: MaterialSchema.optional(),
|
|
11
|
+
materialPreset: z.string().optional(),
|
|
11
12
|
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
|
|
12
13
|
// Rotation around Y axis in radians
|
|
13
14
|
rotation: z.number().default(0),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type MaterialSchema } from '../material';
|
|
2
3
|
export declare const StairRailingMode: z.ZodEnum<{
|
|
3
|
-
none: "none";
|
|
4
4
|
left: "left";
|
|
5
5
|
right: "right";
|
|
6
|
+
none: "none";
|
|
6
7
|
both: "both";
|
|
7
8
|
}>;
|
|
8
9
|
export declare const StairType: z.ZodEnum<{
|
|
@@ -14,9 +15,19 @@ export declare const StairTopLandingMode: z.ZodEnum<{
|
|
|
14
15
|
none: "none";
|
|
15
16
|
integrated: "integrated";
|
|
16
17
|
}>;
|
|
18
|
+
export declare const StairSlabOpeningMode: z.ZodEnum<{
|
|
19
|
+
none: "none";
|
|
20
|
+
destination: "destination";
|
|
21
|
+
}>;
|
|
17
22
|
export type StairRailingMode = z.infer<typeof StairRailingMode>;
|
|
18
23
|
export type StairType = z.infer<typeof StairType>;
|
|
19
24
|
export type StairTopLandingMode = z.infer<typeof StairTopLandingMode>;
|
|
25
|
+
export type StairSlabOpeningMode = z.infer<typeof StairSlabOpeningMode>;
|
|
26
|
+
export type StairSurfaceMaterialRole = 'railing' | 'tread' | 'side';
|
|
27
|
+
export type StairSurfaceMaterialSpec = {
|
|
28
|
+
material?: MaterialSchema;
|
|
29
|
+
materialPreset?: string;
|
|
30
|
+
};
|
|
20
31
|
export declare const StairNode: z.ZodObject<{
|
|
21
32
|
object: z.ZodDefault<z.ZodLiteral<"node">>;
|
|
22
33
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -36,6 +47,73 @@ export declare const StairNode: z.ZodObject<{
|
|
|
36
47
|
id: z.ZodDefault<z.ZodTemplateLiteral<`stair_${string}`>>;
|
|
37
48
|
type: z.ZodDefault<z.ZodLiteral<"stair">>;
|
|
38
49
|
material: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
id: z.ZodOptional<z.ZodString>;
|
|
51
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
custom: "custom";
|
|
53
|
+
white: "white";
|
|
54
|
+
brick: "brick";
|
|
55
|
+
concrete: "concrete";
|
|
56
|
+
wood: "wood";
|
|
57
|
+
glass: "glass";
|
|
58
|
+
metal: "metal";
|
|
59
|
+
plaster: "plaster";
|
|
60
|
+
tile: "tile";
|
|
61
|
+
marble: "marble";
|
|
62
|
+
}>>;
|
|
63
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
color: z.ZodDefault<z.ZodString>;
|
|
65
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
66
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
67
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
68
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
70
|
+
front: "front";
|
|
71
|
+
back: "back";
|
|
72
|
+
double: "double";
|
|
73
|
+
}>>;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
url: z.ZodString;
|
|
77
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
78
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
materialPreset: z.ZodOptional<z.ZodString>;
|
|
82
|
+
railingMaterial: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
id: z.ZodOptional<z.ZodString>;
|
|
84
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
85
|
+
custom: "custom";
|
|
86
|
+
white: "white";
|
|
87
|
+
brick: "brick";
|
|
88
|
+
concrete: "concrete";
|
|
89
|
+
wood: "wood";
|
|
90
|
+
glass: "glass";
|
|
91
|
+
metal: "metal";
|
|
92
|
+
plaster: "plaster";
|
|
93
|
+
tile: "tile";
|
|
94
|
+
marble: "marble";
|
|
95
|
+
}>>;
|
|
96
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
color: z.ZodDefault<z.ZodString>;
|
|
98
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
99
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
100
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
101
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
102
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
103
|
+
front: "front";
|
|
104
|
+
back: "back";
|
|
105
|
+
double: "double";
|
|
106
|
+
}>>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
url: z.ZodString;
|
|
110
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
111
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
railingMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
115
|
+
treadMaterial: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
id: z.ZodOptional<z.ZodString>;
|
|
39
117
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
40
118
|
custom: "custom";
|
|
41
119
|
white: "white";
|
|
@@ -66,6 +144,40 @@ export declare const StairNode: z.ZodObject<{
|
|
|
66
144
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
67
145
|
}, z.core.$strip>>;
|
|
68
146
|
}, z.core.$strip>>;
|
|
147
|
+
treadMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
148
|
+
sideMaterial: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
id: z.ZodOptional<z.ZodString>;
|
|
150
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
151
|
+
custom: "custom";
|
|
152
|
+
white: "white";
|
|
153
|
+
brick: "brick";
|
|
154
|
+
concrete: "concrete";
|
|
155
|
+
wood: "wood";
|
|
156
|
+
glass: "glass";
|
|
157
|
+
metal: "metal";
|
|
158
|
+
plaster: "plaster";
|
|
159
|
+
tile: "tile";
|
|
160
|
+
marble: "marble";
|
|
161
|
+
}>>;
|
|
162
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
163
|
+
color: z.ZodDefault<z.ZodString>;
|
|
164
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
165
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
166
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
167
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
168
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
169
|
+
front: "front";
|
|
170
|
+
back: "back";
|
|
171
|
+
double: "double";
|
|
172
|
+
}>>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
175
|
+
url: z.ZodString;
|
|
176
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
177
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
sideMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
69
181
|
position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
70
182
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
71
183
|
stairType: z.ZodDefault<z.ZodEnum<{
|
|
@@ -73,6 +185,13 @@ export declare const StairNode: z.ZodObject<{
|
|
|
73
185
|
curved: "curved";
|
|
74
186
|
spiral: "spiral";
|
|
75
187
|
}>>;
|
|
188
|
+
fromLevelId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
189
|
+
toLevelId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
190
|
+
slabOpeningMode: z.ZodDefault<z.ZodEnum<{
|
|
191
|
+
none: "none";
|
|
192
|
+
destination: "destination";
|
|
193
|
+
}>>;
|
|
194
|
+
openingOffset: z.ZodDefault<z.ZodNumber>;
|
|
76
195
|
width: z.ZodDefault<z.ZodNumber>;
|
|
77
196
|
totalRise: z.ZodDefault<z.ZodNumber>;
|
|
78
197
|
stepCount: z.ZodDefault<z.ZodNumber>;
|
|
@@ -88,13 +207,14 @@ export declare const StairNode: z.ZodObject<{
|
|
|
88
207
|
showCenterColumn: z.ZodDefault<z.ZodBoolean>;
|
|
89
208
|
showStepSupports: z.ZodDefault<z.ZodBoolean>;
|
|
90
209
|
railingMode: z.ZodDefault<z.ZodEnum<{
|
|
91
|
-
none: "none";
|
|
92
210
|
left: "left";
|
|
93
211
|
right: "right";
|
|
212
|
+
none: "none";
|
|
94
213
|
both: "both";
|
|
95
214
|
}>>;
|
|
96
215
|
railingHeight: z.ZodDefault<z.ZodNumber>;
|
|
97
216
|
children: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodTemplateLiteral<`sseg_${string}`>>>>;
|
|
98
217
|
}, z.core.$strip>;
|
|
99
218
|
export type StairNode = z.infer<typeof StairNode>;
|
|
219
|
+
export declare function getEffectiveStairSurfaceMaterial(node: StairNode, role: StairSurfaceMaterialRole): StairSurfaceMaterialSpec;
|
|
100
220
|
//# sourceMappingURL=stair.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stair.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/stair.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"stair.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/stair.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,KAAK,cAAc,EAA0C,MAAM,aAAa,CAAA;AAGzF,eAAO,MAAM,gBAAgB;;;;;EAA4C,CAAA;AACzE,eAAO,MAAM,SAAS;;;;EAA2C,CAAA;AACjE,eAAO,MAAM,mBAAmB;;;EAAiC,CAAA;AACjE,eAAO,MAAM,oBAAoB;;;EAAkC,CAAA;AAEnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAC/D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AACjD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AACrE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACvE,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AACnE,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4DrB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AASjD,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,wBAAwB,GAC7B,wBAAwB,CA2D1B"}
|
|
@@ -1,19 +1,31 @@
|
|
|
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 { StairSegmentNode } from './stair-segment';
|
|
6
6
|
export const StairRailingMode = z.enum(['none', 'left', 'right', 'both']);
|
|
7
7
|
export const StairType = z.enum(['straight', 'curved', 'spiral']);
|
|
8
8
|
export const StairTopLandingMode = z.enum(['none', 'integrated']);
|
|
9
|
+
export const StairSlabOpeningMode = z.enum(['none', 'destination']);
|
|
9
10
|
export const StairNode = BaseNode.extend({
|
|
10
11
|
id: objectId('stair'),
|
|
11
12
|
type: nodeType('stair'),
|
|
12
|
-
material:
|
|
13
|
+
material: MaterialSchemaSchema.optional(),
|
|
14
|
+
materialPreset: z.string().optional(),
|
|
15
|
+
railingMaterial: MaterialSchemaSchema.optional(),
|
|
16
|
+
railingMaterialPreset: z.string().optional(),
|
|
17
|
+
treadMaterial: MaterialSchemaSchema.optional(),
|
|
18
|
+
treadMaterialPreset: z.string().optional(),
|
|
19
|
+
sideMaterial: MaterialSchemaSchema.optional(),
|
|
20
|
+
sideMaterialPreset: z.string().optional(),
|
|
13
21
|
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
|
|
14
22
|
// Rotation around Y axis in radians
|
|
15
23
|
rotation: z.number().default(0),
|
|
16
24
|
stairType: StairType.default('straight'),
|
|
25
|
+
fromLevelId: z.string().nullable().default(null),
|
|
26
|
+
toLevelId: z.string().nullable().default(null),
|
|
27
|
+
slabOpeningMode: StairSlabOpeningMode.default('none'),
|
|
28
|
+
openingOffset: z.number().default(0),
|
|
17
29
|
width: z.number().default(1.0),
|
|
18
30
|
totalRise: z.number().default(2.5),
|
|
19
31
|
stepCount: z.number().default(10),
|
|
@@ -36,6 +48,9 @@ export const StairNode = BaseNode.extend({
|
|
|
36
48
|
- position: center position of the stair group
|
|
37
49
|
- rotation: rotation around Y axis
|
|
38
50
|
- stairType: straight (segment-based), curved (arc-based), or spiral
|
|
51
|
+
- fromLevelId / toLevelId: source and destination levels used for auto slab cutouts
|
|
52
|
+
- slabOpeningMode: whether a destination-level slab opening is generated for this stair
|
|
53
|
+
- openingOffset: extra opening expansion applied after the cutout polygon is computed
|
|
39
54
|
- width: stair width
|
|
40
55
|
- totalRise: total stair height
|
|
41
56
|
- stepCount: number of visible steps
|
|
@@ -51,3 +66,58 @@ export const StairNode = BaseNode.extend({
|
|
|
51
66
|
- railingHeight: top height of the railing above the stair surface
|
|
52
67
|
- children: array of StairSegmentNode IDs for straight stairs
|
|
53
68
|
`);
|
|
69
|
+
function getLegacyStairSurfaceMaterial(node) {
|
|
70
|
+
return {
|
|
71
|
+
material: node.material,
|
|
72
|
+
materialPreset: node.materialPreset,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function getEffectiveStairSurfaceMaterial(node, role) {
|
|
76
|
+
if (role === 'railing') {
|
|
77
|
+
if (node.railingMaterial !== undefined || typeof node.railingMaterialPreset === 'string') {
|
|
78
|
+
return {
|
|
79
|
+
material: node.railingMaterial,
|
|
80
|
+
materialPreset: typeof node.railingMaterialPreset === 'string' ? node.railingMaterialPreset : undefined,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (role === 'tread') {
|
|
85
|
+
if (node.treadMaterial !== undefined || typeof node.treadMaterialPreset === 'string') {
|
|
86
|
+
return {
|
|
87
|
+
material: node.treadMaterial,
|
|
88
|
+
materialPreset: typeof node.treadMaterialPreset === 'string' ? node.treadMaterialPreset : undefined,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (role === 'side') {
|
|
93
|
+
if (node.sideMaterial !== undefined || typeof node.sideMaterialPreset === 'string') {
|
|
94
|
+
return {
|
|
95
|
+
material: node.sideMaterial,
|
|
96
|
+
materialPreset: typeof node.sideMaterialPreset === 'string' ? node.sideMaterialPreset : undefined,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const treadFallback = {
|
|
101
|
+
material: node.treadMaterial,
|
|
102
|
+
materialPreset: typeof node.treadMaterialPreset === 'string' ? node.treadMaterialPreset : undefined,
|
|
103
|
+
};
|
|
104
|
+
const sideFallback = {
|
|
105
|
+
material: node.sideMaterial,
|
|
106
|
+
materialPreset: typeof node.sideMaterialPreset === 'string' ? node.sideMaterialPreset : undefined,
|
|
107
|
+
};
|
|
108
|
+
if (role === 'tread' && (sideFallback.material !== undefined || sideFallback.materialPreset !== undefined)) {
|
|
109
|
+
return sideFallback;
|
|
110
|
+
}
|
|
111
|
+
if (role === 'side' && (treadFallback.material !== undefined || treadFallback.materialPreset !== undefined)) {
|
|
112
|
+
return treadFallback;
|
|
113
|
+
}
|
|
114
|
+
if (role === 'railing') {
|
|
115
|
+
if (treadFallback.material !== undefined || treadFallback.materialPreset !== undefined) {
|
|
116
|
+
return treadFallback;
|
|
117
|
+
}
|
|
118
|
+
if (sideFallback.material !== undefined || sideFallback.materialPreset !== undefined) {
|
|
119
|
+
return sideFallback;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return getLegacyStairSurfaceMaterial(node);
|
|
123
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SurfaceHoleMetadata: z.ZodObject<{
|
|
3
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
4
|
+
stair: "stair";
|
|
5
|
+
manual: "manual";
|
|
6
|
+
}>>;
|
|
7
|
+
stairId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type SurfaceHoleMetadata = z.infer<typeof SurfaceHoleMetadata>;
|
|
10
|
+
//# sourceMappingURL=surface-hole-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-hole-metadata.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/surface-hole-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,mBAAmB;;;;;;iBAG9B,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { MaterialSchema } from '../material';
|
|
2
3
|
export declare const WallNode: z.ZodObject<{
|
|
3
4
|
object: z.ZodDefault<z.ZodLiteral<"node">>;
|
|
4
5
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -17,8 +18,9 @@ export declare const WallNode: z.ZodObject<{
|
|
|
17
18
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
|
|
18
19
|
id: z.ZodDefault<z.ZodTemplateLiteral<`wall_${string}`>>;
|
|
19
20
|
type: z.ZodDefault<z.ZodLiteral<"wall">>;
|
|
20
|
-
children: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodTemplateLiteral<`item_${string}
|
|
21
|
+
children: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodDefault<z.ZodTemplateLiteral<`item_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`door_${string}`>>, z.ZodDefault<z.ZodTemplateLiteral<`window_${string}`>>]>>>;
|
|
21
22
|
material: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
id: z.ZodOptional<z.ZodString>;
|
|
22
24
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
23
25
|
custom: "custom";
|
|
24
26
|
white: "white";
|
|
@@ -49,8 +51,76 @@ export declare const WallNode: z.ZodObject<{
|
|
|
49
51
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
50
52
|
}, z.core.$strip>>;
|
|
51
53
|
}, z.core.$strip>>;
|
|
54
|
+
materialPreset: z.ZodOptional<z.ZodString>;
|
|
55
|
+
interiorMaterial: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
id: z.ZodOptional<z.ZodString>;
|
|
57
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
58
|
+
custom: "custom";
|
|
59
|
+
white: "white";
|
|
60
|
+
brick: "brick";
|
|
61
|
+
concrete: "concrete";
|
|
62
|
+
wood: "wood";
|
|
63
|
+
glass: "glass";
|
|
64
|
+
metal: "metal";
|
|
65
|
+
plaster: "plaster";
|
|
66
|
+
tile: "tile";
|
|
67
|
+
marble: "marble";
|
|
68
|
+
}>>;
|
|
69
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
color: z.ZodDefault<z.ZodString>;
|
|
71
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
72
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
73
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
74
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
75
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
76
|
+
front: "front";
|
|
77
|
+
back: "back";
|
|
78
|
+
double: "double";
|
|
79
|
+
}>>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
url: z.ZodString;
|
|
83
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
84
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
interiorMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
88
|
+
exteriorMaterial: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
id: z.ZodOptional<z.ZodString>;
|
|
90
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
91
|
+
custom: "custom";
|
|
92
|
+
white: "white";
|
|
93
|
+
brick: "brick";
|
|
94
|
+
concrete: "concrete";
|
|
95
|
+
wood: "wood";
|
|
96
|
+
glass: "glass";
|
|
97
|
+
metal: "metal";
|
|
98
|
+
plaster: "plaster";
|
|
99
|
+
tile: "tile";
|
|
100
|
+
marble: "marble";
|
|
101
|
+
}>>;
|
|
102
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
color: z.ZodDefault<z.ZodString>;
|
|
104
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
105
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
106
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
107
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
108
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
109
|
+
front: "front";
|
|
110
|
+
back: "back";
|
|
111
|
+
double: "double";
|
|
112
|
+
}>>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
url: z.ZodString;
|
|
116
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
117
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
exteriorMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
52
121
|
thickness: z.ZodOptional<z.ZodNumber>;
|
|
53
122
|
height: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
curveOffset: z.ZodOptional<z.ZodNumber>;
|
|
54
124
|
start: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
55
125
|
end: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
56
126
|
frontSide: z.ZodDefault<z.ZodEnum<{
|
|
@@ -65,4 +135,20 @@ export declare const WallNode: z.ZodObject<{
|
|
|
65
135
|
}>>;
|
|
66
136
|
}, z.core.$strip>;
|
|
67
137
|
export type WallNode = z.infer<typeof WallNode>;
|
|
138
|
+
export type WallSurfaceSide = 'interior' | 'exterior';
|
|
139
|
+
export type WallSurfaceMaterialSpec = {
|
|
140
|
+
material?: z.infer<typeof MaterialSchema>;
|
|
141
|
+
materialPreset?: string;
|
|
142
|
+
};
|
|
143
|
+
type WallSurfaceMaterialSource = {
|
|
144
|
+
material?: z.infer<typeof MaterialSchema>;
|
|
145
|
+
materialPreset?: string;
|
|
146
|
+
interiorMaterial?: z.infer<typeof MaterialSchema>;
|
|
147
|
+
interiorMaterialPreset?: string;
|
|
148
|
+
exteriorMaterial?: z.infer<typeof MaterialSchema>;
|
|
149
|
+
exteriorMaterialPreset?: string;
|
|
150
|
+
};
|
|
151
|
+
export declare function getEffectiveWallSurfaceMaterial(wall: WallSurfaceMaterialSource, side: WallSurfaceSide): WallSurfaceMaterialSpec;
|
|
152
|
+
export declare function getWallSurfaceMaterialSignature(spec: WallSurfaceMaterialSpec): string;
|
|
153
|
+
export {};
|
|
68
154
|
//# sourceMappingURL=wall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wall.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/wall.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"wall.d.ts","sourceRoot":"","sources":["../../../src/schema/nodes/wall.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAK5C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmCpB,CAAA;AACD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,UAAU,CAAA;AAErD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;IACjD,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;IACjD,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAChC,CAAA;AAuBD,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,yBAAyB,EAC/B,IAAI,EAAE,eAAe,GACpB,uBAAuB,CAUzB;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,uBAAuB,GAAG,MAAM,CAKrF"}
|
|
@@ -2,17 +2,26 @@ 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
|
+
import { DoorNode } from './door';
|
|
5
6
|
import { ItemNode } from './item';
|
|
6
|
-
|
|
7
|
-
// import { ItemNode } from "./item";
|
|
8
|
-
// import { WindowNode } from "./window";
|
|
7
|
+
import { WindowNode } from './window';
|
|
9
8
|
export const WallNode = BaseNode.extend({
|
|
10
9
|
id: objectId('wall'),
|
|
11
10
|
type: nodeType('wall'),
|
|
12
|
-
children: z
|
|
11
|
+
children: z
|
|
12
|
+
.array(z.union([ItemNode.shape.id, DoorNode.shape.id, WindowNode.shape.id]))
|
|
13
|
+
.default([]),
|
|
14
|
+
// Legacy single-material wall finish. Read for backward compatibility only.
|
|
13
15
|
material: MaterialSchema.optional(),
|
|
16
|
+
// Legacy single-material wall finish preset. Read for backward compatibility only.
|
|
17
|
+
materialPreset: z.string().optional(),
|
|
18
|
+
interiorMaterial: MaterialSchema.optional(),
|
|
19
|
+
interiorMaterialPreset: z.string().optional(),
|
|
20
|
+
exteriorMaterial: MaterialSchema.optional(),
|
|
21
|
+
exteriorMaterialPreset: z.string().optional(),
|
|
14
22
|
thickness: z.number().optional(),
|
|
15
23
|
height: z.number().optional(),
|
|
24
|
+
curveOffset: z.number().optional(),
|
|
16
25
|
// e.g., start/end points for path
|
|
17
26
|
start: z.tuple([z.number(), z.number()]),
|
|
18
27
|
end: z.tuple([z.number(), z.number()]),
|
|
@@ -23,9 +32,41 @@ export const WallNode = BaseNode.extend({
|
|
|
23
32
|
Wall node - used to represent a wall in the building
|
|
24
33
|
- thickness: thickness in meters
|
|
25
34
|
- height: height in meters
|
|
35
|
+
- curveOffset: midpoint sagitta offset used to bend the wall into an arc
|
|
26
36
|
- start: start point of the wall in level coordinate system
|
|
27
37
|
- end: end point of the wall in level coordinate system
|
|
28
38
|
- size: size of the wall in grid units
|
|
29
39
|
- frontSide: whether the front side faces interior, exterior, or unknown
|
|
30
40
|
- backSide: whether the back side faces interior, exterior, or unknown
|
|
31
41
|
`);
|
|
42
|
+
function getConfiguredWallSurfaceMaterial(wall, side) {
|
|
43
|
+
if (side === 'interior') {
|
|
44
|
+
return {
|
|
45
|
+
material: wall.interiorMaterial,
|
|
46
|
+
materialPreset: wall.interiorMaterialPreset,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
material: wall.exteriorMaterial,
|
|
51
|
+
materialPreset: wall.exteriorMaterialPreset,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function hasSurfaceMaterial(spec) {
|
|
55
|
+
return spec.material !== undefined || typeof spec.materialPreset === 'string';
|
|
56
|
+
}
|
|
57
|
+
export function getEffectiveWallSurfaceMaterial(wall, side) {
|
|
58
|
+
const configured = getConfiguredWallSurfaceMaterial(wall, side);
|
|
59
|
+
if (hasSurfaceMaterial(configured)) {
|
|
60
|
+
return configured;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
material: wall.material,
|
|
64
|
+
materialPreset: wall.materialPreset,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export function getWallSurfaceMaterialSignature(spec) {
|
|
68
|
+
return JSON.stringify({
|
|
69
|
+
material: spec.material ?? null,
|
|
70
|
+
materialPreset: spec.materialPreset ?? null,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
@@ -18,6 +18,7 @@ export declare const WindowNode: z.ZodObject<{
|
|
|
18
18
|
id: z.ZodDefault<z.ZodTemplateLiteral<`window_${string}`>>;
|
|
19
19
|
type: z.ZodDefault<z.ZodLiteral<"window">>;
|
|
20
20
|
material: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
id: z.ZodOptional<z.ZodString>;
|
|
21
22
|
preset: z.ZodOptional<z.ZodEnum<{
|
|
22
23
|
custom: "custom";
|
|
23
24
|
white: "white";
|
|
@@ -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
|
|
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"}
|