@pascal-app/core 0.3.0 → 0.3.2
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/schema/index.d.ts +2 -1
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +3 -1
- package/dist/schema/material.d.ts +62 -0
- package/dist/schema/material.d.ts.map +1 -0
- package/dist/schema/material.js +130 -0
- package/dist/schema/nodes/ceiling.d.ts +31 -0
- package/dist/schema/nodes/ceiling.d.ts.map +1 -1
- package/dist/schema/nodes/ceiling.js +2 -2
- package/dist/schema/nodes/door.d.ts +33 -2
- package/dist/schema/nodes/door.d.ts.map +1 -1
- package/dist/schema/nodes/door.js +2 -0
- package/dist/schema/nodes/roof-segment.d.ts +31 -0
- package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment.js +2 -1
- package/dist/schema/nodes/roof.d.ts +31 -0
- package/dist/schema/nodes/roof.d.ts.map +1 -1
- package/dist/schema/nodes/roof.js +2 -1
- package/dist/schema/nodes/slab.d.ts +31 -0
- package/dist/schema/nodes/slab.d.ts.map +1 -1
- package/dist/schema/nodes/slab.js +2 -2
- package/dist/schema/nodes/wall.d.ts +31 -0
- package/dist/schema/nodes/wall.d.ts.map +1 -1
- package/dist/schema/nodes/wall.js +2 -1
- package/dist/schema/nodes/window.d.ts +31 -0
- package/dist/schema/nodes/window.d.ts.map +1 -1
- package/dist/schema/nodes/window.js +2 -1
- package/dist/schema/types.d.ts +218 -1
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/store/actions/node-actions.d.ts.map +1 -1
- package/dist/store/actions/node-actions.js +43 -12
- package/dist/store/use-scene.d.ts +5 -0
- package/dist/store/use-scene.d.ts.map +1 -1
- package/dist/store/use-scene.js +14 -2
- package/dist/systems/wall/wall-system.d.ts.map +1 -1
- package/dist/systems/wall/wall-system.js +0 -2
- package/dist/utils/clone-scene-graph.d.ts +18 -0
- package/dist/utils/clone-scene-graph.d.ts.map +1 -0
- package/dist/utils/clone-scene-graph.js +96 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -18,5 +18,6 @@ export { DEFAULT_WALL_HEIGHT, DEFAULT_WALL_THICKNESS, getWallPlanFootprint, getW
|
|
|
18
18
|
export { calculateLevelMiters, type Point2D, pointToKey, type WallMiterData, } from './systems/wall/wall-mitering';
|
|
19
19
|
export { WallSystem } from './systems/wall/wall-system';
|
|
20
20
|
export { WindowSystem } from './systems/window/window-system';
|
|
21
|
+
export { cloneSceneGraph } from './utils/clone-scene-graph';
|
|
21
22
|
export { isObject } from './utils/types';
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,GACV,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAErD,OAAO,EACL,aAAa,EACb,WAAW,GACZ,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAA;AAC9F,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAExE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,KAAK,EACV,iBAAiB,GAClB,MAAM,uBAAuB,CAAA;AAE9B,cAAc,UAAU,CAAA;AACxB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,cAAc,GACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,oBAAoB,EACpB,KAAK,OAAO,EACZ,UAAU,EACV,KAAK,aAAa,GACnB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,GACV,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAErD,OAAO,EACL,aAAa,EACb,WAAW,GACZ,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAA;AAC9F,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAExE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,KAAK,EACV,iBAAiB,GAClB,MAAM,uBAAuB,CAAA;AAE9B,cAAc,UAAU,CAAA;AACxB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,cAAc,GACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,oBAAoB,EACpB,KAAK,OAAO,EACZ,UAAU,EACV,KAAK,aAAa,GACnB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -24,4 +24,5 @@ export { DEFAULT_WALL_HEIGHT, DEFAULT_WALL_THICKNESS, getWallPlanFootprint, getW
|
|
|
24
24
|
export { calculateLevelMiters, pointToKey, } from './systems/wall/wall-mitering';
|
|
25
25
|
export { WallSystem } from './systems/wall/wall-system';
|
|
26
26
|
export { WindowSystem } from './systems/window/window-system';
|
|
27
|
+
export { cloneSceneGraph } from './utils/clone-scene-graph';
|
|
27
28
|
export { isObject } from './utils/types';
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { BaseNode, generateId,
|
|
1
|
+
export { BaseNode, generateId, 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
5
|
export { BuildingNode } from './nodes/building';
|
|
5
6
|
export { CeilingNode } from './nodes/ceiling';
|
|
6
7
|
export { DoorNode, DoorSegment } from './nodes/door';
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAExF,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,YAAY,EACV,eAAe,EACf,KAAK,EACL,UAAU,EACV,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/schema/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Base
|
|
2
|
-
export { BaseNode, generateId,
|
|
2
|
+
export { BaseNode, generateId, nodeType, objectId } from './base';
|
|
3
3
|
// Camera
|
|
4
4
|
export { CameraSchema } from './camera';
|
|
5
5
|
// Collections
|
|
6
6
|
export { generateCollectionId } from './collections';
|
|
7
|
+
// Material
|
|
8
|
+
export { DEFAULT_MATERIALS, MaterialPreset, MaterialProperties, MaterialSchema, resolveMaterial, } from './material';
|
|
7
9
|
export { BuildingNode } from './nodes/building';
|
|
8
10
|
export { CeilingNode } from './nodes/ceiling';
|
|
9
11
|
export { DoorNode, DoorSegment } from './nodes/door';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MaterialPreset: z.ZodEnum<{
|
|
3
|
+
custom: "custom";
|
|
4
|
+
white: "white";
|
|
5
|
+
brick: "brick";
|
|
6
|
+
concrete: "concrete";
|
|
7
|
+
wood: "wood";
|
|
8
|
+
glass: "glass";
|
|
9
|
+
metal: "metal";
|
|
10
|
+
plaster: "plaster";
|
|
11
|
+
tile: "tile";
|
|
12
|
+
marble: "marble";
|
|
13
|
+
}>;
|
|
14
|
+
export type MaterialPreset = z.infer<typeof MaterialPreset>;
|
|
15
|
+
export declare const MaterialProperties: z.ZodObject<{
|
|
16
|
+
color: z.ZodDefault<z.ZodString>;
|
|
17
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
22
|
+
front: "front";
|
|
23
|
+
back: "back";
|
|
24
|
+
double: "double";
|
|
25
|
+
}>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type MaterialProperties = z.infer<typeof MaterialProperties>;
|
|
28
|
+
export declare const MaterialSchema: z.ZodObject<{
|
|
29
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
custom: "custom";
|
|
31
|
+
white: "white";
|
|
32
|
+
brick: "brick";
|
|
33
|
+
concrete: "concrete";
|
|
34
|
+
wood: "wood";
|
|
35
|
+
glass: "glass";
|
|
36
|
+
metal: "metal";
|
|
37
|
+
plaster: "plaster";
|
|
38
|
+
tile: "tile";
|
|
39
|
+
marble: "marble";
|
|
40
|
+
}>>;
|
|
41
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
color: z.ZodDefault<z.ZodString>;
|
|
43
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
44
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
46
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
48
|
+
front: "front";
|
|
49
|
+
back: "back";
|
|
50
|
+
double: "double";
|
|
51
|
+
}>>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
url: z.ZodString;
|
|
55
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
56
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export type MaterialSchema = z.infer<typeof MaterialSchema>;
|
|
60
|
+
export declare const DEFAULT_MATERIALS: Record<MaterialPreset, MaterialProperties>;
|
|
61
|
+
export declare function resolveMaterial(material?: MaterialSchema): MaterialProperties;
|
|
62
|
+
//# sourceMappingURL=material.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUzB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAiFxE,CAAA;AAED,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,kBAAkB,CAiB7E"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const MaterialPreset = z.enum([
|
|
3
|
+
'white',
|
|
4
|
+
'brick',
|
|
5
|
+
'concrete',
|
|
6
|
+
'wood',
|
|
7
|
+
'glass',
|
|
8
|
+
'metal',
|
|
9
|
+
'plaster',
|
|
10
|
+
'tile',
|
|
11
|
+
'marble',
|
|
12
|
+
'custom',
|
|
13
|
+
]);
|
|
14
|
+
export const MaterialProperties = z.object({
|
|
15
|
+
color: z.string().default('#ffffff'),
|
|
16
|
+
roughness: z.number().min(0).max(1).default(0.5),
|
|
17
|
+
metalness: z.number().min(0).max(1).default(0),
|
|
18
|
+
opacity: z.number().min(0).max(1).default(1),
|
|
19
|
+
transparent: z.boolean().default(false),
|
|
20
|
+
side: z.enum(['front', 'back', 'double']).default('front'),
|
|
21
|
+
});
|
|
22
|
+
export const MaterialSchema = z.object({
|
|
23
|
+
preset: MaterialPreset.optional(),
|
|
24
|
+
properties: MaterialProperties.optional(),
|
|
25
|
+
texture: z
|
|
26
|
+
.object({
|
|
27
|
+
url: z.string(),
|
|
28
|
+
repeat: z.tuple([z.number(), z.number()]).optional(),
|
|
29
|
+
scale: z.number().optional(),
|
|
30
|
+
})
|
|
31
|
+
.optional(),
|
|
32
|
+
});
|
|
33
|
+
export const DEFAULT_MATERIALS = {
|
|
34
|
+
white: {
|
|
35
|
+
color: '#ffffff',
|
|
36
|
+
roughness: 0.9,
|
|
37
|
+
metalness: 0,
|
|
38
|
+
opacity: 1,
|
|
39
|
+
transparent: false,
|
|
40
|
+
side: 'front',
|
|
41
|
+
},
|
|
42
|
+
brick: {
|
|
43
|
+
color: '#8b4513',
|
|
44
|
+
roughness: 0.85,
|
|
45
|
+
metalness: 0,
|
|
46
|
+
opacity: 1,
|
|
47
|
+
transparent: false,
|
|
48
|
+
side: 'front',
|
|
49
|
+
},
|
|
50
|
+
concrete: {
|
|
51
|
+
color: '#808080',
|
|
52
|
+
roughness: 0.8,
|
|
53
|
+
metalness: 0,
|
|
54
|
+
opacity: 1,
|
|
55
|
+
transparent: false,
|
|
56
|
+
side: 'front',
|
|
57
|
+
},
|
|
58
|
+
wood: {
|
|
59
|
+
color: '#deb887',
|
|
60
|
+
roughness: 0.7,
|
|
61
|
+
metalness: 0,
|
|
62
|
+
opacity: 1,
|
|
63
|
+
transparent: false,
|
|
64
|
+
side: 'front',
|
|
65
|
+
},
|
|
66
|
+
glass: {
|
|
67
|
+
color: '#87ceeb',
|
|
68
|
+
roughness: 0.1,
|
|
69
|
+
metalness: 0.1,
|
|
70
|
+
opacity: 0.3,
|
|
71
|
+
transparent: true,
|
|
72
|
+
side: 'double',
|
|
73
|
+
},
|
|
74
|
+
metal: {
|
|
75
|
+
color: '#c0c0c0',
|
|
76
|
+
roughness: 0.3,
|
|
77
|
+
metalness: 0.9,
|
|
78
|
+
opacity: 1,
|
|
79
|
+
transparent: false,
|
|
80
|
+
side: 'front',
|
|
81
|
+
},
|
|
82
|
+
plaster: {
|
|
83
|
+
color: '#f5f5dc',
|
|
84
|
+
roughness: 0.95,
|
|
85
|
+
metalness: 0,
|
|
86
|
+
opacity: 1,
|
|
87
|
+
transparent: false,
|
|
88
|
+
side: 'front',
|
|
89
|
+
},
|
|
90
|
+
tile: {
|
|
91
|
+
color: '#d3d3d3',
|
|
92
|
+
roughness: 0.4,
|
|
93
|
+
metalness: 0.1,
|
|
94
|
+
opacity: 1,
|
|
95
|
+
transparent: false,
|
|
96
|
+
side: 'front',
|
|
97
|
+
},
|
|
98
|
+
marble: {
|
|
99
|
+
color: '#fafafa',
|
|
100
|
+
roughness: 0.2,
|
|
101
|
+
metalness: 0.1,
|
|
102
|
+
opacity: 1,
|
|
103
|
+
transparent: false,
|
|
104
|
+
side: 'front',
|
|
105
|
+
},
|
|
106
|
+
custom: {
|
|
107
|
+
color: '#ffffff',
|
|
108
|
+
roughness: 0.5,
|
|
109
|
+
metalness: 0,
|
|
110
|
+
opacity: 1,
|
|
111
|
+
transparent: false,
|
|
112
|
+
side: 'front',
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
export function resolveMaterial(material) {
|
|
116
|
+
if (!material) {
|
|
117
|
+
return DEFAULT_MATERIALS.white;
|
|
118
|
+
}
|
|
119
|
+
if (material.preset && material.preset !== 'custom') {
|
|
120
|
+
const presetProps = DEFAULT_MATERIALS[material.preset];
|
|
121
|
+
return {
|
|
122
|
+
...presetProps,
|
|
123
|
+
...material.properties,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
...DEFAULT_MATERIALS.custom,
|
|
128
|
+
...material.properties,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
@@ -18,6 +18,37 @@ export declare const CeilingNode: z.ZodObject<{
|
|
|
18
18
|
id: z.ZodDefault<z.ZodTemplateLiteral<`ceiling_${string}`>>;
|
|
19
19
|
type: z.ZodDefault<z.ZodLiteral<"ceiling">>;
|
|
20
20
|
children: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodTemplateLiteral<`item_${string}`>>>>;
|
|
21
|
+
material: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
custom: "custom";
|
|
24
|
+
white: "white";
|
|
25
|
+
brick: "brick";
|
|
26
|
+
concrete: "concrete";
|
|
27
|
+
wood: "wood";
|
|
28
|
+
glass: "glass";
|
|
29
|
+
metal: "metal";
|
|
30
|
+
plaster: "plaster";
|
|
31
|
+
tile: "tile";
|
|
32
|
+
marble: "marble";
|
|
33
|
+
}>>;
|
|
34
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
color: z.ZodDefault<z.ZodString>;
|
|
36
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
39
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
41
|
+
front: "front";
|
|
42
|
+
back: "back";
|
|
43
|
+
double: "double";
|
|
44
|
+
}>>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
url: z.ZodString;
|
|
48
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
49
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
21
52
|
polygon: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
22
53
|
holes: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>>;
|
|
23
54
|
height: z.ZodDefault<z.ZodNumber>;
|
|
@@ -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;AAKvB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAcvB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
import { ItemNode } from './item';
|
|
5
6
|
export const CeilingNode = BaseNode.extend({
|
|
6
7
|
id: objectId('ceiling'),
|
|
7
8
|
type: nodeType('ceiling'),
|
|
8
9
|
children: z.array(ItemNode.shape.id).default([]),
|
|
9
|
-
|
|
10
|
-
// Polygon boundary - array of [x, z] coordinates defining the ceiling
|
|
10
|
+
material: MaterialSchema.optional(),
|
|
11
11
|
polygon: z.array(z.tuple([z.number(), z.number()])),
|
|
12
12
|
holes: z.array(z.array(z.tuple([z.number(), z.number()]))).default([]),
|
|
13
13
|
height: z.number().default(2.5), // Height in meters
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const DoorSegment: z.ZodObject<{
|
|
3
3
|
type: z.ZodEnum<{
|
|
4
|
-
panel: "panel";
|
|
5
4
|
glass: "glass";
|
|
5
|
+
panel: "panel";
|
|
6
6
|
empty: "empty";
|
|
7
7
|
}>;
|
|
8
8
|
heightRatio: z.ZodNumber;
|
|
@@ -30,6 +30,37 @@ export declare const DoorNode: z.ZodObject<{
|
|
|
30
30
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
|
|
31
31
|
id: z.ZodDefault<z.ZodTemplateLiteral<`door_${string}`>>;
|
|
32
32
|
type: z.ZodDefault<z.ZodLiteral<"door">>;
|
|
33
|
+
material: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
custom: "custom";
|
|
36
|
+
white: "white";
|
|
37
|
+
brick: "brick";
|
|
38
|
+
concrete: "concrete";
|
|
39
|
+
wood: "wood";
|
|
40
|
+
glass: "glass";
|
|
41
|
+
metal: "metal";
|
|
42
|
+
plaster: "plaster";
|
|
43
|
+
tile: "tile";
|
|
44
|
+
marble: "marble";
|
|
45
|
+
}>>;
|
|
46
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
color: z.ZodDefault<z.ZodString>;
|
|
48
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
49
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
50
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
51
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
53
|
+
front: "front";
|
|
54
|
+
back: "back";
|
|
55
|
+
double: "double";
|
|
56
|
+
}>>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
url: z.ZodString;
|
|
60
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
61
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
}, z.core.$strip>>;
|
|
33
64
|
position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
34
65
|
rotation: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
35
66
|
side: z.ZodOptional<z.ZodEnum<{
|
|
@@ -53,8 +84,8 @@ export declare const DoorNode: z.ZodObject<{
|
|
|
53
84
|
}>>;
|
|
54
85
|
segments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
55
86
|
type: z.ZodEnum<{
|
|
56
|
-
panel: "panel";
|
|
57
87
|
glass: "glass";
|
|
88
|
+
panel: "panel";
|
|
58
89
|
empty: "empty";
|
|
59
90
|
}>;
|
|
60
91
|
heightRatio: z.ZodNumber;
|
|
@@ -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;
|
|
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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
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 DoorSegment = z.object({
|
|
5
6
|
type: z.enum(['panel', 'glass', 'empty']),
|
|
6
7
|
heightRatio: z.number(),
|
|
@@ -14,6 +15,7 @@ export const DoorSegment = z.object({
|
|
|
14
15
|
export const DoorNode = BaseNode.extend({
|
|
15
16
|
id: objectId('door'),
|
|
16
17
|
type: nodeType('door'),
|
|
18
|
+
material: MaterialSchema.optional(),
|
|
17
19
|
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
|
|
18
20
|
rotation: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
|
|
19
21
|
side: z.enum(['front', 'back']).optional(),
|
|
@@ -27,6 +27,37 @@ export declare const RoofSegmentNode: z.ZodObject<{
|
|
|
27
27
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
|
|
28
28
|
id: z.ZodDefault<z.ZodTemplateLiteral<`rseg_${string}`>>;
|
|
29
29
|
type: z.ZodDefault<z.ZodLiteral<"roof-segment">>;
|
|
30
|
+
material: z.ZodOptional<z.ZodObject<{
|
|
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>>;
|
|
30
61
|
position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
31
62
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
32
63
|
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;
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC3B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
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 RoofType = z.enum(['hip', 'gable', 'shed', 'gambrel', 'dutch', 'mansard', 'flat']);
|
|
5
6
|
export const RoofSegmentNode = BaseNode.extend({
|
|
6
7
|
id: objectId('rseg'),
|
|
7
8
|
type: nodeType('roof-segment'),
|
|
8
|
-
|
|
9
|
+
material: MaterialSchema.optional(),
|
|
9
10
|
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
|
|
10
11
|
// Rotation around Y axis in radians
|
|
11
12
|
rotation: z.number().default(0),
|
|
@@ -17,6 +17,37 @@ export declare const RoofNode: z.ZodObject<{
|
|
|
17
17
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
|
|
18
18
|
id: z.ZodDefault<z.ZodTemplateLiteral<`roof_${string}`>>;
|
|
19
19
|
type: z.ZodDefault<z.ZodLiteral<"roof">>;
|
|
20
|
+
material: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
custom: "custom";
|
|
23
|
+
white: "white";
|
|
24
|
+
brick: "brick";
|
|
25
|
+
concrete: "concrete";
|
|
26
|
+
wood: "wood";
|
|
27
|
+
glass: "glass";
|
|
28
|
+
metal: "metal";
|
|
29
|
+
plaster: "plaster";
|
|
30
|
+
tile: "tile";
|
|
31
|
+
marble: "marble";
|
|
32
|
+
}>>;
|
|
33
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
color: z.ZodDefault<z.ZodString>;
|
|
35
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
36
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
39
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
40
|
+
front: "front";
|
|
41
|
+
back: "back";
|
|
42
|
+
double: "double";
|
|
43
|
+
}>>;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
url: z.ZodString;
|
|
47
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
48
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
20
51
|
position: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
21
52
|
rotation: z.ZodDefault<z.ZodNumber>;
|
|
22
53
|
children: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodTemplateLiteral<`rseg_${string}`>>>>;
|
|
@@ -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;AAKvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBpB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
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
|
import { RoofSegmentNode } from './roof-segment';
|
|
5
6
|
export const RoofNode = BaseNode.extend({
|
|
6
7
|
id: objectId('roof'),
|
|
7
8
|
type: nodeType('roof'),
|
|
8
|
-
|
|
9
|
+
material: MaterialSchema.optional(),
|
|
9
10
|
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
|
|
10
11
|
// Rotation around Y axis in radians
|
|
11
12
|
rotation: z.number().default(0),
|
|
@@ -17,6 +17,37 @@ export declare const SlabNode: z.ZodObject<{
|
|
|
17
17
|
metadata: z.ZodDefault<z.ZodOptional<z.ZodJSONSchema>>;
|
|
18
18
|
id: z.ZodDefault<z.ZodTemplateLiteral<`slab_${string}`>>;
|
|
19
19
|
type: z.ZodDefault<z.ZodLiteral<"slab">>;
|
|
20
|
+
material: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
custom: "custom";
|
|
23
|
+
white: "white";
|
|
24
|
+
brick: "brick";
|
|
25
|
+
concrete: "concrete";
|
|
26
|
+
wood: "wood";
|
|
27
|
+
glass: "glass";
|
|
28
|
+
metal: "metal";
|
|
29
|
+
plaster: "plaster";
|
|
30
|
+
tile: "tile";
|
|
31
|
+
marble: "marble";
|
|
32
|
+
}>>;
|
|
33
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
color: z.ZodDefault<z.ZodString>;
|
|
35
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
36
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
39
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
40
|
+
front: "front";
|
|
41
|
+
back: "back";
|
|
42
|
+
double: "double";
|
|
43
|
+
}>>;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
url: z.ZodString;
|
|
47
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
48
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
20
51
|
polygon: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
21
52
|
holes: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>>;
|
|
22
53
|
elevation: z.ZodDefault<z.ZodNumber>;
|
|
@@ -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;AAIvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAapB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
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 SlabNode = BaseNode.extend({
|
|
5
6
|
id: objectId('slab'),
|
|
6
7
|
type: nodeType('slab'),
|
|
7
|
-
|
|
8
|
-
// Polygon boundary - array of [x, z] coordinates defining the slab
|
|
8
|
+
material: MaterialSchema.optional(),
|
|
9
9
|
polygon: z.array(z.tuple([z.number(), z.number()])),
|
|
10
10
|
holes: z.array(z.array(z.tuple([z.number(), z.number()]))).default([]),
|
|
11
11
|
elevation: z.number().default(0.05), // Elevation in meters
|
|
@@ -18,6 +18,37 @@ export declare const WallNode: z.ZodObject<{
|
|
|
18
18
|
id: z.ZodDefault<z.ZodTemplateLiteral<`wall_${string}`>>;
|
|
19
19
|
type: z.ZodDefault<z.ZodLiteral<"wall">>;
|
|
20
20
|
children: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodTemplateLiteral<`item_${string}`>>>>;
|
|
21
|
+
material: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
custom: "custom";
|
|
24
|
+
white: "white";
|
|
25
|
+
brick: "brick";
|
|
26
|
+
concrete: "concrete";
|
|
27
|
+
wood: "wood";
|
|
28
|
+
glass: "glass";
|
|
29
|
+
metal: "metal";
|
|
30
|
+
plaster: "plaster";
|
|
31
|
+
tile: "tile";
|
|
32
|
+
marble: "marble";
|
|
33
|
+
}>>;
|
|
34
|
+
properties: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
color: z.ZodDefault<z.ZodString>;
|
|
36
|
+
roughness: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
metalness: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
opacity: z.ZodDefault<z.ZodNumber>;
|
|
39
|
+
transparent: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
side: z.ZodDefault<z.ZodEnum<{
|
|
41
|
+
front: "front";
|
|
42
|
+
back: "back";
|
|
43
|
+
double: "double";
|
|
44
|
+
}>>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
texture: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
url: z.ZodString;
|
|
48
|
+
repeat: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
49
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
21
52
|
thickness: z.ZodOptional<z.ZodNumber>;
|
|
22
53
|
height: z.ZodOptional<z.ZodNumber>;
|
|
23
54
|
start: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
@@ -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;AAQvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBpB,CAAA;AACD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
import { ItemNode } from './item';
|
|
5
6
|
// import { DoorNode } from "./door";
|
|
6
7
|
// import { ItemNode } from "./item";
|
|
@@ -9,7 +10,7 @@ export const WallNode = BaseNode.extend({
|
|
|
9
10
|
id: objectId('wall'),
|
|
10
11
|
type: nodeType('wall'),
|
|
11
12
|
children: z.array(ItemNode.shape.id).default([]),
|
|
12
|
-
|
|
13
|
+
material: MaterialSchema.optional(),
|
|
13
14
|
thickness: z.number().optional(),
|
|
14
15
|
height: z.number().optional(),
|
|
15
16
|
// e.g., start/end points for path
|