@snaptrude/plugin-core 0.0.0-dev-20260708130115 → 0.0.0-dev-20260827194031
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 +152 -1
- package/api-manifest.json +3643 -276
- package/dist/api/analysis/daylight.d.ts +603 -0
- package/dist/api/analysis/daylight.d.ts.map +1 -0
- package/dist/api/analysis/heatmaps.d.ts +658 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +59 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/solar.d.ts +249 -0
- package/dist/api/analysis/solar.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/analysis/weather.d.ts +193 -0
- package/dist/api/analysis/weather.d.ts.map +1 -0
- package/dist/api/core/camera/index.d.ts +261 -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 +840 -14
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- 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 +130 -18
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- 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 +34 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/export/index.d.ts +134 -0
- package/dist/api/core/io/export/index.d.ts.map +1 -0
- package/dist/api/core/io/import/index.d.ts +453 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +40 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +341 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +805 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +7 -7
- package/dist/api/core/mode/index.d.ts +99 -0
- package/dist/api/core/mode/index.d.ts.map +1 -0
- package/dist/api/core/project/index.d.ts +68 -1
- package/dist/api/core/project/index.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +531 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/core/storeys/index.d.ts +265 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +24 -0
- package/dist/api/core/tags.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/core/zoom/index.d.ts +4 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/boolean/index.d.ts +4 -4
- package/dist/api/design/create/index.d.ts +568 -45
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +3 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +195 -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/family.d.ts +493 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +181 -8
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +98 -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 +270 -16
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/geometry/index.d.ts +112 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +289 -11
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/referenceLines.d.ts +45 -0
- package/dist/api/design/query/referenceLines.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +181 -8
- package/dist/api/design/query/spaces.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +144 -0
- package/dist/api/design/selection/index.d.ts.map +1 -1
- package/dist/api/design/transform/index.d.ts +172 -10
- 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 +553 -2
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +126 -0
- package/dist/api/design/visibility.d.ts.map +1 -0
- 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/buildableEnvelope.d.ts +4 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +10 -2
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +21 -21
- package/dist/api/entity/story.d.ts +242 -15
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +25 -25
- package/dist/api/presentation/annotate.d.ts +467 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +111 -8
- package/dist/api/presentation/diagrams.d.ts.map +1 -1
- package/dist/api/presentation/export.d.ts +108 -0
- package/dist/api/presentation/export.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +55 -4
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +58 -1
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +1139 -0
- package/dist/api/presentation/placedViews.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +481 -0
- package/dist/api/presentation/shapes.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +452 -13
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/slideshow.d.ts +125 -0
- package/dist/api/presentation/slideshow.d.ts.map +1 -0
- package/dist/api/presentation/tables.d.ts +81 -0
- package/dist/api/presentation/tables.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +367 -7
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +102 -12
- 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 +7 -15
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +346 -11
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +469 -13
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/api/program/spreadsheet.d.ts +365 -41
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +505 -0
- package/dist/api/workspace/index.d.ts.map +1 -0
- 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/handles.d.ts +97 -25
- package/dist/handles.d.ts.map +1 -1
- package/dist/host-utils.d.ts +4 -0
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +4605 -1423
- 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 +4191 -1412
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/scripts/generate-manifest.mjs +45 -0
- package/scripts/generate-manifest.test.mjs +103 -4
- package/src/api/analysis/daylight.ts +470 -0
- package/src/api/analysis/heatmaps.ts +683 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +61 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/solar.ts +237 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/analysis/weather.ts +179 -0
- package/src/api/core/camera/index.ts +268 -0
- package/src/api/core/comment/index.ts +120 -2
- package/src/api/core/geom/create/index.ts +912 -1
- package/src/api/core/geom/delete/index.ts +6 -0
- package/src/api/core/geom/query/brep.ts +119 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/index.ts +34 -0
- package/src/api/core/io/export/index.ts +126 -0
- package/src/api/core/io/import/index.ts +496 -0
- package/src/api/core/io/index.ts +42 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +360 -0
- package/src/api/core/io/underlay/index.ts +705 -0
- package/src/api/core/mode/index.ts +96 -0
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/proposals/index.ts +569 -0
- package/src/api/core/storeys/index.ts +294 -0
- package/src/api/core/tags.ts +27 -0
- package/src/api/core/user.ts +46 -0
- package/src/api/core/zoom/index.ts +4 -0
- package/src/api/design/create/index.ts +670 -30
- package/src/api/design/delete/index.ts +3 -0
- package/src/api/design/doors/index.ts +208 -0
- package/src/api/design/erase/index.ts +1 -1
- package/src/api/design/family.ts +544 -0
- package/src/api/design/furniture/index.ts +197 -8
- package/src/api/design/index.ts +102 -0
- package/src/api/design/lock.ts +27 -0
- package/src/api/design/materials/index.ts +334 -27
- package/src/api/design/query/geometry/index.ts +125 -3
- package/src/api/design/query/index.ts +219 -7
- package/src/api/design/query/referenceLines.ts +52 -0
- package/src/api/design/query/spaces.ts +143 -0
- package/src/api/design/selection/index.ts +129 -0
- package/src/api/design/transform/index.ts +170 -9
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +631 -3
- package/src/api/design/visibility.ts +143 -0
- package/src/api/design/windows/index.ts +128 -2
- package/src/api/entity/buildableEnvelope.ts +4 -0
- package/src/api/entity/referenceLine.ts +8 -0
- package/src/api/entity/story.ts +259 -15
- package/src/api/index.ts +10 -0
- package/src/api/presentation/annotate.ts +385 -0
- package/src/api/presentation/diagrams.ts +118 -8
- package/src/api/presentation/export.ts +108 -0
- package/src/api/presentation/import.ts +51 -4
- package/src/api/presentation/index.ts +66 -1
- package/src/api/presentation/placedViews.ts +1120 -0
- package/src/api/presentation/shapes.ts +274 -0
- package/src/api/presentation/sheets.ts +400 -13
- package/src/api/presentation/slideshow.ts +134 -0
- package/src/api/presentation/tables.ts +84 -0
- package/src/api/presentation/views.ts +376 -8
- package/src/api/program/areas.ts +88 -15
- package/src/api/program/cores.ts +3 -91
- package/src/api/program/index.ts +7 -15
- package/src/api/program/layout.ts +365 -11
- package/src/api/program/site.ts +435 -13
- package/src/api/program/spreadsheet.ts +376 -35
- package/src/api/workspace/index.ts +563 -0
- 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/handles.ts +123 -13
- package/src/host-utils.ts +4 -0
- package/src/index.ts +1 -0
- package/test/errors.test.mjs +184 -0
- package/tsconfig.json +7 -2
|
@@ -2,6 +2,8 @@ import * as z from "zod";
|
|
|
2
2
|
import { PluginApiReturn } from "../../../types";
|
|
3
3
|
import { ComponentHandle } from "../../../handles";
|
|
4
4
|
import { PluginSpaceUpdateResult } from "../../entity/space";
|
|
5
|
+
import { PluginDesignChangeResult } from "../lock";
|
|
6
|
+
import { PluginBuildableEnvelopePolygonVertex, PluginBuildableEnvelopeSetbackTier, PluginBuildableEnvelopeVerticalCap, PluginBuildableEnvelopeUpdateResult } from "../../entity/buildableEnvelope";
|
|
5
7
|
/**
|
|
6
8
|
* Sparse property updates for a space. Only provided fields change.
|
|
7
9
|
*
|
|
@@ -56,7 +58,7 @@ export declare const PluginSpacePropertyUpdates: z.ZodObject<{
|
|
|
56
58
|
export type PluginSpacePropertyUpdates = z.infer<typeof PluginSpacePropertyUpdates>;
|
|
57
59
|
/** Geometry replacement for a space — re-extrude a profile. */
|
|
58
60
|
export declare const PluginSpaceGeometryUpdate: z.ZodObject<{
|
|
59
|
-
profile: z.ZodPipe<z.
|
|
61
|
+
profile: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"profile">, string>>;
|
|
60
62
|
extrudeHeight: z.ZodNumber;
|
|
61
63
|
}, z.core.$strip>;
|
|
62
64
|
export type PluginSpaceGeometryUpdate = z.infer<typeof PluginSpaceGeometryUpdate>;
|
|
@@ -104,11 +106,178 @@ export declare const PluginUpdateSpaceItem: z.ZodObject<{
|
|
|
104
106
|
}>, z.ZodUUID]>>;
|
|
105
107
|
}, z.core.$strip>>;
|
|
106
108
|
geometry: z.ZodOptional<z.ZodObject<{
|
|
107
|
-
profile: z.ZodPipe<z.
|
|
109
|
+
profile: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"profile">, string>>;
|
|
108
110
|
extrudeHeight: z.ZodNumber;
|
|
109
111
|
}, z.core.$strip>>;
|
|
110
112
|
}, z.core.$strip>;
|
|
111
113
|
export type PluginUpdateSpaceItem = z.infer<typeof PluginUpdateSpaceItem>;
|
|
114
|
+
/**
|
|
115
|
+
* Wire schema for {@linkcode PluginDesignUpdateApi.setLabel}.
|
|
116
|
+
*
|
|
117
|
+
* | Property | Type | Description |
|
|
118
|
+
* |---|---|---|
|
|
119
|
+
* | `component` | `ComponentHandle` | The component to relabel |
|
|
120
|
+
* | `label` | `string` | New label (non-empty after trimming) |
|
|
121
|
+
*/
|
|
122
|
+
export declare const PluginDesignSetLabelArgs: z.ZodObject<{
|
|
123
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
124
|
+
label: z.ZodString;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export type PluginDesignSetLabelArgs = z.infer<typeof PluginDesignSetLabelArgs>;
|
|
127
|
+
/**
|
|
128
|
+
* Sparse parametric updates for a staircase (all fields optional; at least one
|
|
129
|
+
* required). Only the fields you provide change. Consumed by
|
|
130
|
+
* {@linkcode PluginDesignUpdateApi.staircase}; the paired read is
|
|
131
|
+
* `design.query.getStaircaseParams`.
|
|
132
|
+
*
|
|
133
|
+
* All dimensions are in **engine units** (the same convention as
|
|
134
|
+
* `design.doors.setWidth`); `steps` is a unitless integer count. Height, riser,
|
|
135
|
+
* and step count are **coupled** (`staircaseHeight = steps × riser`); the two
|
|
136
|
+
* lock booleans govern which value recomputes — see the method JSDoc.
|
|
137
|
+
*
|
|
138
|
+
* | Property | Type | Description |
|
|
139
|
+
* |---|---|---|
|
|
140
|
+
* | `isStoreyHeightUnlocked` | `boolean`? | Unlock the staircase height from the storey height |
|
|
141
|
+
* | `isStaircaseHeightUnlocked` | `boolean`? | Unlock the height from `steps × riser` |
|
|
142
|
+
* | `storeyHeight` | `number`? | Storey height the stair sits within (engine units) |
|
|
143
|
+
* | `staircaseHeight` | `number`? | Total rise (engine units) |
|
|
144
|
+
* | `steps` | `number`? | Step count (unitless integer) |
|
|
145
|
+
* | `riser` | `number`? | Riser height (engine units) |
|
|
146
|
+
* | `tread` | `number`? | Tread depth (engine units) |
|
|
147
|
+
* | `width` | `number`? | Flight width (engine units) |
|
|
148
|
+
* | `depth` | `number`? | Slab/waist thickness (engine units) |
|
|
149
|
+
* | `wellSize` | `number`? | Stairwell gap (dogLegged / openWell / square) |
|
|
150
|
+
* | `flightStartDistAfterTurn` | `number`? | Flight offset after a turn (dogLegged / lShaped / square) |
|
|
151
|
+
* | `landingWidth` | `number`? | Landing depth (straight / dogLegged) |
|
|
152
|
+
* | `baseOffset` | `number`? | Vertical offset from the storey base (engine units) |
|
|
153
|
+
*/
|
|
154
|
+
export declare const PluginStaircaseParamUpdates: z.ZodObject<{
|
|
155
|
+
isStoreyHeightUnlocked: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
isStaircaseHeightUnlocked: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
storeyHeight: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
staircaseHeight: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
steps: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
riser: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
tread: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
wellSize: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
flightStartDistAfterTurn: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
landingWidth: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
baseOffset: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
export type PluginStaircaseParamUpdates = z.infer<typeof PluginStaircaseParamUpdates>;
|
|
170
|
+
/**
|
|
171
|
+
* Arguments for {@linkcode PluginDesignUpdateApi.staircase}.
|
|
172
|
+
*
|
|
173
|
+
* | Property | Type | Description |
|
|
174
|
+
* |---|---|---|
|
|
175
|
+
* | `staircases` | {@linkcode ComponentHandle}`[]` | The staircases to update |
|
|
176
|
+
* | `params` | {@linkcode PluginStaircaseParamUpdates} | Sparse parametric changes (≥ 1 field) |
|
|
177
|
+
*/
|
|
178
|
+
export declare const PluginDesignUpdateStaircaseArgs: z.ZodObject<{
|
|
179
|
+
staircases: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
180
|
+
params: z.ZodObject<{
|
|
181
|
+
isStoreyHeightUnlocked: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
isStaircaseHeightUnlocked: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
storeyHeight: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
staircaseHeight: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
steps: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
riser: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
tread: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
wellSize: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
flightStartDistAfterTurn: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
landingWidth: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
baseOffset: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
export type PluginDesignUpdateStaircaseArgs = z.infer<typeof PluginDesignUpdateStaircaseArgs>;
|
|
197
|
+
/**
|
|
198
|
+
* Sparse edits for a wall (all optional; at least one required). Only the
|
|
199
|
+
* fields you provide change. Dimensions are in **engine units** (the same
|
|
200
|
+
* convention as `design.doors.setWidth`). Consumed by
|
|
201
|
+
* {@linkcode PluginDesignUpdateApi.wall}.
|
|
202
|
+
*
|
|
203
|
+
* | Property | Type | Description |
|
|
204
|
+
* |---|---|---|
|
|
205
|
+
* | `thickness` | `number`? | Wall thickness, engine units (> 0) |
|
|
206
|
+
* | `height` | `number`? | Wall height, engine units (> 0) |
|
|
207
|
+
* | `type` | `string`? | Convert the wall to another wall type — a name (or `wall:`-prefixed id) from `design.types.list("wall")` |
|
|
208
|
+
*/
|
|
209
|
+
export declare const PluginWallUpdates: z.ZodObject<{
|
|
210
|
+
thickness: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
212
|
+
type: z.ZodOptional<z.ZodString>;
|
|
213
|
+
}, z.core.$strip>;
|
|
214
|
+
export type PluginWallUpdates = z.infer<typeof PluginWallUpdates>;
|
|
215
|
+
/**
|
|
216
|
+
* Sparse dimension edits for a slab-family element (slab / floor / roof /
|
|
217
|
+
* ceiling). All values are engine units, the same convention as
|
|
218
|
+
* `design.doors.setWidth`. Consumed by {@linkcode PluginDesignUpdateApi.slab},
|
|
219
|
+
* `floor`, `roof`, and `ceiling`.
|
|
220
|
+
*
|
|
221
|
+
* `overhang` is only available on **slabs and roofs** (the panel's Overhang
|
|
222
|
+
* slider) — floors and ceilings reject it with `PRECONDITION_FAILED`.
|
|
223
|
+
*
|
|
224
|
+
* | Property | Type | Description |
|
|
225
|
+
* |---|---|---|
|
|
226
|
+
* | `thickness` | `number`? | Element thickness, engine units (> 0) |
|
|
227
|
+
* | `overhang` | `number`? | Absolute overhang offset, engine units (slab / roof only) |
|
|
228
|
+
*/
|
|
229
|
+
export declare const PluginSlabUpdates: z.ZodObject<{
|
|
230
|
+
thickness: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
overhang: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export type PluginSlabUpdates = z.infer<typeof PluginSlabUpdates>;
|
|
234
|
+
/** Arguments for {@linkcode PluginDesignUpdateApi.wall}. */
|
|
235
|
+
export declare const PluginDesignUpdateWallArgs: z.ZodObject<{
|
|
236
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
237
|
+
updates: z.ZodObject<{
|
|
238
|
+
thickness: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
240
|
+
type: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
export type PluginDesignUpdateWallArgs = z.infer<typeof PluginDesignUpdateWallArgs>;
|
|
244
|
+
/**
|
|
245
|
+
* Arguments for the slab-family updaters —
|
|
246
|
+
* {@linkcode PluginDesignUpdateApi.slab}, `floor`, `roof`, `ceiling`.
|
|
247
|
+
*/
|
|
248
|
+
export declare const PluginDesignUpdateSlabArgs: z.ZodObject<{
|
|
249
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
250
|
+
updates: z.ZodObject<{
|
|
251
|
+
thickness: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
overhang: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
}, z.core.$strip>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
export type PluginDesignUpdateSlabArgs = z.infer<typeof PluginDesignUpdateSlabArgs>;
|
|
256
|
+
/** Arguments for {@linkcode PluginDesignUpdateApi.setElevation}. */
|
|
257
|
+
export declare const PluginDesignSetElevationArgs: z.ZodObject<{
|
|
258
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
259
|
+
elevation: z.ZodNumber;
|
|
260
|
+
}, z.core.$strip>;
|
|
261
|
+
export type PluginDesignSetElevationArgs = z.infer<typeof PluginDesignSetElevationArgs>;
|
|
262
|
+
/** Arguments for {@linkcode PluginDesignUpdateApi.setBaseOffset}. */
|
|
263
|
+
export declare const PluginDesignSetBaseOffsetArgs: z.ZodObject<{
|
|
264
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
265
|
+
offset: z.ZodNumber;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
export type PluginDesignSetBaseOffsetArgs = z.infer<typeof PluginDesignSetBaseOffsetArgs>;
|
|
268
|
+
/**
|
|
269
|
+
* Arguments for {@linkcode PluginDesignUpdateApi.setStorey}.
|
|
270
|
+
*
|
|
271
|
+
* | Property | Type | Description |
|
|
272
|
+
* |---|---|---|
|
|
273
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | The components to reassign |
|
|
274
|
+
* | `storey` | `number` | Target integer storey number (`entity.story` convention; must exist) |
|
|
275
|
+
*/
|
|
276
|
+
export declare const PluginDesignSetStoreyArgs: z.ZodObject<{
|
|
277
|
+
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
278
|
+
storey: z.ZodNumber;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
export type PluginDesignSetStoreyArgs = z.infer<typeof PluginDesignSetStoreyArgs>;
|
|
112
281
|
/**
|
|
113
282
|
* `snaptrude.design.update` — edit existing scene entities (properties + geometry).
|
|
114
283
|
*
|
|
@@ -117,6 +286,45 @@ export type PluginUpdateSpaceItem = z.infer<typeof PluginUpdateSpaceItem>;
|
|
|
117
286
|
*/
|
|
118
287
|
export declare abstract class PluginDesignUpdateApi {
|
|
119
288
|
constructor();
|
|
289
|
+
/**
|
|
290
|
+
* Set a component's **Label** — the same editable Label field the properties
|
|
291
|
+
* panel shows (doors, windows, furniture, spaces, and every other labelled
|
|
292
|
+
* component). The paired read is `design.query.getLabel`. Undoable; the
|
|
293
|
+
* canvas label text updates immediately.
|
|
294
|
+
*
|
|
295
|
+
* Strictly **per component**: labelling one door of a placed family never
|
|
296
|
+
* touches its sibling doors (the panel's Label edit, by contrast, applies to
|
|
297
|
+
* the whole family). On **legacy masses** without a space type, panel parity
|
|
298
|
+
* applies — a label matching a room-type preset with a height can also
|
|
299
|
+
* adjust the mass's height and material, exactly like typing it in the panel.
|
|
300
|
+
*
|
|
301
|
+
* Throws when the component is locked, the handle is gone/forged, the label
|
|
302
|
+
* is empty, or the component has no mesh to label. Re-applying the current
|
|
303
|
+
* label is a no-op that returns `true` without touching the undo stack.
|
|
304
|
+
*
|
|
305
|
+
* @param component - The component to relabel
|
|
306
|
+
* @param label - New label text (non-empty; leading/trailing whitespace trimmed)
|
|
307
|
+
* @returns `true` once the label is applied
|
|
308
|
+
*
|
|
309
|
+
* @examplePrompt Rename this door to D-101
|
|
310
|
+
* @examplePrompt Number all doors on storey 2 with a D-2-XX tag
|
|
311
|
+
* @examplePrompt Set the selected window's label to W-04
|
|
312
|
+
* @examplePrompt Tag every door with its fire rating
|
|
313
|
+
*
|
|
314
|
+
* # Example
|
|
315
|
+
* ```ts
|
|
316
|
+
* // Door tag numbering: label every door as D-<storey>-<n>, numbered per storey
|
|
317
|
+
* await snaptrude.design.selection.setByFilter({ types: ["door"] })
|
|
318
|
+
* const doors = await snaptrude.design.selection.get()
|
|
319
|
+
* const counts = {}
|
|
320
|
+
* for (const door of doors) {
|
|
321
|
+
* const { storey = 0 } = await snaptrude.design.query.getProperties(door)
|
|
322
|
+
* counts[storey] = (counts[storey] ?? 0) + 1
|
|
323
|
+
* await snaptrude.design.update.setLabel(door, `D-${storey}-${String(counts[storey]).padStart(2, "0")}`)
|
|
324
|
+
* }
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
abstract setLabel(component: ComponentHandle, label: string): PluginApiReturn<boolean>;
|
|
120
328
|
/**
|
|
121
329
|
* Update a single space (room) — change its properties (room label, space
|
|
122
330
|
* type, mass type, area class, department) and/or replace its geometry by
|
|
@@ -133,6 +341,9 @@ export declare abstract class PluginDesignUpdateApi {
|
|
|
133
341
|
* @examplePrompt Move this space into the Circulation department
|
|
134
342
|
* @examplePrompt Exclude this room from the area calculations
|
|
135
343
|
*
|
|
344
|
+
* @performance For MORE THAN ONE space, call `design.update.spaces(items[])` — the whole
|
|
345
|
+
* batch is one host round-trip. Looping this single-space updater is N round-trips.
|
|
346
|
+
*
|
|
136
347
|
* # Example
|
|
137
348
|
* ```ts
|
|
138
349
|
* await snaptrude.design.update.space("space-id", { properties: { room_type: "Office" } })
|
|
@@ -159,6 +370,9 @@ export declare abstract class PluginDesignUpdateApi {
|
|
|
159
370
|
* @examplePrompt Bulk-assign these spaces to the Service department
|
|
160
371
|
* @examplePrompt Mark all of these rooms as excluded from area in one update
|
|
161
372
|
*
|
|
373
|
+
* @performance Bulk update — the whole batch is ONE host round-trip. Prefer over looping
|
|
374
|
+
* `design.update.space`: build the `items[]` array first, then make one call.
|
|
375
|
+
*
|
|
162
376
|
* # Example
|
|
163
377
|
* ```ts
|
|
164
378
|
* // Re-label every selected room and mark it NET area — one undoable bulk update
|
|
@@ -174,5 +388,342 @@ export declare abstract class PluginDesignUpdateApi {
|
|
|
174
388
|
* ```
|
|
175
389
|
*/
|
|
176
390
|
abstract spaces(items: PluginUpdateSpaceItem[]): PluginApiReturn<PluginSpaceUpdateResult[]>;
|
|
391
|
+
/**
|
|
392
|
+
* Update the parameters of one or more staircases — riser, tread, width,
|
|
393
|
+
* depth, step count, total height, well size, landing depth, base offset,
|
|
394
|
+
* and the two height locks — in one undoable operation. Sparse: only the
|
|
395
|
+
* fields you provide change. The paired read is
|
|
396
|
+
* `design.query.getStaircaseParams`.
|
|
397
|
+
*
|
|
398
|
+
* All dimensions are in **engine units** (the same convention as
|
|
399
|
+
* `design.doors.setWidth`); `steps` is a unitless integer count. The height,
|
|
400
|
+
* riser, and step count are **coupled** — `staircaseHeight = steps × riser` —
|
|
401
|
+
* and the two lock booleans govern which value recomputes when another
|
|
402
|
+
* changes. With `isStoreyHeightUnlocked` false the staircase height follows
|
|
403
|
+
* the storey height; unlocking it also unlocks the staircase height. Setting
|
|
404
|
+
* `steps` recomputes `riser` (or the height, once the height is unlocked),
|
|
405
|
+
* and setting `riser` recomputes `steps`/height in turn.
|
|
406
|
+
*
|
|
407
|
+
* Presets-only: this edits the parametric fields of a preset staircase; it
|
|
408
|
+
* does not change the staircase's type/preset (there is no in-place re-type).
|
|
409
|
+
* Every edit rebuilds the staircase geometry, so the call is async.
|
|
410
|
+
*
|
|
411
|
+
* Throws when a handle is not a staircase, when a staircase is locked, or
|
|
412
|
+
* when a value falls outside the engine's accepted range (RPC rejects).
|
|
413
|
+
*
|
|
414
|
+
* @param staircases - the staircases to update
|
|
415
|
+
* @param params - sparse {@linkcode PluginStaircaseParamUpdates} (at least one field)
|
|
416
|
+
* @returns the affected staircases
|
|
417
|
+
*
|
|
418
|
+
* @examplePrompt Set the riser of this staircase to 165mm
|
|
419
|
+
* @examplePrompt Change all the stairs to 14 steps
|
|
420
|
+
* @examplePrompt Make the selected staircase 1200 wide with a 280 tread
|
|
421
|
+
* @examplePrompt Widen every staircase on level 1 to 1 metre
|
|
422
|
+
* @examplePrompt Unlock the height and set this stair to 3200 tall
|
|
423
|
+
*
|
|
424
|
+
* # Example
|
|
425
|
+
* ```ts
|
|
426
|
+
* // Give every ground-floor staircase a common riser + tread (engine units)
|
|
427
|
+
* const stairs = await snaptrude.design.query.listStaircases({ storeys: [1] })
|
|
428
|
+
* const { affected } = await snaptrude.design.update.staircase(stairs, {
|
|
429
|
+
* riser: 165,
|
|
430
|
+
* tread: 280,
|
|
431
|
+
* })
|
|
432
|
+
* console.log("updated", affected.length, "staircases")
|
|
433
|
+
* ```
|
|
434
|
+
*/
|
|
435
|
+
abstract staircase(staircases: ComponentHandle[], params: PluginStaircaseParamUpdates): PluginApiReturn<PluginDesignChangeResult>;
|
|
436
|
+
/**
|
|
437
|
+
* Edit a **wall** — its thickness and/or height (the same command the
|
|
438
|
+
* properties panel's Thickness/Height fields drive) and/or its **wall type**
|
|
439
|
+
* (the panel's Wall Types dropdown: converts the wall to another type,
|
|
440
|
+
* rebuilding its layer stack and materials). Sparse: only the fields you
|
|
441
|
+
* provide change. Undoable; the geometry rebuilds and any dimension lines
|
|
442
|
+
* refresh. Stacked-wall companions and hosted fenestration are handled
|
|
443
|
+
* exactly as the panel does.
|
|
444
|
+
*
|
|
445
|
+
* Thickness/height are in **engine units** (the same convention as
|
|
446
|
+
* `design.doors.setWidth`) and must be `> 0`. Shrinking a wall past its
|
|
447
|
+
* openings is rejected by the engine (the wall is skipped with no change).
|
|
448
|
+
* `type` accepts a type name from `design.types.list("wall")` (or its
|
|
449
|
+
* `wall:`-prefixed id); when combined with dimensions, the type conversion
|
|
450
|
+
* is applied first so an explicit thickness/height wins over the type's
|
|
451
|
+
* defaults. Re-applying the wall's current type is a no-op.
|
|
452
|
+
*
|
|
453
|
+
* Throws when the handle is not a wall, when the wall is locked, when the
|
|
454
|
+
* handle is gone/forged, when `type` names an unknown wall type, when the
|
|
455
|
+
* engine rejects the conversion (e.g. a curved wall thinner than the new
|
|
456
|
+
* type's minimum thickness), or when no field is provided.
|
|
457
|
+
*
|
|
458
|
+
* A type conversion (and a thickness edit on a parametric wall) REBUILDS the
|
|
459
|
+
* wall, replacing it with a new component: the input handle is then dead
|
|
460
|
+
* (further calls throw HANDLE_INVALID) and `affected[0]` carries the
|
|
461
|
+
* replacement's handle — use it for any follow-up calls.
|
|
462
|
+
*
|
|
463
|
+
* @param component - The wall to edit
|
|
464
|
+
* @param updates - Sparse {@linkcode PluginWallUpdates} (at least one field)
|
|
465
|
+
* @returns the affected wall — after a rebuild, the REPLACEMENT wall's handle
|
|
466
|
+
*
|
|
467
|
+
* @examplePrompt Make this wall 230mm thick
|
|
468
|
+
* @examplePrompt Set the selected wall's height to 3 metres
|
|
469
|
+
* @examplePrompt Thicken every exterior wall to 300
|
|
470
|
+
* @examplePrompt Change this wall to a Glass Wall
|
|
471
|
+
* @examplePrompt Convert all the partitions on this floor to Brick Wall
|
|
472
|
+
*
|
|
473
|
+
* # Example
|
|
474
|
+
* ```ts
|
|
475
|
+
* // Convert every wall on storey 1 to the first listed wall type
|
|
476
|
+
* const [wallType] = await snaptrude.design.types.list("wall")
|
|
477
|
+
* const walls = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
478
|
+
* for (const wall of walls) {
|
|
479
|
+
* await snaptrude.design.update.wall(wall, { type: wallType.id })
|
|
480
|
+
* }
|
|
481
|
+
* ```
|
|
482
|
+
*/
|
|
483
|
+
abstract wall(component: ComponentHandle, updates: PluginWallUpdates): PluginApiReturn<PluginDesignChangeResult>;
|
|
484
|
+
/**
|
|
485
|
+
* Edit a **slab's** thickness and/or overhang — the same commands the
|
|
486
|
+
* properties panel's Thickness field and Overhang slider drive. Sparse: only
|
|
487
|
+
* the fields you provide change. Undoable; the slab rebuilds and dimension
|
|
488
|
+
* lines refresh. Both values are in **engine units** (the same convention as
|
|
489
|
+
* `design.doors.setWidth`); thickness must be `> 0`, overhang is an absolute
|
|
490
|
+
* offset (negative insets the slab) and re-applying the current overhang is
|
|
491
|
+
* a no-op.
|
|
492
|
+
*
|
|
493
|
+
* Throws when the handle is not a slab, when it is locked, when the handle is
|
|
494
|
+
* gone/forged, when `overhang` is set on a slab that has no overhang (plinth /
|
|
495
|
+
* basement slabs, or overhang disabled), or when no field is provided.
|
|
496
|
+
*
|
|
497
|
+
* @param component - The slab to edit
|
|
498
|
+
* @param updates - Sparse {@linkcode PluginSlabUpdates} (at least one field)
|
|
499
|
+
* @returns the affected slab
|
|
500
|
+
*
|
|
501
|
+
* @examplePrompt Set this slab's thickness to 250mm
|
|
502
|
+
* @examplePrompt Make the floor slab 300 thick
|
|
503
|
+
* @examplePrompt Give this slab a 200 overhang
|
|
504
|
+
* @examplePrompt Remove the overhang on every slab on level 2
|
|
505
|
+
*
|
|
506
|
+
* # Example
|
|
507
|
+
* ```ts
|
|
508
|
+
* const [slab] = await snaptrude.design.query.listSlabs()
|
|
509
|
+
* await snaptrude.design.update.slab(slab, { thickness: 250, overhang: 200 })
|
|
510
|
+
* ```
|
|
511
|
+
*/
|
|
512
|
+
abstract slab(component: ComponentHandle, updates: PluginSlabUpdates): PluginApiReturn<PluginDesignChangeResult>;
|
|
513
|
+
/**
|
|
514
|
+
* Edit a **floor's** thickness — the slab-family updater for floors (shares
|
|
515
|
+
* the slab thickness command). Undoable. Thickness is in **engine units**
|
|
516
|
+
* (the `design.doors.setWidth` convention) and must be `> 0`. Floors have no
|
|
517
|
+
* Overhang control, so `overhang` is rejected with `PRECONDITION_FAILED`.
|
|
518
|
+
*
|
|
519
|
+
* Throws when the handle is not a floor, when it is locked, when the handle
|
|
520
|
+
* is gone/forged, when `overhang` is provided, or when no field is provided.
|
|
521
|
+
*
|
|
522
|
+
* @param component - The floor to edit
|
|
523
|
+
* @param updates - {@linkcode PluginSlabUpdates} (a `thickness`)
|
|
524
|
+
* @returns the affected floor
|
|
525
|
+
*
|
|
526
|
+
* @examplePrompt Make this floor 200mm thick
|
|
527
|
+
* @examplePrompt Set every floor to a 250 thickness
|
|
528
|
+
* @examplePrompt Thicken the ground floor slab to 300
|
|
529
|
+
*
|
|
530
|
+
* # Example
|
|
531
|
+
* ```ts
|
|
532
|
+
* const [floor] = await snaptrude.design.query.listFloors()
|
|
533
|
+
* await snaptrude.design.update.floor(floor, { thickness: 200 })
|
|
534
|
+
* ```
|
|
535
|
+
*/
|
|
536
|
+
abstract floor(component: ComponentHandle, updates: PluginSlabUpdates): PluginApiReturn<PluginDesignChangeResult>;
|
|
537
|
+
/**
|
|
538
|
+
* Edit a **roof's** thickness and/or overhang — the same commands the roof
|
|
539
|
+
* panel's Thickness field and Overhang slider drive (shares the slab-family
|
|
540
|
+
* machinery). Sparse: only the fields you provide change. Undoable. Both
|
|
541
|
+
* values are in **engine units** (the `design.doors.setWidth` convention);
|
|
542
|
+
* thickness must be `> 0`, overhang is an absolute offset (negative insets
|
|
543
|
+
* the roof) and re-applying the current overhang is a no-op.
|
|
544
|
+
*
|
|
545
|
+
* Throws when the handle is not a roof, when it is locked, when the handle is
|
|
546
|
+
* gone/forged, when `overhang` is set on a roof whose overhang is disabled,
|
|
547
|
+
* or when no field is provided.
|
|
548
|
+
*
|
|
549
|
+
* @param component - The roof to edit
|
|
550
|
+
* @param updates - Sparse {@linkcode PluginSlabUpdates} (at least one field)
|
|
551
|
+
* @returns the affected roof
|
|
552
|
+
*
|
|
553
|
+
* @examplePrompt Make this roof 300mm thick
|
|
554
|
+
* @examplePrompt Set the roof slab thickness to 250
|
|
555
|
+
* @examplePrompt Give the roof a 600 overhang
|
|
556
|
+
* @examplePrompt Pull the roof overhang back to 0
|
|
557
|
+
*
|
|
558
|
+
* # Example
|
|
559
|
+
* ```ts
|
|
560
|
+
* const [roof] = await snaptrude.design.query.listRoofs()
|
|
561
|
+
* await snaptrude.design.update.roof(roof, { overhang: 600 })
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
564
|
+
abstract roof(component: ComponentHandle, updates: PluginSlabUpdates): PluginApiReturn<PluginDesignChangeResult>;
|
|
565
|
+
/**
|
|
566
|
+
* Edit a **ceiling's** thickness — the slab-family updater for ceilings
|
|
567
|
+
* (shares the slab thickness command). Undoable. Thickness is in **engine
|
|
568
|
+
* units** (the `design.doors.setWidth` convention) and must be `> 0`.
|
|
569
|
+
* Ceilings have no Overhang control, so `overhang` is rejected with
|
|
570
|
+
* `PRECONDITION_FAILED`.
|
|
571
|
+
*
|
|
572
|
+
* Throws when the handle is not a ceiling, when it is locked, when the handle
|
|
573
|
+
* is gone/forged, when `overhang` is provided, or when no field is provided.
|
|
574
|
+
*
|
|
575
|
+
* @param component - The ceiling to edit
|
|
576
|
+
* @param updates - {@linkcode PluginSlabUpdates} (a `thickness`)
|
|
577
|
+
* @returns the affected ceiling
|
|
578
|
+
*
|
|
579
|
+
* @examplePrompt Make this ceiling 150mm thick
|
|
580
|
+
* @examplePrompt Set every ceiling to a 100 thickness
|
|
581
|
+
* @examplePrompt Thicken the ceiling to 200
|
|
582
|
+
*
|
|
583
|
+
* # Example
|
|
584
|
+
* ```ts
|
|
585
|
+
* const [ceiling] = await snaptrude.design.query.listCeilings()
|
|
586
|
+
* await snaptrude.design.update.ceiling(ceiling, { thickness: 150 })
|
|
587
|
+
* ```
|
|
588
|
+
*/
|
|
589
|
+
abstract ceiling(component: ComponentHandle, updates: PluginSlabUpdates): PluginApiReturn<PluginDesignChangeResult>;
|
|
590
|
+
/**
|
|
591
|
+
* Set a component's **absolute world elevation** — moves it vertically so its
|
|
592
|
+
* base (the bounding-box bottom, world Y) lands at `elevation`. Composed over
|
|
593
|
+
* the canonical command-backed move machinery, so it is undoable and persisted
|
|
594
|
+
* exactly like dragging the element up or down; per-type invariants (e.g. a
|
|
595
|
+
* staircase's base offset) stay in sync. `elevation` is in **engine units**
|
|
596
|
+
* (the `design.doors.setWidth` convention). Re-applying the current elevation
|
|
597
|
+
* is a no-op.
|
|
598
|
+
*
|
|
599
|
+
* Throws when the component is locked or the handle is gone/forged.
|
|
600
|
+
*
|
|
601
|
+
* @param component - The component to move vertically
|
|
602
|
+
* @param elevation - Target world elevation of the component's base (engine units)
|
|
603
|
+
* @returns the affected component
|
|
604
|
+
*
|
|
605
|
+
* @examplePrompt Set this element's elevation to 3000
|
|
606
|
+
* @examplePrompt Raise this mass so its base sits at 3 metres
|
|
607
|
+
* @examplePrompt Drop the selected slab to elevation 0
|
|
608
|
+
* @examplePrompt Put this staircase's base at 3200
|
|
609
|
+
*
|
|
610
|
+
* # Example
|
|
611
|
+
* ```ts
|
|
612
|
+
* // Sit the roof slab exactly at the top of a 3m storey
|
|
613
|
+
* const [roof] = await snaptrude.design.query.listRoofs()
|
|
614
|
+
* await snaptrude.design.update.setElevation(roof, 3000)
|
|
615
|
+
* ```
|
|
616
|
+
*/
|
|
617
|
+
abstract setElevation(component: ComponentHandle, elevation: number): PluginApiReturn<PluginDesignChangeResult>;
|
|
618
|
+
/**
|
|
619
|
+
* Set a component's **base offset** — its vertical distance above its own
|
|
620
|
+
* storey's base level. Moves the component so its base lands at
|
|
621
|
+
* `storeyBase + offset`, composed over the same command-backed move machinery
|
|
622
|
+
* as {@linkcode setElevation} (undoable, persisted, per-type invariants kept
|
|
623
|
+
* in sync). Use this instead of {@linkcode setElevation} when you want an
|
|
624
|
+
* offset relative to the storey rather than an absolute world height.
|
|
625
|
+
* `offset` is in **engine units** (the `design.doors.setWidth` convention);
|
|
626
|
+
* `0` sits the base flush with the storey base. Re-applying the current
|
|
627
|
+
* offset is a no-op.
|
|
628
|
+
*
|
|
629
|
+
* Throws when the component is locked, when it has no storey to offset from,
|
|
630
|
+
* or when the handle is gone/forged.
|
|
631
|
+
*
|
|
632
|
+
* @param component - The component to offset
|
|
633
|
+
* @param offset - Distance of the component's base above its storey base (engine units)
|
|
634
|
+
* @returns the affected component
|
|
635
|
+
*
|
|
636
|
+
* @examplePrompt Lift this element 300 above its floor
|
|
637
|
+
* @examplePrompt Set this staircase's base offset to 0
|
|
638
|
+
* @examplePrompt Raise the selected mass 500 off the storey base
|
|
639
|
+
* @examplePrompt Offset this slab 150 above the floor level
|
|
640
|
+
*
|
|
641
|
+
* # Example
|
|
642
|
+
* ```ts
|
|
643
|
+
* const [stair] = await snaptrude.design.query.listStaircases()
|
|
644
|
+
* await snaptrude.design.update.setBaseOffset(stair, 0)
|
|
645
|
+
* ```
|
|
646
|
+
*/
|
|
647
|
+
abstract setBaseOffset(component: ComponentHandle, offset: number): PluginApiReturn<PluginDesignChangeResult>;
|
|
648
|
+
/**
|
|
649
|
+
* Reassign one or more components to another **storey** — the same operation
|
|
650
|
+
* as the properties panel's Story dropdown, and it works across element kinds
|
|
651
|
+
* exactly like the panel (walls, slabs, masses, furniture, staircases, ...).
|
|
652
|
+
* Each component is moved vertically to the target storey's level (per-kind
|
|
653
|
+
* placement rules — e.g. a slab sits at the storey base, a wall on it) and
|
|
654
|
+
* its storey assignment, children, and dimension lines update together as
|
|
655
|
+
* **one undoable operation**.
|
|
656
|
+
*
|
|
657
|
+
* `storey` is an integer storey number in the `entity.story` convention
|
|
658
|
+
* (`1` is the ground storey, `-1` the first basement; `0` does not exist)
|
|
659
|
+
* and **must already exist** in each component's building — this call never
|
|
660
|
+
* creates storeys (use `core.storeys.create` first). Components already on
|
|
661
|
+
* the target storey are skipped (no-op) and are not echoed in `affected`.
|
|
662
|
+
*
|
|
663
|
+
* Throws when the target storey does not exist, when any component is
|
|
664
|
+
* locked, or when a handle is gone/forged — all before anything moves
|
|
665
|
+
* (all-or-nothing).
|
|
666
|
+
*
|
|
667
|
+
* @param components - The components to reassign
|
|
668
|
+
* @param storey - Target storey number (integer, `entity.story` convention)
|
|
669
|
+
* @returns the components actually reassigned
|
|
670
|
+
*
|
|
671
|
+
* @examplePrompt Move this sofa to storey 2
|
|
672
|
+
* @examplePrompt Put the selected walls on the first basement level
|
|
673
|
+
* @examplePrompt Send everything on this storey up one level
|
|
674
|
+
* @examplePrompt Reassign these slabs to storey 3
|
|
675
|
+
*
|
|
676
|
+
* # Example
|
|
677
|
+
* ```ts
|
|
678
|
+
* // Move the current selection up to storey 2
|
|
679
|
+
* const selection = await snaptrude.design.selection.get()
|
|
680
|
+
* const { affected } = await snaptrude.design.update.setStorey(selection, 2)
|
|
681
|
+
* console.log("moved", affected.length, "components")
|
|
682
|
+
* ```
|
|
683
|
+
*/
|
|
684
|
+
abstract setStorey(components: ComponentHandle[], storey: number): PluginApiReturn<PluginDesignChangeResult>;
|
|
685
|
+
/**
|
|
686
|
+
* Update an existing parametric buildable envelope — regenerate the zoning
|
|
687
|
+
* volume from a revised site polygon, setbacks, vertical cap, or FAR and
|
|
688
|
+
* lot-coverage limits, keeping the same envelope id. Canonical home of the
|
|
689
|
+
* update formerly at `entity.buildableEnvelope.update` (now deprecated).
|
|
690
|
+
*
|
|
691
|
+
* @param buildableEnvelopeId - Existing envelope ID to update; non-empty and
|
|
692
|
+
* must match an existing envelope on the canvas.
|
|
693
|
+
* @param sitePolygon - Site polygon vertices in `lengthUnit`; minimum 3 vertices.
|
|
694
|
+
* @param lengthUnit - Unit used by all length fields (`"ft" | "m"`).
|
|
695
|
+
* @param setbacks - Setback profile, ground tier first; minimum 1 tier.
|
|
696
|
+
* @param verticalCap - Maximum height or floor count.
|
|
697
|
+
* @param floorToFloor - Required floor-to-floor height in `lengthUnit`.
|
|
698
|
+
* @param farRatio - Optional FAR value, positive when provided.
|
|
699
|
+
* @param lotCoverageMaxPct - Optional lot coverage cap, `0..100`.
|
|
700
|
+
* @returns A {@linkcode PluginBuildableEnvelopeUpdateResult} with the
|
|
701
|
+
* `buildableEnvelopeId` of the updated envelope.
|
|
702
|
+
* @throws If validation fails, the envelope does not exist, or generation
|
|
703
|
+
* produces no renderable geometry.
|
|
704
|
+
*
|
|
705
|
+
* @examplePrompt Change the envelope's height limit to 175 feet
|
|
706
|
+
* @examplePrompt Update the setbacks on the buildable envelope
|
|
707
|
+
* @examplePrompt Regenerate the zoning envelope with a new site boundary
|
|
708
|
+
* @examplePrompt Increase the FAR on the buildable volume
|
|
709
|
+
*
|
|
710
|
+
* # Example
|
|
711
|
+
* ```ts
|
|
712
|
+
* const { buildableEnvelopeId } = await snaptrude.design.update.buildableEnvelope(
|
|
713
|
+
* existingId,
|
|
714
|
+
* [
|
|
715
|
+
* { x: 0, z: 0 },
|
|
716
|
+
* { x: 100, z: 0 },
|
|
717
|
+
* { x: 100, z: 80 },
|
|
718
|
+
* { x: 0, z: 80 },
|
|
719
|
+
* ],
|
|
720
|
+
* "ft",
|
|
721
|
+
* [{ aboveHeight: 0, front: 10, side: 5, rear: 10 }],
|
|
722
|
+
* { kind: "max_height", maxHeight: 175 },
|
|
723
|
+
* 12,
|
|
724
|
+
* )
|
|
725
|
+
* ```
|
|
726
|
+
*/
|
|
727
|
+
abstract buildableEnvelope(buildableEnvelopeId: string, sitePolygon: PluginBuildableEnvelopePolygonVertex[], lengthUnit: "ft" | "m", setbacks: PluginBuildableEnvelopeSetbackTier[], verticalCap: PluginBuildableEnvelopeVerticalCap, floorToFloor: number, farRatio?: number, lotCoverageMaxPct?: number): PluginApiReturn<PluginBuildableEnvelopeUpdateResult>;
|
|
177
728
|
}
|
|
178
729
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/update/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAKL,uBAAuB,EACxB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/update/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAKL,uBAAuB,EACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EACL,oCAAoC,EACpC,kCAAkC,EAClC,kCAAkC,EAClC,mCAAmC,EACpC,MAAM,gCAAgC,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,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