@snaptrude/plugin-core 0.6.0 → 0.7.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 +21 -0
- package/api-manifest.full.json +511 -10
- package/api-manifest.json +529 -4
- package/dist/api/core/index.d.ts +5 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +475 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +209 -0
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +159 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/furniture/index.d.ts +34 -5
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +83 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/lock.d.ts +26 -0
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/materials/index.d.ts +159 -2
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +115 -5
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +2 -2
- package/dist/api/design/transform/index.d.ts +83 -2
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +168 -0
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +113 -2
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +101 -7
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/presentation/import.d.ts +49 -4
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/views.d.ts +210 -5
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +42 -12
- package/dist/api/program/areas.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +3 -11
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +186 -11
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/errors/codes.d.ts +34 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/envelope.d.ts +56 -0
- package/dist/errors/envelope.d.ts.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/plugin-error.d.ts +69 -0
- package/dist/errors/plugin-error.d.ts.map +1 -0
- package/dist/host-utils.d.ts +4 -0
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +1624 -1028
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1546 -1025
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/scripts/generate-manifest.test.mjs +77 -0
- package/src/api/core/index.ts +5 -0
- package/src/api/core/proposals/index.ts +509 -0
- package/src/api/design/create/index.ts +249 -0
- package/src/api/design/doors/index.ts +168 -0
- package/src/api/design/furniture/index.ts +36 -5
- package/src/api/design/index.ts +87 -0
- package/src/api/design/lock.ts +27 -0
- package/src/api/design/materials/index.ts +182 -2
- package/src/api/design/query/index.ts +81 -0
- package/src/api/design/transform/index.ts +74 -2
- package/src/api/design/update/index.ts +167 -0
- package/src/api/design/windows/index.ts +128 -2
- package/src/api/entity/story.ts +105 -7
- package/src/api/presentation/import.ts +45 -4
- package/src/api/presentation/views.ts +221 -5
- package/src/api/program/areas.ts +34 -12
- package/src/api/program/index.ts +3 -11
- package/src/api/program/layout.ts +195 -11
- package/src/errors/codes.ts +136 -0
- package/src/errors/envelope.ts +75 -0
- package/src/errors/index.ts +21 -0
- package/src/errors/plugin-error.ts +134 -0
- package/src/host-utils.ts +4 -0
- package/src/index.ts +1 -0
- package/test/errors.test.mjs +184 -0
|
@@ -38,4 +38,30 @@ export declare const PluginDesignIsLockedArgs: z.ZodObject<{
|
|
|
38
38
|
includeInherited: z.ZodOptional<z.ZodBoolean>;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
40
|
export type PluginDesignIsLockedArgs = z.infer<typeof PluginDesignIsLockedArgs>;
|
|
41
|
+
/**
|
|
42
|
+
* Arguments for {@linkcode PluginDesignApi.lockArea} / {@linkcode PluginDesignApi.unlockArea}.
|
|
43
|
+
*
|
|
44
|
+
* | Property | Type | Description |
|
|
45
|
+
* |---|---|---|
|
|
46
|
+
* | `spaces` | {@linkcode ComponentHandle}`[]` | Room / Department mass spaces to area-lock / unlock |
|
|
47
|
+
*/
|
|
48
|
+
export declare const PluginDesignLockAreaArgs: z.ZodObject<{
|
|
49
|
+
spaces: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type PluginDesignLockAreaArgs = z.infer<typeof PluginDesignLockAreaArgs>;
|
|
52
|
+
export declare const PluginDesignUnlockAreaArgs: z.ZodObject<{
|
|
53
|
+
spaces: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type PluginDesignUnlockAreaArgs = z.infer<typeof PluginDesignUnlockAreaArgs>;
|
|
56
|
+
/**
|
|
57
|
+
* Arguments for {@linkcode PluginDesignApi.isAreaLocked}.
|
|
58
|
+
*
|
|
59
|
+
* | Property | Type | Description |
|
|
60
|
+
* |---|---|---|
|
|
61
|
+
* | `space` | {@linkcode ComponentHandle} | The space to test |
|
|
62
|
+
*/
|
|
63
|
+
export declare const PluginDesignIsAreaLockedArgs: z.ZodObject<{
|
|
64
|
+
space: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export type PluginDesignIsAreaLockedArgs = z.infer<typeof PluginDesignIsAreaLockedArgs>;
|
|
41
67
|
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/api/design/lock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;iBAEnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,sBAAsB;;iBAAuB,CAAA;AAC1D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/api/design/lock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;iBAEnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,sBAAsB;;iBAAuB,CAAA;AAC1D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;iBAEnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E,eAAO,MAAM,0BAA0B;;iBAA2B,CAAA;AAClE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
|
@@ -9,8 +9,15 @@ import { ComponentHandle, MaterialHandle } from "../../../handles";
|
|
|
9
9
|
* scene (undoable via `save`, default `true`). `create` mints a material from a
|
|
10
10
|
* {@linkcode PluginMaterialSpec} (idempotent by name).
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Per-face assignment — {@linkcode PluginDesignMaterialsApi.applyToFaces} /
|
|
13
|
+
* {@linkcode PluginDesignMaterialsApi.resetFaces} plus per-face reads
|
|
14
|
+
* ({@linkcode PluginDesignMaterialsApi.getByFace} / {@linkcode PluginDesignMaterialsApi.listByFace})
|
|
15
|
+
* — targets **BREP faces by durable face index** and is **BREP-only** (furniture,
|
|
16
|
+
* doors/windows, and Revit imports are rejected) and **visual-only** in v1 (the
|
|
17
|
+
* per-face finish is not carried into BIM schedules / cost layers). A face index
|
|
18
|
+
* is durable only while the component's BREP topology (face count/order) is unchanged.
|
|
19
|
+
*
|
|
20
|
+
* `copy` (needs an undo wrapper) lands in a later pass.
|
|
14
21
|
*/
|
|
15
22
|
export declare abstract class PluginDesignMaterialsApi {
|
|
16
23
|
constructor();
|
|
@@ -99,6 +106,102 @@ export declare abstract class PluginDesignMaterialsApi {
|
|
|
99
106
|
* ```
|
|
100
107
|
*/
|
|
101
108
|
abstract reset(components: ComponentHandle[], save?: boolean): PluginApiReturn<PluginMaterialResult>;
|
|
109
|
+
/**
|
|
110
|
+
* Paint specific **BREP faces** of a component with a material — an existing
|
|
111
|
+
* project material by handle, or a new one described inline as a
|
|
112
|
+
* {@linkcode PluginMaterialSpec}. Faces are addressed by **durable BREP face
|
|
113
|
+
* index** (their 0-based position in the component's BREP face list).
|
|
114
|
+
* Undoable when `save` is true (the default).
|
|
115
|
+
*
|
|
116
|
+
* Per-face materials are **BREP-only** (walls, floors, slabs, roofs, masses,
|
|
117
|
+
* columns, beams; furniture, doors/windows, and Revit imports are rejected) and
|
|
118
|
+
* **visual-only in v1** — the finish is not carried into BIM schedules / cost
|
|
119
|
+
* layers. A face index is durable only while the BREP topology (face count/order)
|
|
120
|
+
* is unchanged; a face index at or beyond the face count is rejected.
|
|
121
|
+
*
|
|
122
|
+
* @param component The (BREP) component to paint
|
|
123
|
+
* @param faces BREP face indices to paint (nonnegative integers)
|
|
124
|
+
* @param material Material handle, or an inline {@linkcode PluginMaterialSpec}
|
|
125
|
+
* @param save Commit as an undoable command (default `true`)
|
|
126
|
+
* @returns The number of faces painted
|
|
127
|
+
*
|
|
128
|
+
* @examplePrompt Paint the top face of this slab red
|
|
129
|
+
* @examplePrompt Apply the brick material to faces 0 and 2 of this wall
|
|
130
|
+
* @examplePrompt Put a wood finish on just the front face of this column
|
|
131
|
+
* @examplePrompt Colour face 4 of the selected mass with #ff8800
|
|
132
|
+
*
|
|
133
|
+
* # Example
|
|
134
|
+
* ```ts
|
|
135
|
+
* const [wall] = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
136
|
+
* // faces are addressed by durable 0-based BREP face index
|
|
137
|
+
* const { count } = await snaptrude.design.materials.applyToFaces(wall, [0, 1], { name: "Accent", color: "#b04a3a" })
|
|
138
|
+
* console.log("painted", count, "faces")
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
abstract applyToFaces(component: ComponentHandle, faces: number[], material: MaterialHandle | PluginMaterialSpec, save?: boolean): PluginApiReturn<PluginMaterialResult>;
|
|
142
|
+
/**
|
|
143
|
+
* Reset specific BREP faces of a component back to the component/type default,
|
|
144
|
+
* removing any per-face finish. The inverse of
|
|
145
|
+
* {@linkcode PluginDesignMaterialsApi.applyToFaces}; undoable when `save` is true
|
|
146
|
+
* (the default). BREP-only (see `applyToFaces`).
|
|
147
|
+
*
|
|
148
|
+
* @param component The (BREP) component
|
|
149
|
+
* @param faces BREP face indices to reset (nonnegative integers)
|
|
150
|
+
* @param save Commit as an undoable command (default `true`)
|
|
151
|
+
* @returns The number of faces reset
|
|
152
|
+
*
|
|
153
|
+
* @examplePrompt Remove the paint from the top face of this slab
|
|
154
|
+
* @examplePrompt Reset faces 0 and 2 of this wall to their default material
|
|
155
|
+
* @examplePrompt Clear the custom finish on the front face of this column
|
|
156
|
+
*
|
|
157
|
+
* # Example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const [wall] = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
160
|
+
* const { count } = await snaptrude.design.materials.resetFaces(wall, [0, 1])
|
|
161
|
+
* console.log("reset", count, "faces")
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
abstract resetFaces(component: ComponentHandle, faces: number[], save?: boolean): PluginApiReturn<PluginMaterialResult>;
|
|
165
|
+
/**
|
|
166
|
+
* Read the material applied to a single BREP face.
|
|
167
|
+
*
|
|
168
|
+
* @param component The (BREP) component
|
|
169
|
+
* @param face The BREP face index (a nonnegative integer)
|
|
170
|
+
* @returns The face's material as a {@linkcode MaterialHandle}, or `null` if the
|
|
171
|
+
* face carries no explicit per-face material (or the component has no BREP)
|
|
172
|
+
*
|
|
173
|
+
* @examplePrompt What material is on the top face of this slab?
|
|
174
|
+
* @examplePrompt Get the finish applied to face 2 of this wall
|
|
175
|
+
* @examplePrompt Which material is painted on the front face of this column?
|
|
176
|
+
*
|
|
177
|
+
* # Example
|
|
178
|
+
* ```ts
|
|
179
|
+
* const [wall] = await snaptrude.design.query.listWalls()
|
|
180
|
+
* const material = await snaptrude.design.materials.getByFace(wall, 0)
|
|
181
|
+
* if (material) console.log(await snaptrude.design.materials.getInfo(material))
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
abstract getByFace(component: ComponentHandle, face: number): PluginApiReturn<MaterialHandle | null>;
|
|
185
|
+
/**
|
|
186
|
+
* List the per-face materials of a component — one entry per BREP face, in face
|
|
187
|
+
* index order. A face carrying no explicit per-face material reports `null`.
|
|
188
|
+
*
|
|
189
|
+
* @param component The (BREP) component
|
|
190
|
+
* @returns The per-face materials as {@linkcode PluginFaceMaterial}`[]` (`[]` for a
|
|
191
|
+
* component with no BREP)
|
|
192
|
+
*
|
|
193
|
+
* @examplePrompt List the material on every face of this wall
|
|
194
|
+
* @examplePrompt Show me which faces of this slab are painted and with what
|
|
195
|
+
* @examplePrompt Break down the per-face finishes of the selected mass
|
|
196
|
+
*
|
|
197
|
+
* # Example
|
|
198
|
+
* ```ts
|
|
199
|
+
* const [wall] = await snaptrude.design.query.listWalls()
|
|
200
|
+
* const faces = await snaptrude.design.materials.listByFace(wall)
|
|
201
|
+
* for (const f of faces) console.log(f.faceIndex, f.material ?? "(default)")
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
abstract listByFace(component: ComponentHandle): PluginApiReturn<PluginFaceMaterial[]>;
|
|
102
205
|
/**
|
|
103
206
|
* Create a new material in the project from a spec — a color, texture URL,
|
|
104
207
|
* opacity, and/or name. Idempotent by name: creating with the name of an
|
|
@@ -238,6 +341,19 @@ export declare const PluginMaterialResult: z.ZodObject<{
|
|
|
238
341
|
count: z.ZodNumber;
|
|
239
342
|
}, z.core.$strip>;
|
|
240
343
|
export type PluginMaterialResult = z.infer<typeof PluginMaterialResult>;
|
|
344
|
+
/**
|
|
345
|
+
* A single component face's material assignment (value record — not a handle).
|
|
346
|
+
*
|
|
347
|
+
* | Property | Type | Description |
|
|
348
|
+
* |---|---|---|
|
|
349
|
+
* | `faceIndex` | `number` | Durable BREP face index (0-based position in the face list) |
|
|
350
|
+
* | `material` | {@linkcode MaterialHandle} \| `null` | The applied material, or `null` for the default |
|
|
351
|
+
*/
|
|
352
|
+
export declare const PluginFaceMaterial: z.ZodObject<{
|
|
353
|
+
faceIndex: z.ZodNumber;
|
|
354
|
+
material: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
export type PluginFaceMaterial = z.infer<typeof PluginFaceMaterial>;
|
|
241
357
|
/** Arguments for {@linkcode PluginDesignMaterialsApi.list}. */
|
|
242
358
|
export declare const PluginDesignMaterialsListArgs: z.ZodObject<{
|
|
243
359
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
@@ -294,4 +410,45 @@ export declare const PluginDesignMaterialsCreateArgs: z.ZodObject<{
|
|
|
294
410
|
}, z.core.$strip>;
|
|
295
411
|
}, z.core.$strip>;
|
|
296
412
|
export type PluginDesignMaterialsCreateArgs = z.infer<typeof PluginDesignMaterialsCreateArgs>;
|
|
413
|
+
/**
|
|
414
|
+
* Arguments for {@linkcode PluginDesignMaterialsApi.applyToFaces}.
|
|
415
|
+
*
|
|
416
|
+
* | Property | Type | Description |
|
|
417
|
+
* |---|---|---|
|
|
418
|
+
* | `component` | {@linkcode ComponentHandle} | The (BREP) component to paint |
|
|
419
|
+
* | `faces` | `number[]` | BREP face indices to paint (nonnegative integers) |
|
|
420
|
+
* | `material` | {@linkcode MaterialHandle} \| {@linkcode PluginMaterialSpec} | Material handle, or an inline spec |
|
|
421
|
+
* | `save` | `boolean` | Commit as an undoable command (default `true`) |
|
|
422
|
+
*/
|
|
423
|
+
export declare const PluginDesignMaterialsApplyToFacesArgs: z.ZodObject<{
|
|
424
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
425
|
+
faces: z.ZodArray<z.ZodNumber>;
|
|
426
|
+
material: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>, z.ZodObject<{
|
|
427
|
+
name: z.ZodOptional<z.ZodString>;
|
|
428
|
+
color: z.ZodOptional<z.ZodString>;
|
|
429
|
+
textureUrl: z.ZodOptional<z.ZodString>;
|
|
430
|
+
alpha: z.ZodOptional<z.ZodNumber>;
|
|
431
|
+
materialType: z.ZodOptional<z.ZodString>;
|
|
432
|
+
}, z.core.$strip>]>;
|
|
433
|
+
save: z.ZodOptional<z.ZodBoolean>;
|
|
434
|
+
}, z.core.$strip>;
|
|
435
|
+
export type PluginDesignMaterialsApplyToFacesArgs = z.infer<typeof PluginDesignMaterialsApplyToFacesArgs>;
|
|
436
|
+
/** Arguments for {@linkcode PluginDesignMaterialsApi.resetFaces}. */
|
|
437
|
+
export declare const PluginDesignMaterialsResetFacesArgs: z.ZodObject<{
|
|
438
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
439
|
+
faces: z.ZodArray<z.ZodNumber>;
|
|
440
|
+
save: z.ZodOptional<z.ZodBoolean>;
|
|
441
|
+
}, z.core.$strip>;
|
|
442
|
+
export type PluginDesignMaterialsResetFacesArgs = z.infer<typeof PluginDesignMaterialsResetFacesArgs>;
|
|
443
|
+
/** Arguments for {@linkcode PluginDesignMaterialsApi.getByFace}. */
|
|
444
|
+
export declare const PluginDesignMaterialsGetByFaceArgs: z.ZodObject<{
|
|
445
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
446
|
+
face: z.ZodNumber;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
export type PluginDesignMaterialsGetByFaceArgs = z.infer<typeof PluginDesignMaterialsGetByFaceArgs>;
|
|
449
|
+
/** Arguments for {@linkcode PluginDesignMaterialsApi.listByFace} (component only). */
|
|
450
|
+
export declare const PluginDesignMaterialsListByFaceArgs: z.ZodObject<{
|
|
451
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
452
|
+
}, z.core.$strip>;
|
|
453
|
+
export type PluginDesignMaterialsListByFaceArgs = z.infer<typeof PluginDesignMaterialsListByFaceArgs>;
|
|
297
454
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;OAgBG;aACa,IAAI,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,eAAe,CAAC,cAAc,EAAE,CAAC;IAErF;;;;;;;;;;;;;;;;;;OAkBG;aACa,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,eAAe,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAE7F;;;;;;;;;;;;;;;;;;;;;;;OAuBG;aACa,KAAK,CACnB,OAAO,EAAE,eAAe,EAAE,EAC1B,QAAQ,EAAE,cAAc,GAAG,kBAAkB,EA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,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAE3F,gEAAgE;AAChE,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAE3F,iEAAiE;AACjE,eAAO,MAAM,+BAA+B;;;;;;;;iBAAyC,CAAA;AACrF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;;;;GASG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;iBAKhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,mCAAmC;;;;iBAI9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED,oEAAoE;AACpE,eAAO,MAAM,kCAAkC;;;iBAG7C,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AAED,sFAAsF;AACtF,eAAO,MAAM,mCAAmC;;iBAAqC,CAAA;AACrF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA"}
|
|
@@ -34,6 +34,7 @@ export declare const PluginEntityType: z.ZodEnum<{
|
|
|
34
34
|
floor: "floor";
|
|
35
35
|
wall: "wall";
|
|
36
36
|
ceiling: "ceiling";
|
|
37
|
+
furniture: "furniture";
|
|
37
38
|
space: "space";
|
|
38
39
|
door: "door";
|
|
39
40
|
window: "window";
|
|
@@ -42,7 +43,6 @@ export declare const PluginEntityType: z.ZodEnum<{
|
|
|
42
43
|
column: "column";
|
|
43
44
|
beam: "beam";
|
|
44
45
|
staircase: "staircase";
|
|
45
|
-
furniture: "furniture";
|
|
46
46
|
referenceLine: "referenceLine";
|
|
47
47
|
curtainWall: "curtainWall";
|
|
48
48
|
mullion: "mullion";
|
|
@@ -80,6 +80,7 @@ export declare const PluginEntityFilter: z.ZodObject<{
|
|
|
80
80
|
floor: "floor";
|
|
81
81
|
wall: "wall";
|
|
82
82
|
ceiling: "ceiling";
|
|
83
|
+
furniture: "furniture";
|
|
83
84
|
space: "space";
|
|
84
85
|
door: "door";
|
|
85
86
|
window: "window";
|
|
@@ -88,7 +89,6 @@ export declare const PluginEntityFilter: z.ZodObject<{
|
|
|
88
89
|
column: "column";
|
|
89
90
|
beam: "beam";
|
|
90
91
|
staircase: "staircase";
|
|
91
|
-
furniture: "furniture";
|
|
92
92
|
referenceLine: "referenceLine";
|
|
93
93
|
curtainWall: "curtainWall";
|
|
94
94
|
mullion: "mullion";
|
|
@@ -159,6 +159,7 @@ export declare const PluginDesignQueryListByTypeArgs: z.ZodObject<{
|
|
|
159
159
|
floor: "floor";
|
|
160
160
|
wall: "wall";
|
|
161
161
|
ceiling: "ceiling";
|
|
162
|
+
furniture: "furniture";
|
|
162
163
|
space: "space";
|
|
163
164
|
door: "door";
|
|
164
165
|
window: "window";
|
|
@@ -167,7 +168,6 @@ export declare const PluginDesignQueryListByTypeArgs: z.ZodObject<{
|
|
|
167
168
|
column: "column";
|
|
168
169
|
beam: "beam";
|
|
169
170
|
staircase: "staircase";
|
|
170
|
-
furniture: "furniture";
|
|
171
171
|
referenceLine: "referenceLine";
|
|
172
172
|
curtainWall: "curtainWall";
|
|
173
173
|
mullion: "mullion";
|
|
@@ -231,6 +231,7 @@ export declare const PluginDesignQueryListByTypeArgs: z.ZodObject<{
|
|
|
231
231
|
floor: "floor";
|
|
232
232
|
wall: "wall";
|
|
233
233
|
ceiling: "ceiling";
|
|
234
|
+
furniture: "furniture";
|
|
234
235
|
space: "space";
|
|
235
236
|
door: "door";
|
|
236
237
|
window: "window";
|
|
@@ -239,7 +240,6 @@ export declare const PluginDesignQueryListByTypeArgs: z.ZodObject<{
|
|
|
239
240
|
column: "column";
|
|
240
241
|
beam: "beam";
|
|
241
242
|
staircase: "staircase";
|
|
242
|
-
furniture: "furniture";
|
|
243
243
|
referenceLine: "referenceLine";
|
|
244
244
|
curtainWall: "curtainWall";
|
|
245
245
|
mullion: "mullion";
|
|
@@ -293,6 +293,7 @@ export declare const PluginEntityProperties: z.ZodObject<{
|
|
|
293
293
|
floor: "floor";
|
|
294
294
|
wall: "wall";
|
|
295
295
|
ceiling: "ceiling";
|
|
296
|
+
furniture: "furniture";
|
|
296
297
|
space: "space";
|
|
297
298
|
door: "door";
|
|
298
299
|
window: "window";
|
|
@@ -301,7 +302,6 @@ export declare const PluginEntityProperties: z.ZodObject<{
|
|
|
301
302
|
column: "column";
|
|
302
303
|
beam: "beam";
|
|
303
304
|
staircase: "staircase";
|
|
304
|
-
furniture: "furniture";
|
|
305
305
|
referenceLine: "referenceLine";
|
|
306
306
|
curtainWall: "curtainWall";
|
|
307
307
|
mullion: "mullion";
|
|
@@ -382,6 +382,89 @@ export declare const PluginEntityMeasurements: z.ZodObject<{
|
|
|
382
382
|
}, z.core.$strip>;
|
|
383
383
|
}, z.core.$strip>;
|
|
384
384
|
export type PluginEntityMeasurements = z.infer<typeof PluginEntityMeasurements>;
|
|
385
|
+
/**
|
|
386
|
+
* The parametric properties of a staircase — the same editable fields the
|
|
387
|
+
* staircase properties panel exposes. Returned by
|
|
388
|
+
* {@linkcode PluginDesignQueryApi.getStaircaseParams}; the write side is
|
|
389
|
+
* `design.update.staircase`. Engine internals (block schema, min well size,
|
|
390
|
+
* square-well padding) are deliberately excluded.
|
|
391
|
+
*
|
|
392
|
+
* All dimensions are in **engine units** (the same convention as
|
|
393
|
+
* `design.doors.getWidth`); `steps` is a unitless count. The invariant
|
|
394
|
+
* `staircaseHeight = steps × riser` is governed by the two lock booleans — see
|
|
395
|
+
* `design.update.staircase`. Type-specific fields (`wellSize`, `landingWidth`,
|
|
396
|
+
* `flightStartDistAfterTurn`) are present only when the preset uses them.
|
|
397
|
+
*
|
|
398
|
+
* | Property | Type | Description |
|
|
399
|
+
* |---|---|---|
|
|
400
|
+
* | `staircaseType` | {@linkcode PluginStaircasePreset} | Base staircase type |
|
|
401
|
+
* | `staircasePreset` | {@linkcode PluginStaircasePreset} | Named parametric preset |
|
|
402
|
+
* | `staircaseHeight` | `number` | Total rise (engine units) |
|
|
403
|
+
* | `steps` | `number` | Step count (unitless) |
|
|
404
|
+
* | `riser` | `number` | Riser height (engine units) |
|
|
405
|
+
* | `tread` | `number` | Tread depth (engine units) |
|
|
406
|
+
* | `width` | `number` | Flight width (engine units) |
|
|
407
|
+
* | `depth` | `number` | Slab/waist thickness (engine units) |
|
|
408
|
+
* | `wellSize` | `number`? | Stairwell gap (dogLegged / openWell / square) |
|
|
409
|
+
* | `landingWidth` | `number`? | Landing depth (straight / dogLegged) |
|
|
410
|
+
* | `flightStartDistAfterTurn` | `number`? | Flight offset after a turn (dogLegged / lShaped / square) |
|
|
411
|
+
* | `baseOffset` | `number` | Vertical offset from the storey base (engine units) |
|
|
412
|
+
* | `isStoreyHeightUnlocked` | `boolean` | When `false`, height is tied to the storey height |
|
|
413
|
+
* | `isStaircaseHeightUnlocked` | `boolean` | When `false`, height recomputes from steps × riser |
|
|
414
|
+
* | `storey` | `number` | Storey/floor level the staircase sits on |
|
|
415
|
+
*/
|
|
416
|
+
export declare const PluginStaircaseParams: z.ZodObject<{
|
|
417
|
+
staircaseType: z.ZodEnum<{
|
|
418
|
+
custom: "custom";
|
|
419
|
+
straight: "straight";
|
|
420
|
+
straightWoLanding: "straightWoLanding";
|
|
421
|
+
straightFlightWoMidLanding: "straightFlightWoMidLanding";
|
|
422
|
+
dogLegged: "dogLegged";
|
|
423
|
+
openWell: "openWell";
|
|
424
|
+
lShaped: "lShaped";
|
|
425
|
+
"3StepLShaped": "3StepLShaped";
|
|
426
|
+
square: "square";
|
|
427
|
+
singleStep: "singleStep";
|
|
428
|
+
plinthLevel: "plinthLevel";
|
|
429
|
+
amphitheatre: "amphitheatre";
|
|
430
|
+
connectingStepsToAmphitheatre: "connectingStepsToAmphitheatre";
|
|
431
|
+
mezzanineFloorStraight: "mezzanineFloorStraight";
|
|
432
|
+
mezzanineFloorDogLegged: "mezzanineFloorDogLegged";
|
|
433
|
+
mezzanineFloorLShaped: "mezzanineFloorLShaped";
|
|
434
|
+
}>;
|
|
435
|
+
staircasePreset: z.ZodEnum<{
|
|
436
|
+
custom: "custom";
|
|
437
|
+
straight: "straight";
|
|
438
|
+
straightWoLanding: "straightWoLanding";
|
|
439
|
+
straightFlightWoMidLanding: "straightFlightWoMidLanding";
|
|
440
|
+
dogLegged: "dogLegged";
|
|
441
|
+
openWell: "openWell";
|
|
442
|
+
lShaped: "lShaped";
|
|
443
|
+
"3StepLShaped": "3StepLShaped";
|
|
444
|
+
square: "square";
|
|
445
|
+
singleStep: "singleStep";
|
|
446
|
+
plinthLevel: "plinthLevel";
|
|
447
|
+
amphitheatre: "amphitheatre";
|
|
448
|
+
connectingStepsToAmphitheatre: "connectingStepsToAmphitheatre";
|
|
449
|
+
mezzanineFloorStraight: "mezzanineFloorStraight";
|
|
450
|
+
mezzanineFloorDogLegged: "mezzanineFloorDogLegged";
|
|
451
|
+
mezzanineFloorLShaped: "mezzanineFloorLShaped";
|
|
452
|
+
}>;
|
|
453
|
+
staircaseHeight: z.ZodNumber;
|
|
454
|
+
steps: z.ZodNumber;
|
|
455
|
+
riser: z.ZodNumber;
|
|
456
|
+
tread: z.ZodNumber;
|
|
457
|
+
width: z.ZodNumber;
|
|
458
|
+
depth: z.ZodNumber;
|
|
459
|
+
wellSize: z.ZodOptional<z.ZodNumber>;
|
|
460
|
+
landingWidth: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
flightStartDistAfterTurn: z.ZodOptional<z.ZodNumber>;
|
|
462
|
+
baseOffset: z.ZodNumber;
|
|
463
|
+
isStoreyHeightUnlocked: z.ZodBoolean;
|
|
464
|
+
isStaircaseHeightUnlocked: z.ZodBoolean;
|
|
465
|
+
storey: z.ZodNumber;
|
|
466
|
+
}, z.core.$strip>;
|
|
467
|
+
export type PluginStaircaseParams = z.infer<typeof PluginStaircaseParams>;
|
|
385
468
|
/**
|
|
386
469
|
* `design.query.*` — read-only enumeration + inspection of scene-committed BIM
|
|
387
470
|
* entities (all-handle model, §11). No query mutates the scene.
|
|
@@ -978,6 +1061,33 @@ export declare abstract class PluginDesignQueryApi {
|
|
|
978
1061
|
* ```
|
|
979
1062
|
*/
|
|
980
1063
|
abstract measure(component: ComponentHandle): PluginApiReturn<PluginEntityMeasurements | null>;
|
|
1064
|
+
/**
|
|
1065
|
+
* Read a staircase's parametric properties — its preset, dimensions, step
|
|
1066
|
+
* count, base offset, and height-lock state — as a
|
|
1067
|
+
* {@linkcode PluginStaircaseParams} record. The paired write is
|
|
1068
|
+
* `design.update.staircase`.
|
|
1069
|
+
*
|
|
1070
|
+
* All dimensions are in **engine units** (the same convention as
|
|
1071
|
+
* `design.doors.getWidth`); `steps` is a unitless count. A read — never
|
|
1072
|
+
* throws: returns `null` for a handle that is not a staircase or no longer
|
|
1073
|
+
* resolves.
|
|
1074
|
+
*
|
|
1075
|
+
* @param staircase - the staircase's {@linkcode ComponentHandle}
|
|
1076
|
+
* @returns the {@linkcode PluginStaircaseParams} record, or `null`
|
|
1077
|
+
*
|
|
1078
|
+
* @examplePrompt What's the riser height of this staircase?
|
|
1079
|
+
* @examplePrompt How many steps does the selected stair have?
|
|
1080
|
+
* @examplePrompt Show me the tread and width of this staircase
|
|
1081
|
+
* @examplePrompt Read all the parameters of the stairs on level 1
|
|
1082
|
+
*
|
|
1083
|
+
* # Example
|
|
1084
|
+
* ```ts
|
|
1085
|
+
* const [stair] = await snaptrude.design.query.listStaircases({ isSelected: true })
|
|
1086
|
+
* const params = stair ? await snaptrude.design.query.getStaircaseParams(stair) : null
|
|
1087
|
+
* if (params) console.log(params.steps, params.riser, params.tread)
|
|
1088
|
+
* ```
|
|
1089
|
+
*/
|
|
1090
|
+
abstract getStaircaseParams(staircase: ComponentHandle): PluginApiReturn<PluginStaircaseParams | null>;
|
|
981
1091
|
/**
|
|
982
1092
|
* Get the **union** axis-aligned bounding box enclosing a set of entities.
|
|
983
1093
|
*
|
|
@@ -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;
|
|
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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ACa,aAAa,CAC3B,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAE3C;;;;;;;;;;;;;;;;;;;;;;OAsBG;aACa,QAAQ,CACtB,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,MAAM,CAAC;IAE1B;;;;;;;;;;;;;;;;;;OAkBG;aACa,YAAY,CAC1B,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,eAAe,CAAC;IAEnC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;aACa,YAAY,CAC1B,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,eAAe,EAAE,CAAC;IAErC;;;;;;;;;;;;;;;;;;;;OAoBG;aACa,OAAO,CACrB,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,eAAe,GAAG,IAAI,CAAC;IAI1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;aACa,aAAa,CAC3B,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,sBAAsB,CAAC;IAE1C;;;;;;;;;;;;;;;;;;;OAmBG;aACa,OAAO,CACrB,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAEnD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;aACa,kBAAkB,CAChC,SAAS,EAAE,eAAe,GACzB,eAAe,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAEhD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;aACa,cAAc,CAC5B,UAAU,EAAE,eAAe,EAAE,GAC5B,eAAe,CAAC,cAAc,GAAG,IAAI,CAAC;CAC1C;AAED,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
|
@@ -44,6 +44,7 @@ export declare const PluginSelectionEntityType: z.ZodEnum<{
|
|
|
44
44
|
image: "image";
|
|
45
45
|
cad: "cad";
|
|
46
46
|
pdf: "pdf";
|
|
47
|
+
furniture: "furniture";
|
|
47
48
|
space: "space";
|
|
48
49
|
door: "door";
|
|
49
50
|
window: "window";
|
|
@@ -52,7 +53,6 @@ export declare const PluginSelectionEntityType: z.ZodEnum<{
|
|
|
52
53
|
column: "column";
|
|
53
54
|
beam: "beam";
|
|
54
55
|
staircase: "staircase";
|
|
55
|
-
furniture: "furniture";
|
|
56
56
|
referenceLine: "referenceLine";
|
|
57
57
|
pergola: "pergola";
|
|
58
58
|
sunshade: "sunshade";
|
|
@@ -85,6 +85,7 @@ export declare const PluginSelectionFilter: z.ZodObject<{
|
|
|
85
85
|
image: "image";
|
|
86
86
|
cad: "cad";
|
|
87
87
|
pdf: "pdf";
|
|
88
|
+
furniture: "furniture";
|
|
88
89
|
space: "space";
|
|
89
90
|
door: "door";
|
|
90
91
|
window: "window";
|
|
@@ -93,7 +94,6 @@ export declare const PluginSelectionFilter: z.ZodObject<{
|
|
|
93
94
|
column: "column";
|
|
94
95
|
beam: "beam";
|
|
95
96
|
staircase: "staircase";
|
|
96
|
-
furniture: "furniture";
|
|
97
97
|
referenceLine: "referenceLine";
|
|
98
98
|
pergola: "pergola";
|
|
99
99
|
sunshade: "sunshade";
|
|
@@ -5,8 +5,10 @@ import { PluginDesignChangeResult } from "../lock";
|
|
|
5
5
|
/**
|
|
6
6
|
* `snaptrude.design.transform` — rigid transforms on scene entities.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* `move` / `rotate` migrated from the removed `tools.transform.*`; `align` snaps a
|
|
9
|
+
* set of components' bounding-box edges to each other (or to a reference). All ops
|
|
10
|
+
* are undoable and return {@linkcode PluginDesignChangeResult} `{ affected }`;
|
|
11
|
+
* failures throw (RPC rejects).
|
|
10
12
|
*
|
|
11
13
|
* `mirror` / `getPosition` / `setPosition` (and `scale`, an engine gap) are NOT in
|
|
12
14
|
* this surface yet — they are a later, non-migration pass.
|
|
@@ -63,7 +65,64 @@ export declare abstract class PluginDesignTransformApi {
|
|
|
63
65
|
axis?: Vec3Handle;
|
|
64
66
|
is2D?: boolean;
|
|
65
67
|
}): PluginApiReturn<PluginDesignChangeResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Align a set of components by snapping one bounding-box edge to a common value
|
|
70
|
+
* — the classic Left/Center/Right/Top/Middle/Bottom align. Purely **world-axis**
|
|
71
|
+
* (deterministic and headless — the UI's camera-relative remap is bypassed):
|
|
72
|
+
*
|
|
73
|
+
* - `left` / `right` / `center` → world **X** min / max / mid
|
|
74
|
+
* - `top` / `bottom` / `middle` → world **Z** max / min / mid
|
|
75
|
+
*
|
|
76
|
+
* There is **no vertical (Y) alignment** in v1 (the UI only reaches it via a
|
|
77
|
+
* side-elevation camera remap, which this API does not replicate). Doors and
|
|
78
|
+
* windows are **rejected** in v1 — if any component in `components` (or the
|
|
79
|
+
* `reference`) is a door or window, the whole call **throws**; nothing is
|
|
80
|
+
* silently dropped. A group aligns as **one rigid body** (its whole-group
|
|
81
|
+
* bounding box moves together). Undoable.
|
|
82
|
+
*
|
|
83
|
+
* Requires **at least 2 components** unless a `reference` is supplied; with a
|
|
84
|
+
* reference, every component aligns to that reference's edge (the reference does
|
|
85
|
+
* not move) and a single component is allowed. Y (height) is preserved.
|
|
86
|
+
*
|
|
87
|
+
* @param components - Entities to align (≥2 without a `reference`)
|
|
88
|
+
* @param edge - Which bounding-box edge to snap ({@linkcode PluginAlignEdge})
|
|
89
|
+
* @param options - `reference`: a component whose edge is the fixed target
|
|
90
|
+
* @returns {@linkcode PluginDesignChangeResult}
|
|
91
|
+
*
|
|
92
|
+
* @examplePrompt Align the selected rooms to the left
|
|
93
|
+
* @examplePrompt Line up these masses along their top edges
|
|
94
|
+
* @examplePrompt Center these columns horizontally
|
|
95
|
+
* @examplePrompt Align all the walls to the left edge of this reference wall
|
|
96
|
+
* @examplePrompt Snap the bottom edges of these spaces together
|
|
97
|
+
*
|
|
98
|
+
* # Example
|
|
99
|
+
* ```ts
|
|
100
|
+
* const rooms = await snaptrude.design.selection.get()
|
|
101
|
+
* // align every room's left (world -X) edge to a common minimum
|
|
102
|
+
* await snaptrude.design.transform.align(rooms, "left")
|
|
103
|
+
* // …or align them to a fixed reference component's left edge
|
|
104
|
+
* const [anchor] = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
105
|
+
* await snaptrude.design.transform.align(rooms, "left", { reference: anchor })
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
abstract align(components: ComponentHandle[], edge: PluginAlignEdge, options?: {
|
|
109
|
+
reference?: ComponentHandle;
|
|
110
|
+
}): PluginApiReturn<PluginDesignChangeResult>;
|
|
66
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* The bounding-box edge an {@linkcode PluginDesignTransformApi.align} snaps to.
|
|
114
|
+
* Mirrors the engine's align `DirectionType`. World-axis mapping: `left`/`right`/`center`
|
|
115
|
+
* → world X min/max/mid; `top`/`bottom`/`middle` → world Z max/min/mid.
|
|
116
|
+
*/
|
|
117
|
+
export declare const PluginAlignEdge: z.ZodEnum<{
|
|
118
|
+
center: "center";
|
|
119
|
+
left: "left";
|
|
120
|
+
right: "right";
|
|
121
|
+
top: "top";
|
|
122
|
+
bottom: "bottom";
|
|
123
|
+
middle: "middle";
|
|
124
|
+
}>;
|
|
125
|
+
export type PluginAlignEdge = z.infer<typeof PluginAlignEdge>;
|
|
67
126
|
/**
|
|
68
127
|
* Arguments for {@linkcode PluginDesignTransformApi.move} (options flattened).
|
|
69
128
|
*/
|
|
@@ -84,4 +143,26 @@ export declare const PluginDesignRotateArgs: z.ZodObject<{
|
|
|
84
143
|
is2D: z.ZodOptional<z.ZodBoolean>;
|
|
85
144
|
}, z.core.$strip>;
|
|
86
145
|
export type PluginDesignRotateArgs = z.infer<typeof PluginDesignRotateArgs>;
|
|
146
|
+
/**
|
|
147
|
+
* Arguments for {@linkcode PluginDesignTransformApi.align} (options flattened).
|
|
148
|
+
*
|
|
149
|
+
* | Property | Type | Description |
|
|
150
|
+
* |---|---|---|
|
|
151
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to align (≥2 unless `reference` is set — host-enforced) |
|
|
152
|
+
* | `edge` | {@linkcode PluginAlignEdge} | Which bounding-box edge to snap |
|
|
153
|
+
* | `reference` | {@linkcode ComponentHandle} | A fixed component whose edge is the target (optional) |
|
|
154
|
+
*/
|
|
155
|
+
export declare const PluginDesignAlignArgs: z.ZodObject<{
|
|
156
|
+
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
157
|
+
edge: z.ZodEnum<{
|
|
158
|
+
center: "center";
|
|
159
|
+
left: "left";
|
|
160
|
+
right: "right";
|
|
161
|
+
top: "top";
|
|
162
|
+
bottom: "bottom";
|
|
163
|
+
middle: "middle";
|
|
164
|
+
}>;
|
|
165
|
+
reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
export type PluginDesignAlignArgs = z.infer<typeof PluginDesignAlignArgs>;
|
|
87
168
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/transform/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/transform/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,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