@snaptrude/plugin-core 0.7.0 → 0.8.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/CHANGELOG.md +22 -0
- package/api-manifest.full.json +360 -19
- package/api-manifest.json +915 -37
- package/dist/api/core/camera/index.d.ts +208 -0
- package/dist/api/core/camera/index.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +105 -2
- package/dist/api/core/comment/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +13 -13
- package/dist/api/core/geom/delete/index.d.ts +8 -2
- package/dist/api/core/geom/delete/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +5 -5
- package/dist/api/core/geom/query/brep.d.ts +18 -18
- package/dist/api/core/geom/query/circle.d.ts +18 -18
- package/dist/api/core/geom/query/contour.d.ts +20 -20
- package/dist/api/core/geom/query/curve.d.ts +49 -49
- package/dist/api/core/geom/query/edge.d.ts +5 -5
- package/dist/api/core/geom/query/face.d.ts +16 -16
- package/dist/api/core/geom/query/halfedge.d.ts +8 -8
- package/dist/api/core/geom/query/profile.d.ts +19 -19
- package/dist/api/core/geom/query/vertex.d.ts +8 -8
- package/dist/api/core/geom/update/contour.d.ts +14 -14
- package/dist/api/core/geom/update/curve.d.ts +7 -7
- package/dist/api/core/geom/update/profile.d.ts +16 -16
- package/dist/api/core/handles/index.d.ts +210 -0
- package/dist/api/core/handles/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +15 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/export/index.d.ts +132 -0
- package/dist/api/core/io/export/index.d.ts.map +1 -0
- package/dist/api/core/io/import/index.d.ts +1 -1
- package/dist/api/core/io/index.d.ts +5 -0
- package/dist/api/core/io/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +7 -7
- package/dist/api/core/proposals/index.d.ts +65 -9
- package/dist/api/core/proposals/index.d.ts.map +1 -1
- package/dist/api/core/user.d.ts +44 -0
- package/dist/api/core/user.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +4 -4
- package/dist/api/design/create/index.d.ts +139 -44
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +36 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/edit/index.d.ts +1 -1
- package/dist/api/design/erase/index.d.ts +2 -2
- package/dist/api/design/furniture/index.d.ts +114 -3
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +10 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/materials/index.d.ts +111 -14
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +31 -1
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +5 -5
- package/dist/api/design/transform/index.d.ts +83 -14
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/design/types/index.d.ts +181 -0
- package/dist/api/design/types/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +335 -2
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +98 -0
- package/dist/api/design/visibility.d.ts.map +1 -0
- package/dist/api/entity/referenceLine.d.ts +2 -2
- package/dist/api/entity/space.d.ts +19 -19
- package/dist/api/entity/story.d.ts +128 -15
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +1967 -7
- package/dist/api/presentation/aiInspiration.d.ts.map +1 -1
- package/dist/api/presentation/annotate.d.ts +448 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +49 -8
- package/dist/api/presentation/diagrams.d.ts.map +1 -1
- package/dist/api/presentation/export.d.ts +104 -0
- package/dist/api/presentation/export.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +40 -3
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/sheets.d.ts +410 -13
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/views.d.ts +165 -10
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +63 -3
- package/dist/api/program/areas.d.ts.map +1 -1
- package/dist/api/program/cores.d.ts +3 -99
- package/dist/api/program/cores.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +2 -2
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +172 -12
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +11 -8
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/api/program/spreadsheet.d.ts +105 -13
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/handles.d.ts +64 -25
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +2502 -1466
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2369 -1461
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/core/camera/index.ts +212 -0
- package/src/api/core/comment/index.ts +120 -2
- package/src/api/core/geom/delete/index.ts +6 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/index.ts +15 -0
- package/src/api/core/io/export/index.ts +124 -0
- package/src/api/core/io/index.ts +5 -0
- package/src/api/core/proposals/index.ts +71 -11
- package/src/api/core/user.ts +46 -0
- package/src/api/design/create/index.ts +166 -36
- package/src/api/design/doors/index.ts +40 -0
- package/src/api/design/furniture/index.ts +127 -3
- package/src/api/design/index.ts +10 -0
- package/src/api/design/materials/index.ts +157 -30
- package/src/api/design/query/index.ts +33 -7
- package/src/api/design/transform/index.ts +89 -12
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +402 -6
- package/src/api/design/visibility.ts +109 -0
- package/src/api/entity/story.ts +141 -15
- package/src/api/presentation/aiInspiration.ts +761 -7
- package/src/api/presentation/annotate.ts +360 -0
- package/src/api/presentation/diagrams.ts +53 -8
- package/src/api/presentation/export.ts +104 -0
- package/src/api/presentation/index.ts +48 -3
- package/src/api/presentation/sheets.ts +346 -13
- package/src/api/presentation/views.ts +164 -12
- package/src/api/program/areas.ts +57 -6
- package/src/api/program/cores.ts +3 -91
- package/src/api/program/index.ts +2 -2
- package/src/api/program/layout.ts +182 -12
- package/src/api/program/site.ts +11 -8
- package/src/api/program/spreadsheet.ts +125 -29
- package/src/handles.ts +77 -13
- package/tsconfig.json +7 -2
|
@@ -99,6 +99,27 @@ export declare abstract class PluginDesignDoorsApi {
|
|
|
99
99
|
* ```
|
|
100
100
|
*/
|
|
101
101
|
abstract getHeight(door: ComponentHandle): PluginApiReturn<number | null>;
|
|
102
|
+
/**
|
|
103
|
+
* Get a door's full dimensions in one call — width along the wall, vertical
|
|
104
|
+
* height, and thickness through the wall — measured in the door's local
|
|
105
|
+
* oriented space. Parity with {@linkcode PluginDesignWindowsApi.getDimensions}.
|
|
106
|
+
*
|
|
107
|
+
* @param door The door to query
|
|
108
|
+
* @returns The dimensions, or `null`
|
|
109
|
+
*
|
|
110
|
+
* @examplePrompt What are the dimensions of this door?
|
|
111
|
+
* @examplePrompt How big is the selected door?
|
|
112
|
+
* @examplePrompt Give me the width, height and depth of this door
|
|
113
|
+
* @examplePrompt Measure the entrance door including its thickness through the wall
|
|
114
|
+
*
|
|
115
|
+
* # Example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const [door] = await snaptrude.design.query.listDoors({ isSelected: true })
|
|
118
|
+
* const dims = await snaptrude.design.doors.getDimensions(door)
|
|
119
|
+
* if (dims) console.log(dims.width, dims.height, dims.thickness)
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
abstract getDimensions(door: ComponentHandle): PluginApiReturn<PluginDoorDimensions | null>;
|
|
102
123
|
/**
|
|
103
124
|
* Get the floor a door is hosted on — the storey/level component that
|
|
104
125
|
* supports the door.
|
|
@@ -298,6 +319,21 @@ export declare const PluginDesignDoorArgs: z.ZodObject<{
|
|
|
298
319
|
door: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
299
320
|
}, z.core.$strip>;
|
|
300
321
|
export type PluginDesignDoorArgs = z.infer<typeof PluginDesignDoorArgs>;
|
|
322
|
+
/**
|
|
323
|
+
* A door's dimensions (engine units), symmetric with {@linkcode PluginWindowDimensions}.
|
|
324
|
+
*
|
|
325
|
+
* | Property | Type | Description |
|
|
326
|
+
* |---|---|---|
|
|
327
|
+
* | `width` | `number` | Along the wall |
|
|
328
|
+
* | `height` | `number` | Vertical |
|
|
329
|
+
* | `thickness` | `number` | Through the wall (engine `length` axis) |
|
|
330
|
+
*/
|
|
331
|
+
export declare const PluginDoorDimensions: z.ZodObject<{
|
|
332
|
+
width: z.ZodNumber;
|
|
333
|
+
height: z.ZodNumber;
|
|
334
|
+
thickness: z.ZodNumber;
|
|
335
|
+
}, z.core.$strip>;
|
|
336
|
+
export type PluginDoorDimensions = z.infer<typeof PluginDoorDimensions>;
|
|
301
337
|
/** Mirror axis — tokens mirror the engine `FlipDirection` verbatim (§6.1). */
|
|
302
338
|
export declare const PluginMirrorAxis: z.ZodEnum<{
|
|
303
339
|
x: "x";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/doors/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,8BAAsB,oBAAoB;;IAGxC;;;;;;;;;;;;;;;;;;OAkBG;aACa,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAE9E;;;;;;;;;;;;;;;;;;OAkBG;aACa,SAAS,CAAC,IAAI,EAAE,eAA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G,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEnG,eAAO,MAAM,0BAA0B;;iBAAqC,CAAA;AAC5E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
|
|
@@ -43,7 +43,7 @@ export declare abstract class PluginDesignEditApi {
|
|
|
43
43
|
export declare const PluginDesignOffsetSplitArgs: z.ZodObject<{
|
|
44
44
|
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
45
45
|
offsetDistance: z.ZodNumber;
|
|
46
|
-
profilePickPoint: z.ZodOptional<z.ZodPipe<z.
|
|
46
|
+
profilePickPoint: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
47
47
|
}, z.core.$strip>;
|
|
48
48
|
export type PluginDesignOffsetSplitArgs = z.infer<typeof PluginDesignOffsetSplitArgs>;
|
|
49
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -38,7 +38,7 @@ export declare const ErasableEdgeRef: z.ZodObject<{
|
|
|
38
38
|
}>;
|
|
39
39
|
edgeWeight: z.ZodNumber;
|
|
40
40
|
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
41
|
-
snapPoint: z.ZodPipe<z.
|
|
41
|
+
snapPoint: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
43
|
export type ErasableEdgeRef = z.infer<typeof ErasableEdgeRef>;
|
|
44
44
|
/**
|
|
@@ -77,7 +77,7 @@ export declare const PluginDesignEraseEdgeArgs: z.ZodObject<{
|
|
|
77
77
|
}>;
|
|
78
78
|
edgeWeight: z.ZodNumber;
|
|
79
79
|
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
80
|
-
snapPoint: z.ZodPipe<z.
|
|
80
|
+
snapPoint: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
|
|
81
81
|
}, z.core.$strip>;
|
|
82
82
|
}, z.core.$strip>;
|
|
83
83
|
export type PluginDesignEraseEdgeArgs = z.infer<typeof PluginDesignEraseEdgeArgs>;
|
|
@@ -1,17 +1,69 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { PluginApiReturn } from "../../../types";
|
|
3
|
+
import { ComponentHandle } from "../../../handles";
|
|
4
|
+
import { PluginDesignChangeResult } from "../lock";
|
|
3
5
|
/**
|
|
4
6
|
* `snaptrude.design.furniture` — the placeable furniture **catalog** (a library of
|
|
5
|
-
* source items, NOT scene entities)
|
|
6
|
-
* (returns a {@linkcode ComponentHandle});
|
|
7
|
-
* `design.query.listFurniture`/`getProperties`.
|
|
7
|
+
* source items, NOT scene entities) plus dimension reads/edits of PLACED furniture.
|
|
8
|
+
* Placement lives at `design.create.furniture` (returns a {@linkcode ComponentHandle});
|
|
9
|
+
* generic reads of placed furniture live at `design.query.listFurniture`/`getProperties`.
|
|
8
10
|
*
|
|
9
11
|
* Catalog items are plain value records ({@linkcode PluginFurnitureCatalogItem}) keyed
|
|
10
12
|
* by a library id (team `_id` or general `fullName`) — not handles. Reads are async
|
|
11
13
|
* (network-backed) but carry no `Async` suffix (§6.6).
|
|
14
|
+
*
|
|
15
|
+
* {@linkcode PluginDesignFurnitureApi.getDimensions} / {@linkcode PluginDesignFurnitureApi.setDimensions}
|
|
16
|
+
* target a PLACED furniture {@linkcode ComponentHandle} (not a catalog id) — `length`
|
|
17
|
+
* along the object, `width` across it, `height` up. Values are engine units, matching
|
|
18
|
+
* the length/width/height fields the furniture properties panel shows.
|
|
12
19
|
*/
|
|
13
20
|
export declare abstract class PluginDesignFurnitureApi {
|
|
14
21
|
constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Get the dimensions of a PLACED furniture item — `length` (along the object),
|
|
24
|
+
* `width` (across it) and `height` (vertical), in engine units. Mirrors the
|
|
25
|
+
* Length/Width/Height fields of the furniture properties panel.
|
|
26
|
+
*
|
|
27
|
+
* @param item The placed furniture to query
|
|
28
|
+
* @returns The dimensions, or `null` if the geometry is degenerate
|
|
29
|
+
*
|
|
30
|
+
* @examplePrompt How big is this sofa?
|
|
31
|
+
* @examplePrompt What are the dimensions of the selected furniture?
|
|
32
|
+
* @examplePrompt Measure the length, width and height of this table
|
|
33
|
+
* @examplePrompt Get the size of the chair I just placed
|
|
34
|
+
*
|
|
35
|
+
* # Example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const [item] = await snaptrude.design.query.listFurniture({ isSelected: true })
|
|
38
|
+
* const dims = await snaptrude.design.furniture.getDimensions(item)
|
|
39
|
+
* if (dims) console.log(dims.length, dims.width, dims.height)
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
abstract getDimensions(item: ComponentHandle): PluginApiReturn<PluginFurnitureDimensions | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Resize a PLACED furniture item along one or more axes — `length`, `width`
|
|
45
|
+
* and/or `height` (engine units). Omitted axes are left unchanged. Each supplied
|
|
46
|
+
* axis is an undoable command, mirroring editing the furniture properties panel.
|
|
47
|
+
*
|
|
48
|
+
* @param item The placed furniture to resize
|
|
49
|
+
* @param dimensions New `length` / `width` / `height` (each optional, engine units)
|
|
50
|
+
* @returns The affected furniture
|
|
51
|
+
*
|
|
52
|
+
* @examplePrompt Make this table 1.8m long
|
|
53
|
+
* @examplePrompt Resize the selected sofa to 2000 wide
|
|
54
|
+
* @examplePrompt Set this furniture to 800mm tall
|
|
55
|
+
* @examplePrompt Change the desk to 1500 long and 700 deep
|
|
56
|
+
*
|
|
57
|
+
* # Example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const [item] = await snaptrude.design.query.listFurniture({ isSelected: true })
|
|
60
|
+
* const { affected } = await snaptrude.design.furniture.setDimensions(item, {
|
|
61
|
+
* length: 1800,
|
|
62
|
+
* height: 750
|
|
63
|
+
* })
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
abstract setDimensions(item: ComponentHandle, dimensions: PluginFurnitureDimensionUpdates): PluginApiReturn<PluginDesignChangeResult>;
|
|
15
67
|
/**
|
|
16
68
|
* List the categories (Living, Bedroom, Kitchen, …) that organize the
|
|
17
69
|
* furniture catalog — the picker taxonomy, merged from built-in categories,
|
|
@@ -149,4 +201,63 @@ export declare const PluginDesignFurnitureExistsArgs: z.ZodObject<{
|
|
|
149
201
|
id: z.ZodString;
|
|
150
202
|
}, z.core.$strip>;
|
|
151
203
|
export type PluginDesignFurnitureExistsArgs = z.infer<typeof PluginDesignFurnitureExistsArgs>;
|
|
204
|
+
/**
|
|
205
|
+
* A placed furniture item's dimensions (engine units).
|
|
206
|
+
*
|
|
207
|
+
* | Property | Type | Description |
|
|
208
|
+
* |---|---|---|
|
|
209
|
+
* | `length` | `number` | Along the object (panel "Length") |
|
|
210
|
+
* | `width` | `number` | Across the object (panel "Width") |
|
|
211
|
+
* | `height` | `number` | Vertical (panel "Height") |
|
|
212
|
+
*/
|
|
213
|
+
export declare const PluginFurnitureDimensions: z.ZodObject<{
|
|
214
|
+
length: z.ZodNumber;
|
|
215
|
+
width: z.ZodNumber;
|
|
216
|
+
height: z.ZodNumber;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
export type PluginFurnitureDimensions = z.infer<typeof PluginFurnitureDimensions>;
|
|
219
|
+
/**
|
|
220
|
+
* Arguments for {@linkcode PluginDesignFurnitureApi.getDimensions}.
|
|
221
|
+
*
|
|
222
|
+
* | Property | Type | Description |
|
|
223
|
+
* |---|---|---|
|
|
224
|
+
* | `item` | {@linkcode ComponentHandle} | The placed furniture to query |
|
|
225
|
+
*/
|
|
226
|
+
export declare const PluginDesignFurnitureItemArgs: z.ZodObject<{
|
|
227
|
+
item: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
export type PluginDesignFurnitureItemArgs = z.infer<typeof PluginDesignFurnitureItemArgs>;
|
|
230
|
+
/**
|
|
231
|
+
* A partial dimension patch — each axis is optional; omitted axes are unchanged.
|
|
232
|
+
* Every supplied axis must be a positive engine-unit length.
|
|
233
|
+
*
|
|
234
|
+
* | Property | Type | Description |
|
|
235
|
+
* |---|---|---|
|
|
236
|
+
* | `length` | `number`? | New length along the object (engine units, > 0) |
|
|
237
|
+
* | `width` | `number`? | New width across the object (engine units, > 0) |
|
|
238
|
+
* | `height` | `number`? | New height (engine units, > 0) |
|
|
239
|
+
*/
|
|
240
|
+
export declare const PluginFurnitureDimensionUpdates: z.ZodObject<{
|
|
241
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
243
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
244
|
+
}, z.core.$strip>;
|
|
245
|
+
export type PluginFurnitureDimensionUpdates = z.infer<typeof PluginFurnitureDimensionUpdates>;
|
|
246
|
+
/**
|
|
247
|
+
* Arguments for {@linkcode PluginDesignFurnitureApi.setDimensions}.
|
|
248
|
+
*
|
|
249
|
+
* | Property | Type | Description |
|
|
250
|
+
* |---|---|---|
|
|
251
|
+
* | `item` | {@linkcode ComponentHandle} | The placed furniture to resize |
|
|
252
|
+
* | `dimensions` | {@linkcode PluginFurnitureDimensionUpdates} | The axes to change (each optional) |
|
|
253
|
+
*/
|
|
254
|
+
export declare const PluginDesignFurnitureSetDimensionsArgs: z.ZodObject<{
|
|
255
|
+
item: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
256
|
+
dimensions: z.ZodObject<{
|
|
257
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
260
|
+
}, z.core.$strip>;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
export type PluginDesignFurnitureSetDimensionsArgs = z.infer<typeof PluginDesignFurnitureSetDimensionsArgs>;
|
|
152
263
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/furniture/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/furniture/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;OAmBG;aACa,aAAa,CAC3B,IAAI,EAAE,eAAe,GACpB,eAAe,CAAC,yBAAyB,GAAG,IAAI,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;;;;OAsBG;aACa,aAAa,CAC3B,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,+BAA+B,GAC1C,eAAe,CAAC,wBAAwB,CAAC;IAE5C;;;;;;;;;;;;;;;;;;;OAmBG;aACa,cAAc,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;IAE3D;;;;;;;;;;;;;;;;;;OAkBG;aACa,WAAW,CACzB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,CAAC,EAAE,MAAM,GAChB,eAAe,CAAC,0BAA0B,EAAE,CAAC;IAEhD;;;;;;;;;;;;;;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AAM,sCAAsC;;;;;;;iBAGjD,CAAA;AACF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,sCAAsC,CAC9C,CAAA"}
|
|
@@ -13,6 +13,8 @@ import { PluginDesignBooleanApi } from "./boolean";
|
|
|
13
13
|
import { PluginDesignTransformApi } from "./transform";
|
|
14
14
|
import { PluginDesignEditApi } from "./edit";
|
|
15
15
|
import { PluginDesignUpdateApi } from "./update";
|
|
16
|
+
import { PluginDesignVisibilityApi } from "./visibility";
|
|
17
|
+
import { PluginDesignTypesApi } from "./types";
|
|
16
18
|
import { PluginDesignChangeResult } from "./lock";
|
|
17
19
|
/**
|
|
18
20
|
* `snaptrude.design.*` — author, query & edit BIM geometry.
|
|
@@ -26,6 +28,8 @@ import { PluginDesignChangeResult } from "./lock";
|
|
|
26
28
|
* - {@linkcode PluginDesignApi.boolean} — CSG boolean ops (union / subtract / intersect)
|
|
27
29
|
* - {@linkcode PluginDesignApi.erase} — plan-level adjacency-edge erase (NOT hard delete)
|
|
28
30
|
* - {@linkcode PluginDesignApi.delete} — hard entity removal
|
|
31
|
+
* - {@linkcode PluginDesignApi.visibility} — hide / isolate / reveal entities
|
|
32
|
+
* - {@linkcode PluginDesignApi.types} — read-only building type / assembly reference
|
|
29
33
|
* - {@linkcode PluginDesignApi.lock} / {@linkcode PluginDesignApi.unlock} / {@linkcode PluginDesignApi.isLocked} / {@linkcode PluginDesignApi.listLocked} — lock state (top-level design verbs, §2A.1)
|
|
30
34
|
* - {@linkcode PluginDesignApi.lockArea} / {@linkcode PluginDesignApi.unlockArea} / {@linkcode PluginDesignApi.isAreaLocked} / {@linkcode PluginDesignApi.listAreaLocked} — footprint-area lock for Room/Department spaces
|
|
31
35
|
*
|
|
@@ -58,6 +62,10 @@ export declare abstract class PluginDesignApi {
|
|
|
58
62
|
abstract edit: PluginDesignEditApi;
|
|
59
63
|
/** Update existing entities — properties + geometry. See {@linkcode PluginDesignUpdateApi}. */
|
|
60
64
|
abstract update: PluginDesignUpdateApi;
|
|
65
|
+
/** Hide / isolate / reveal entities. See {@linkcode PluginDesignVisibilityApi}. */
|
|
66
|
+
abstract visibility: PluginDesignVisibilityApi;
|
|
67
|
+
/** Read-only building type / assembly reference. See {@linkcode PluginDesignTypesApi}. */
|
|
68
|
+
abstract types: PluginDesignTypesApi;
|
|
61
69
|
/**
|
|
62
70
|
* Lock entities so they cannot be edited. Undoable. Cascades to void/door/window
|
|
63
71
|
* children, stacked-wall companions, and terrain neighborhood; skips
|
|
@@ -233,4 +241,6 @@ export * from "./boolean";
|
|
|
233
241
|
export * from "./transform";
|
|
234
242
|
export * from "./edit";
|
|
235
243
|
export * from "./update";
|
|
244
|
+
export * from "./visibility";
|
|
245
|
+
export * from "./types";
|
|
236
246
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/design/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,E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AU,IAAI,eAAe,CAAC,eAAe,EAAE,CAAC;IAEhE;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,QAAQ,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC;IAE9F;;;;;;;;;;;;;;;;;;OAkBG;aACa,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC;IAEhG;;;;;;;;;;;;;;;;;OAiBG;aACa,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC;IAE9E;;;;;;;;;;;;;;;OAeG;aACa,cAAc,IAAI,eAAe,CAAC,eAAe,EAAE,CAAC;;CAGrE;AAED,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
|
|
@@ -7,7 +7,9 @@ import { ComponentHandle, MaterialHandle } from "../../../handles";
|
|
|
7
7
|
* Materials are {@linkcode MaterialHandle}s (entity-style, name-addressed). Reads return
|
|
8
8
|
* a {@linkcode MaterialHandle}/{@linkcode PluginMaterialInfo}; `apply`/`reset` mutate the
|
|
9
9
|
* scene (undoable via `save`, default `true`). `create` mints a material from a
|
|
10
|
-
* {@linkcode PluginMaterialSpec} (idempotent by name).
|
|
10
|
+
* {@linkcode PluginMaterialSpec} (idempotent by name). `list` reads the materials loaded
|
|
11
|
+
* in the project; `listPresets` reads the browsable preset/library catalog (handle-less
|
|
12
|
+
* {@linkcode PluginPresetMaterial} records that become materials via `create`/`apply`).
|
|
11
13
|
*
|
|
12
14
|
* Per-face assignment — {@linkcode PluginDesignMaterialsApi.applyToFaces} /
|
|
13
15
|
* {@linkcode PluginDesignMaterialsApi.resetFaces} plus per-face reads
|
|
@@ -22,23 +24,58 @@ import { ComponentHandle, MaterialHandle } from "../../../handles";
|
|
|
22
24
|
export declare abstract class PluginDesignMaterialsApi {
|
|
23
25
|
constructor();
|
|
24
26
|
/**
|
|
25
|
-
* List the project
|
|
26
|
-
*
|
|
27
|
+
* List the materials loaded in the project — every named material in the live
|
|
28
|
+
* scene (applied finishes, plugin-created materials, and type defaults in use).
|
|
29
|
+
* For the browsable preset/library catalog (finishes not yet in the project),
|
|
30
|
+
* use {@linkcode PluginDesignMaterialsApi.listPresets}.
|
|
31
|
+
*
|
|
27
32
|
* @returns The materials as {@linkcode MaterialHandle}`[]`
|
|
28
33
|
*
|
|
29
34
|
* @examplePrompt List all the materials in this project
|
|
30
35
|
* @examplePrompt What materials do I have available to apply?
|
|
31
|
-
* @examplePrompt Show me the preset materials library
|
|
32
36
|
* @examplePrompt Which finishes exist in this model?
|
|
33
37
|
* @examplePrompt Get every material in the project palette
|
|
34
38
|
*
|
|
35
39
|
* # Example
|
|
36
40
|
* ```ts
|
|
37
|
-
* const
|
|
38
|
-
* console.log(
|
|
41
|
+
* const materials = await snaptrude.design.materials.list()
|
|
42
|
+
* console.log(materials.length, "materials in the project")
|
|
39
43
|
* ```
|
|
40
44
|
*/
|
|
41
|
-
abstract list(
|
|
45
|
+
abstract list(): PluginApiReturn<MaterialHandle[]>;
|
|
46
|
+
/**
|
|
47
|
+
* List the preset material library — the catalog the app's material browser
|
|
48
|
+
* shows (the built-in finishes plus the workspace's uploaded materials),
|
|
49
|
+
* fetched from the material library service. Library entries are **not**
|
|
50
|
+
* scene materials and carry no {@linkcode MaterialHandle}; each is a named
|
|
51
|
+
* texture record. To use one, feed it to
|
|
52
|
+
* {@linkcode PluginDesignMaterialsApi.create} /
|
|
53
|
+
* {@linkcode PluginDesignMaterialsApi.apply} as a
|
|
54
|
+
* {@linkcode PluginMaterialSpec}: `{ name, textureUrl, materialType: category }`.
|
|
55
|
+
*
|
|
56
|
+
* @returns The library as {@linkcode PluginPresetMaterial}`[]` (`[]` when the
|
|
57
|
+
* library service is unreachable)
|
|
58
|
+
*
|
|
59
|
+
* @examplePrompt Show me the preset materials library
|
|
60
|
+
* @examplePrompt What wood finishes are available in the material library?
|
|
61
|
+
* @examplePrompt Browse the material catalog and apply a brick texture
|
|
62
|
+
* @examplePrompt Which preset materials can I choose from?
|
|
63
|
+
*
|
|
64
|
+
* # Example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const presets = await snaptrude.design.materials.listPresets()
|
|
67
|
+
* const brick = presets.find((p) => p.category.toLowerCase().includes("brick"))
|
|
68
|
+
* if (brick) {
|
|
69
|
+
* const walls = await snaptrude.design.query.listWalls()
|
|
70
|
+
* await snaptrude.design.materials.apply(walls, {
|
|
71
|
+
* name: brick.name,
|
|
72
|
+
* textureUrl: brick.textureUrl,
|
|
73
|
+
* materialType: brick.category,
|
|
74
|
+
* })
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
abstract listPresets(): PluginApiReturn<PluginPresetMaterial[]>;
|
|
42
79
|
/**
|
|
43
80
|
* Read a material's descriptor — its name, color, opacity, and texture
|
|
44
81
|
* (when it has one).
|
|
@@ -59,6 +96,37 @@ export declare abstract class PluginDesignMaterialsApi {
|
|
|
59
96
|
* ```
|
|
60
97
|
*/
|
|
61
98
|
abstract getInfo(material: MaterialHandle): PluginApiReturn<PluginMaterialInfo | null>;
|
|
99
|
+
/**
|
|
100
|
+
* Read the material applied to a component **as a whole** — the eyedropper. For a
|
|
101
|
+
* uniformly-painted component this is that single material; for a per-face-painted
|
|
102
|
+
* component it is the material on the component's base/first face. Use
|
|
103
|
+
* {@linkcode PluginDesignMaterialsApi.getByFace} /
|
|
104
|
+
* {@linkcode PluginDesignMaterialsApi.listByFace} for the per-face breakdown.
|
|
105
|
+
*
|
|
106
|
+
* @param component The component to sample
|
|
107
|
+
* @returns The whole-object material as a {@linkcode PluginComponentMaterial} — its
|
|
108
|
+
* handle (chain it into `apply` / `getInfo`), engine id, name, and whether the
|
|
109
|
+
* component carries its type `default` or an explicitly `applied` finish — or `null`
|
|
110
|
+
* if the component carries no material
|
|
111
|
+
*
|
|
112
|
+
* @examplePrompt What material is on this wall?
|
|
113
|
+
* @examplePrompt Eyedrop the finish of the selected object
|
|
114
|
+
* @examplePrompt Which material does this slab use?
|
|
115
|
+
* @examplePrompt Read the material on this column so I can paint others with it
|
|
116
|
+
* @examplePrompt Is this component painted, and with what?
|
|
117
|
+
*
|
|
118
|
+
* # Example
|
|
119
|
+
* ```ts
|
|
120
|
+
* const [component] = await snaptrude.design.selection.get()
|
|
121
|
+
* const sampled = await snaptrude.design.materials.get(component)
|
|
122
|
+
* if (sampled) {
|
|
123
|
+
* console.log(sampled.name, sampled.source) // e.g. "Brick Red" "applied"
|
|
124
|
+
* const info = await snaptrude.design.materials.getInfo(sampled.material)
|
|
125
|
+
* console.log(info?.colorHex)
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
abstract get(component: ComponentHandle): PluginApiReturn<PluginComponentMaterial | null>;
|
|
62
130
|
/**
|
|
63
131
|
* Apply a material to one or more components — an existing project material by
|
|
64
132
|
* handle, or a new one described inline as a {@linkcode PluginMaterialSpec}.
|
|
@@ -354,14 +422,43 @@ export declare const PluginFaceMaterial: z.ZodObject<{
|
|
|
354
422
|
material: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>>;
|
|
355
423
|
}, z.core.$strip>;
|
|
356
424
|
export type PluginFaceMaterial = z.infer<typeof PluginFaceMaterial>;
|
|
357
|
-
/**
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
425
|
+
/**
|
|
426
|
+
* The material on a component **as a whole** — the eyedropper read returned by
|
|
427
|
+
* {@linkcode PluginDesignMaterialsApi.get} (value record, plus a reusable handle).
|
|
428
|
+
*
|
|
429
|
+
* | Property | Type | Description |
|
|
430
|
+
* |---|---|---|
|
|
431
|
+
* | `material` | {@linkcode MaterialHandle} | The whole-object material — chain into `apply` / `getInfo` |
|
|
432
|
+
* | `id` | `string` | Engine material id |
|
|
433
|
+
* | `name` | `string` | Material name (== the handle token) |
|
|
434
|
+
* | `source` | `"default" \| "applied"` | Whether it is the component's type default or an explicitly-applied finish |
|
|
435
|
+
*/
|
|
436
|
+
export declare const PluginComponentMaterial: z.ZodObject<{
|
|
437
|
+
material: z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>;
|
|
438
|
+
id: z.ZodString;
|
|
439
|
+
name: z.ZodString;
|
|
440
|
+
source: z.ZodEnum<{
|
|
441
|
+
default: "default";
|
|
442
|
+
applied: "applied";
|
|
443
|
+
}>;
|
|
444
|
+
}, z.core.$strip>;
|
|
445
|
+
export type PluginComponentMaterial = z.infer<typeof PluginComponentMaterial>;
|
|
446
|
+
/**
|
|
447
|
+
* A preset material library entry (value record — NOT a handle), returned by
|
|
448
|
+
* {@linkcode PluginDesignMaterialsApi.listPresets}.
|
|
449
|
+
*
|
|
450
|
+
* | Property | Type | Description |
|
|
451
|
+
* |---|---|---|
|
|
452
|
+
* | `name` | `string` | Display name of the library entry |
|
|
453
|
+
* | `category` | `string` | Library category (camelCase, e.g. `"wood"`, `"colors"`, `"brick"`) |
|
|
454
|
+
* | `textureUrl` | `string` | Texture/swatch image URL — feed to {@linkcode PluginMaterialSpec}`.textureUrl` |
|
|
455
|
+
*/
|
|
456
|
+
export declare const PluginPresetMaterial: z.ZodObject<{
|
|
457
|
+
name: z.ZodString;
|
|
458
|
+
category: z.ZodString;
|
|
459
|
+
textureUrl: z.ZodString;
|
|
363
460
|
}, z.core.$strip>;
|
|
364
|
-
export type
|
|
461
|
+
export type PluginPresetMaterial = z.infer<typeof PluginPresetMaterial>;
|
|
365
462
|
/** Arguments for {@linkcode PluginDesignMaterialsApi.getInfo} / `hasTexture`. */
|
|
366
463
|
export declare const PluginDesignMaterialsGetInfoArgs: z.ZodObject<{
|
|
367
464
|
material: z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/materials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAElE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/materials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAElE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;OAkBG;aACa,IAAI,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;aACa,WAAW,IAAI,eAAe,CAAC,oBAAoB,EAAE,CAAC;IAEtE;;;;;;;;;;;;;;;;;;OAkBG;aACa,OAAO,CACrB,QAAQ,EAAE,cAAc,GACvB,eAAe,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;aACa,GAAG,CACjB,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAEl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QueryCo
|
|
|
280
280
|
* | `spaceType` | {@linkcode PluginSpaceType} | Space-type (spaces only) |
|
|
281
281
|
* | `areaClass` | {@linkcode PluginAreaClass} | Area classification (spaces only) |
|
|
282
282
|
* | `departmentId` | `string` | Department (masses only) |
|
|
283
|
+
* | `buildingType` | `string` | Assigned building type NAME (walls / slabs / floors / roofs / ceilings only) — the Object Properties panel's Wall/Slab/Floor/Roof/Ceiling Type dropdown value, matching the names from `design.types.list(kind)` |
|
|
283
284
|
* | `isLocked` | `boolean` | Lock flag |
|
|
284
285
|
* | `isHidden` | `boolean` | User-hidden flag |
|
|
285
286
|
* | `isSelected` | `boolean` | Current selection state |
|
|
@@ -330,6 +331,7 @@ export declare const PluginEntityProperties: z.ZodObject<{
|
|
|
330
331
|
EXCLUDED: "EXCLUDED";
|
|
331
332
|
}>>;
|
|
332
333
|
departmentId: z.ZodOptional<z.ZodString>;
|
|
334
|
+
buildingType: z.ZodOptional<z.ZodString>;
|
|
333
335
|
isLocked: z.ZodOptional<z.ZodBoolean>;
|
|
334
336
|
isHidden: z.ZodOptional<z.ZodBoolean>;
|
|
335
337
|
isSelected: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -357,17 +359,28 @@ export type PluginEntityProperties = z.infer<typeof PluginEntityProperties>;
|
|
|
357
359
|
* entity's type computes them (area: floors/masses/slabs/roofs/beams/columns;
|
|
358
360
|
* volume: all; length: walls/beams).
|
|
359
361
|
*
|
|
362
|
+
* `thickness` and `height` are the Object Properties panel's dimension reads
|
|
363
|
+
* (the same engine source `design.update.wall` / `design.update.slab` etc.
|
|
364
|
+
* write through), in engine units. `thickness`: walls (the plan thickness —
|
|
365
|
+
* present only for straight orthogonal walls, exactly when the panel shows it)
|
|
366
|
+
* and slabs/floors/roofs/ceilings (the vertical extent the panel calls
|
|
367
|
+
* Thickness). `height`: walls only.
|
|
368
|
+
*
|
|
360
369
|
* | Property | Type | Description |
|
|
361
370
|
* |---|---|---|
|
|
362
371
|
* | `area` | `number`? | Bottom-face area |
|
|
363
372
|
* | `volume` | `number`? | Solid volume |
|
|
364
373
|
* | `length` | `number`? | Running length (linear elements) |
|
|
374
|
+
* | `thickness` | `number`? | Panel Thickness — walls (straight orthogonal only) and the slab family |
|
|
375
|
+
* | `height` | `number`? | Panel Height — walls only |
|
|
365
376
|
* | `boundingBox` | {@linkcode BBoxComponents} | World-space AABB (always present) |
|
|
366
377
|
*/
|
|
367
378
|
export declare const PluginEntityMeasurements: z.ZodObject<{
|
|
368
379
|
area: z.ZodOptional<z.ZodNumber>;
|
|
369
380
|
volume: z.ZodOptional<z.ZodNumber>;
|
|
370
381
|
length: z.ZodOptional<z.ZodNumber>;
|
|
382
|
+
thickness: z.ZodOptional<z.ZodNumber>;
|
|
383
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
371
384
|
boundingBox: z.ZodObject<{
|
|
372
385
|
min: z.ZodObject<{
|
|
373
386
|
x: z.ZodNumber;
|
|
@@ -1011,13 +1024,16 @@ export declare abstract class PluginDesignQueryApi {
|
|
|
1011
1024
|
* Read an entity's common properties as a {@linkcode PluginEntityProperties}
|
|
1012
1025
|
* record (only applicable fields are present). For spaces/masses this includes
|
|
1013
1026
|
* `adjacency` — the per-entity adjacency read (bulk form:
|
|
1014
|
-
* `program.adjacency.getMatrix`).
|
|
1027
|
+
* `program.adjacency.getMatrix`). For walls and the slab family (slab / floor
|
|
1028
|
+
* / roof / ceiling) this includes `buildingType` — the assigned building type
|
|
1029
|
+
* NAME the panel's type dropdown shows, matching `design.types.list(kind)`.
|
|
1015
1030
|
*
|
|
1016
1031
|
* @param component - the entity's {@linkcode ComponentHandle}
|
|
1017
1032
|
* @returns the property record
|
|
1018
1033
|
*
|
|
1019
1034
|
* @examplePrompt Show me all the details of the selected object
|
|
1020
1035
|
* @examplePrompt What storey is this wall on?
|
|
1036
|
+
* @examplePrompt Which wall type is assigned to this wall?
|
|
1021
1037
|
* @examplePrompt Which department does this room belong to?
|
|
1022
1038
|
* @examplePrompt Is this element locked or hidden?
|
|
1023
1039
|
* @examplePrompt Get the adjacencies of this space
|
|
@@ -1044,11 +1060,20 @@ export declare abstract class PluginDesignQueryApi {
|
|
|
1044
1060
|
* Measure an entity — read its area, volume, and/or running length (whichever
|
|
1045
1061
|
* its type supports) together with its world-space bounding box in one call.
|
|
1046
1062
|
*
|
|
1063
|
+
* For walls and the slab family this also carries the Object Properties
|
|
1064
|
+
* panel's dimension reads in engine units: `thickness` (walls — straight
|
|
1065
|
+
* orthogonal only, exactly when the panel shows it; slabs / floors / roofs /
|
|
1066
|
+
* ceilings — the vertical extent the panel calls Thickness) and `height`
|
|
1067
|
+
* (walls). These are the read side of `design.update.wall` /
|
|
1068
|
+
* `design.update.slab` / `.floor` / `.roof` / `.ceiling`.
|
|
1069
|
+
*
|
|
1047
1070
|
* @param component - the entity's {@linkcode ComponentHandle}
|
|
1048
1071
|
* @returns a {@linkcode PluginEntityMeasurements}, or `null` if the entity is gone
|
|
1049
1072
|
*
|
|
1050
1073
|
* @examplePrompt What's the area of this room?
|
|
1051
1074
|
* @examplePrompt How long is the selected wall?
|
|
1075
|
+
* @examplePrompt How thick is this wall?
|
|
1076
|
+
* @examplePrompt Get the thickness of the slab on level 2
|
|
1052
1077
|
* @examplePrompt Get the volume of this mass
|
|
1053
1078
|
* @examplePrompt Give me the dimensions of the selected element
|
|
1054
1079
|
* @examplePrompt What's the floor area of the kitchen?
|
|
@@ -1058,6 +1083,11 @@ export declare abstract class PluginDesignQueryApi {
|
|
|
1058
1083
|
* const [space] = await snaptrude.design.query.listSpaces()
|
|
1059
1084
|
* const m = await snaptrude.design.query.measure(space)
|
|
1060
1085
|
* console.log(m?.area, m?.volume)
|
|
1086
|
+
*
|
|
1087
|
+
* // wall dimensions — the panel's Thickness / Height, in engine units
|
|
1088
|
+
* const [wall] = await snaptrude.design.query.listWalls()
|
|
1089
|
+
* const wm = await snaptrude.design.query.measure(wall)
|
|
1090
|
+
* console.log(wm?.thickness, wm?.height)
|
|
1061
1091
|
* ```
|
|
1062
1092
|
*/
|
|
1063
1093
|
abstract measure(component: ComponentHandle): PluginApiReturn<PluginEntityMeasurements | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAQlE,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAMrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAkB3B,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAM/D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe7B,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE;;;GAGG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE1C,CAAA;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,+BAA+B,CACvC,CAAA;AAMD,qFAAqF;AACrF,eAAO,MAAM,8BAA8B;;iBAEzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAA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