@snaptrude/plugin-core 0.9.16 → 0.9.18-edgesetbacks-20261021.1
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/AGENTS.md +231 -231
- package/CHANGELOG.md +408 -402
- package/CLAUDE.md +11 -11
- package/api-manifest.json +1510 -701
- package/dist/api/analysis/daylight.d.ts +5 -5
- package/dist/api/analysis/solar.d.ts +2 -2
- package/dist/api/core/camera/index.d.ts +29 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +7 -1
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +8 -2
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +5 -2
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/core/zoom/index.d.ts +13 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/bim.d.ts +299 -0
- package/dist/api/design/bim.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +2 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/catalog.d.ts +320 -0
- package/dist/api/design/catalog.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +65 -25
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/index.d.ts +299 -100
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +13 -12
- package/dist/api/design/create/opening-fields.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +1 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +18 -24
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +813 -35
- package/dist/api/design/family.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +16 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/networks.d.ts +1703 -0
- package/dist/api/design/networks.d.ts.map +1 -0
- package/dist/api/design/query/grids.d.ts +2 -2
- package/dist/api/design/query/index.d.ts +42 -32
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +10 -10
- package/dist/api/design/types/index.d.ts +40 -24
- package/dist/api/design/types/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +111 -6
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +8 -8
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +84 -2
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +10 -10
- package/dist/api/presentation/annotate.d.ts +38 -22
- package/dist/api/presentation/annotate.d.ts.map +1 -1
- package/dist/api/presentation/drawingContract.d.ts +32 -0
- package/dist/api/presentation/drawingContract.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +3523 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +23 -5
- package/dist/api/presentation/export.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +41 -12
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +106 -6
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/sections.d.ts +461 -0
- package/dist/api/presentation/sections.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/presentation/sheets.d.ts +175 -19
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/viewPresets.d.ts +222 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +141 -8
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/presentation/walkthroughs.d.ts +6 -6
- package/dist/errors/codes.d.ts +3 -1
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/index.cjs +3883 -2385
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3744 -2385
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/check-dist-fresh.mjs +22 -22
- package/scripts/generate-manifest.mjs +243 -238
- package/scripts/generate-manifest.test.mjs +303 -303
- package/src/api/analysis/daylight.ts +470 -470
- package/src/api/analysis/heatmaps.ts +683 -683
- package/src/api/analysis/illuminance.ts +155 -155
- package/src/api/analysis/index.ts +61 -61
- package/src/api/analysis/shadows.ts +183 -183
- package/src/api/analysis/solar.ts +237 -237
- package/src/api/analysis/sunlightHours.ts +211 -211
- package/src/api/analysis/sunpath.ts +83 -83
- package/src/api/analysis/weather.ts +179 -179
- package/src/api/core/buildings.ts +485 -485
- package/src/api/core/camera/index.ts +696 -667
- package/src/api/core/comment/index.ts +376 -376
- package/src/api/core/geom/create/index.ts +2139 -2133
- package/src/api/core/geom/delete/index.ts +84 -84
- package/src/api/core/geom/index.ts +35 -35
- package/src/api/core/geom/query/arc.ts +169 -169
- package/src/api/core/geom/query/brep.ts +621 -621
- package/src/api/core/geom/query/circle.ts +404 -404
- package/src/api/core/geom/query/contour.ts +540 -540
- package/src/api/core/geom/query/curve.ts +1102 -1102
- package/src/api/core/geom/query/edge.ts +130 -130
- package/src/api/core/geom/query/face.ts +508 -508
- package/src/api/core/geom/query/halfedge.ts +210 -210
- package/src/api/core/geom/query/index.ts +63 -63
- package/src/api/core/geom/query/profile.ts +473 -473
- package/src/api/core/geom/query/vertex.ts +205 -205
- package/src/api/core/geom/update/contour.ts +323 -317
- package/src/api/core/geom/update/curve.ts +209 -209
- package/src/api/core/geom/update/index.ts +29 -29
- package/src/api/core/geom/update/profile.ts +379 -379
- package/src/api/core/groups.ts +521 -521
- package/src/api/core/handles/index.ts +234 -234
- package/src/api/core/history/index.ts +84 -84
- package/src/api/core/index.ts +99 -99
- package/src/api/core/io/export/index.ts +126 -126
- package/src/api/core/io/import/index.ts +504 -504
- package/src/api/core/io/index.ts +42 -42
- package/src/api/core/io/job/index.ts +140 -140
- package/src/api/core/io/query/index.ts +71 -71
- package/src/api/core/io/terrain/index.ts +360 -360
- package/src/api/core/io/underlay/index.ts +705 -705
- package/src/api/core/layers.ts +540 -540
- package/src/api/core/math/index.ts +20 -20
- package/src/api/core/math/quat.ts +172 -172
- package/src/api/core/math/vec3.ts +179 -179
- package/src/api/core/mode/index.ts +108 -108
- package/src/api/core/project/index.ts +479 -479
- package/src/api/core/proposals/index.ts +570 -570
- package/src/api/core/storeys/index.ts +311 -308
- package/src/api/core/storeys/layers.ts +339 -339
- package/src/api/core/tags.ts +911 -911
- package/src/api/core/units/index.ts +164 -164
- package/src/api/core/user.ts +46 -46
- package/src/api/core/zoom/index.ts +64 -51
- package/src/api/design/bim.ts +210 -0
- package/src/api/design/boolean/index.ts +181 -179
- package/src/api/design/catalog.ts +203 -0
- package/src/api/design/create/bulk-items.ts +294 -254
- package/src/api/design/create/grids.ts +137 -137
- package/src/api/design/create/index.ts +2178 -1980
- package/src/api/design/create/opening-fields.ts +40 -37
- package/src/api/design/delete/index.ts +75 -74
- package/src/api/design/dimensions.ts +453 -453
- package/src/api/design/doors/index.ts +516 -500
- package/src/api/design/edit/index.ts +54 -54
- package/src/api/design/erase/index.ts +151 -151
- package/src/api/design/family.ts +1342 -704
- package/src/api/design/furniture/index.ts +319 -319
- package/src/api/design/grids.ts +237 -237
- package/src/api/design/index.ts +304 -274
- package/src/api/design/lock.ts +69 -69
- package/src/api/design/materials/index.ts +608 -608
- package/src/api/design/networks.ts +607 -0
- package/src/api/design/query/geometry/index.ts +319 -319
- package/src/api/design/query/grids.ts +197 -197
- package/src/api/design/query/index.ts +1236 -1226
- package/src/api/design/query/referenceLines.ts +52 -52
- package/src/api/design/query/spaces.ts +275 -275
- package/src/api/design/selection/index.ts +273 -273
- package/src/api/design/shared.ts +40 -40
- package/src/api/design/transform/index.ts +254 -254
- package/src/api/design/types/index.ts +163 -156
- package/src/api/design/update/index.ts +1096 -983
- package/src/api/design/visibility.ts +143 -143
- package/src/api/design/windows/index.ts +351 -333
- package/src/api/entity/buildableEnvelope.ts +397 -322
- package/src/api/entity/index.ts +30 -30
- package/src/api/entity/referenceLine.ts +235 -235
- package/src/api/entity/space.ts +612 -612
- package/src/api/entity/story.ts +517 -517
- package/src/api/index.ts +47 -47
- package/src/api/presentation/aiInspiration.ts +1116 -1116
- package/src/api/presentation/annotate.ts +417 -385
- package/src/api/presentation/camera.ts +289 -289
- package/src/api/presentation/diagrams.ts +194 -194
- package/src/api/presentation/drawingContract.ts +70 -0
- package/src/api/presentation/drawings.ts +1179 -0
- package/src/api/presentation/export.ts +134 -108
- package/src/api/presentation/import.ts +159 -159
- package/src/api/presentation/index.ts +160 -126
- package/src/api/presentation/placedViews.ts +1211 -1120
- package/src/api/presentation/sections.ts +420 -0
- package/src/api/presentation/shapes.ts +274 -274
- package/src/api/presentation/sheets.ts +746 -585
- package/src/api/presentation/slideshow.ts +134 -134
- package/src/api/presentation/tables.ts +84 -84
- package/src/api/presentation/viewPresets.ts +241 -0
- package/src/api/presentation/views.ts +742 -673
- package/src/api/presentation/walkthroughs.ts +1201 -1201
- package/src/api/program/adjacency.ts +164 -164
- package/src/api/program/areas.ts +408 -408
- package/src/api/program/classification.ts +138 -138
- package/src/api/program/cores.ts +83 -83
- package/src/api/program/departments.ts +517 -517
- package/src/api/program/index.ts +73 -73
- package/src/api/program/labels.ts +332 -332
- package/src/api/program/layout.ts +422 -422
- package/src/api/program/metadata.ts +364 -364
- package/src/api/program/metrics.ts +120 -120
- package/src/api/program/site.ts +748 -748
- package/src/api/program/spreadsheet.ts +2698 -2698
- package/src/api/workspace/index.ts +612 -612
- package/src/errors/codes.ts +143 -136
- package/src/errors/envelope.ts +75 -75
- package/src/errors/index.ts +21 -21
- package/src/errors/plugin-error.ts +134 -134
- package/src/handles.ts +297 -297
- package/src/host-utils.ts +67 -67
- package/src/index.ts +7 -7
- package/src/massParameters.ops.ts +246 -246
- package/src/massParameters.ts +427 -427
- package/src/types.ts +16 -16
- package/test/drawingContract.test.mjs +288 -0
- package/test/errors.test.mjs +185 -184
- package/test/massParameters.test.mjs +952 -952
- package/test/presentationViewSettings.test.mjs +85 -0
- package/tsconfig.json +22 -22
- package/tsup.config.ts +12 -12
|
@@ -1,254 +1,294 @@
|
|
|
1
|
-
import * as z from "zod"
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* |
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
.
|
|
108
|
-
.
|
|
109
|
-
.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* |
|
|
161
|
-
*
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
export
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* |
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
.
|
|
250
|
-
.
|
|
251
|
-
|
|
252
|
-
export type
|
|
253
|
-
typeof
|
|
254
|
-
>
|
|
1
|
+
import * as z from "zod"
|
|
2
|
+
import {
|
|
3
|
+
ComponentHandle,
|
|
4
|
+
ContourHandle,
|
|
5
|
+
ProfileHandle,
|
|
6
|
+
Vec3Handle,
|
|
7
|
+
} from "../../../handles"
|
|
8
|
+
import { PluginOpeningBaseOptions } from "./opening-fields"
|
|
9
|
+
import { PluginWallType } from "../types"
|
|
10
|
+
import { PluginFamilyValues } from "../catalog"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Maximum items per bulk `design.create.*` call. A bounded request keeps
|
|
14
|
+
* validation, command capture and rollback work finite; split a larger import
|
|
15
|
+
* into separate awaited batches, each with its own undo entry.
|
|
16
|
+
*/
|
|
17
|
+
export const PLUGIN_CREATE_BATCH_LIMIT = 1000
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// wall top profile (raked / gabled walls)
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* One break point of a wall's top edge — see {@linkcode PluginWallTopProfile}.
|
|
25
|
+
*
|
|
26
|
+
* | Property | Type | Description |
|
|
27
|
+
* |---|---|---|
|
|
28
|
+
* | `along` | `number` | Position along the wall centerline as a fraction: `0` = start of the curve, `1` = end |
|
|
29
|
+
* | `height` | `number` | Top height above the wall base at that point (Snaptrude units, > 0) |
|
|
30
|
+
*/
|
|
31
|
+
export const PluginWallTopProfilePoint = z.object({
|
|
32
|
+
along: z.number().min(0).max(1),
|
|
33
|
+
height: z.number().positive(),
|
|
34
|
+
})
|
|
35
|
+
export type PluginWallTopProfilePoint = z.infer<
|
|
36
|
+
typeof PluginWallTopProfilePoint
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The top edge of ONE wall as a polyline over its centerline: at least two
|
|
41
|
+
* points, `along` strictly increasing from `0` (curve start) to `1` (curve end),
|
|
42
|
+
* straight segments between them. Two points give a single slope (a raked
|
|
43
|
+
* wall), three give a gable, more give any stepped or folded ridge. Heights are
|
|
44
|
+
* measured from the wall base, like `height`. Both long faces follow the same
|
|
45
|
+
* profile, so the top stays a set of flat faces and the wall keeps its thickness
|
|
46
|
+
* end to end.
|
|
47
|
+
*
|
|
48
|
+
* Only straight centerlines take a top profile (an arc curve with one is
|
|
49
|
+
* rejected). A wall built this way is a real Wall — doors and windows host on
|
|
50
|
+
* it, corners mitre, quantities and Revit export read its geometry — but it is
|
|
51
|
+
* **non-parametric**: the parametric wall graph does not rebuild it, so a later
|
|
52
|
+
* move of a neighbour does not re-mitre its corner, exactly like a wall whose
|
|
53
|
+
* top edge was dragged by hand. `design.update.wall({ height })` scales it
|
|
54
|
+
* proportionally.
|
|
55
|
+
*/
|
|
56
|
+
export const PluginWallTopProfile = z
|
|
57
|
+
.array(PluginWallTopProfilePoint)
|
|
58
|
+
.min(2)
|
|
59
|
+
.superRefine((points, ctx) => {
|
|
60
|
+
if (points[0].along !== 0) {
|
|
61
|
+
ctx.addIssue({
|
|
62
|
+
code: "custom",
|
|
63
|
+
message: "topProfile must start at along = 0",
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
if (points[points.length - 1].along !== 1) {
|
|
67
|
+
ctx.addIssue({
|
|
68
|
+
code: "custom",
|
|
69
|
+
message: "topProfile must end at along = 1",
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
for (let i = 1; i < points.length; i++) {
|
|
73
|
+
if (points[i].along <= points[i - 1].along) {
|
|
74
|
+
ctx.addIssue({
|
|
75
|
+
code: "custom",
|
|
76
|
+
message:
|
|
77
|
+
"topProfile points must be in strictly increasing `along` order",
|
|
78
|
+
})
|
|
79
|
+
break
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
export type PluginWallTopProfile = z.infer<typeof PluginWallTopProfile>
|
|
84
|
+
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
// wallRuns
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* One wall run to create via {@linkcode PluginDesignCreateApi.wallRuns} — the
|
|
91
|
+
* same inputs as {@linkcode PluginDesignCreateApi.walls}, one run per item.
|
|
92
|
+
*
|
|
93
|
+
* | Property | Type | Description |
|
|
94
|
+
* |---|---|---|
|
|
95
|
+
* | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (wall centerlines) |
|
|
96
|
+
* | `height` | `number`? | Wall height (Snaptrude units, > 0; default engine default) |
|
|
97
|
+
* | `thickness` | `number`? | Wall thickness (Snaptrude units, > 0; default: `wallType`'s total layer thickness when given, else engine default) |
|
|
98
|
+
* | `wallType` | {@linkcode PluginWallType}? | Legacy name/id or exact native `{ id, version }` pin from `design.types.list("wall")` (default generic) |
|
|
99
|
+
* | `storey` | `number`? (int) | Target storey (must exist) — the run's walls are assigned + lifted to its base in the same undo entry (default: geometry-derived) |
|
|
100
|
+
* | `topProfiles` | ({@linkcode PluginWallTopProfile} \| `null`)[]? | Top edge per curve of `profile`, same order; a `null` or missing entry keeps that wall flat at `height`. Raked / gabled walls (straight curves only) |
|
|
101
|
+
*/
|
|
102
|
+
export const PluginCreateWallRunItem = z.object({
|
|
103
|
+
profile: ProfileHandle,
|
|
104
|
+
height: z.number().optional(),
|
|
105
|
+
thickness: z.number().optional(),
|
|
106
|
+
wallType: PluginWallType.optional(),
|
|
107
|
+
storey: z.number().int().optional(),
|
|
108
|
+
topProfiles: z.array(PluginWallTopProfile.nullable()).optional(),
|
|
109
|
+
/** Optional family overrides in mm/degrees. Host length/height stay geometry inputs. */
|
|
110
|
+
values: PluginFamilyValues.optional(),
|
|
111
|
+
})
|
|
112
|
+
export type PluginCreateWallRunItem = z.infer<typeof PluginCreateWallRunItem>
|
|
113
|
+
|
|
114
|
+
/** The `items` array of {@linkcode PluginDesignCreateApi.wallRuns} (1…1000). */
|
|
115
|
+
export const PluginCreateWallRunItems = z
|
|
116
|
+
.array(PluginCreateWallRunItem)
|
|
117
|
+
.min(1)
|
|
118
|
+
.max(PLUGIN_CREATE_BATCH_LIMIT)
|
|
119
|
+
export type PluginCreateWallRunItems = z.infer<typeof PluginCreateWallRunItems>
|
|
120
|
+
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
// floors
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* One floor to create via {@linkcode PluginDesignCreateApi.floors} — the same
|
|
127
|
+
* footprint-extrude inputs as {@linkcode PluginDesignCreateApi.floor}.
|
|
128
|
+
*
|
|
129
|
+
* | Property | Type | Description |
|
|
130
|
+
* |---|---|---|
|
|
131
|
+
* | `contour` | {@linkcode ContourHandle} | Footprint (outer profile + holes) |
|
|
132
|
+
* | `thickness` | `number` | Floor thickness (Snaptrude units, > 0) |
|
|
133
|
+
* | `position` | {@linkcode Vec3Handle}? | Offset from origin (default origin) |
|
|
134
|
+
*/
|
|
135
|
+
export const PluginCreateFloorItem = z.object({
|
|
136
|
+
contour: ContourHandle,
|
|
137
|
+
thickness: z.number(),
|
|
138
|
+
position: Vec3Handle.optional(),
|
|
139
|
+
})
|
|
140
|
+
export type PluginCreateFloorItem = z.infer<typeof PluginCreateFloorItem>
|
|
141
|
+
|
|
142
|
+
/** The `items` array of {@linkcode PluginDesignCreateApi.floors} (1…1000). */
|
|
143
|
+
export const PluginCreateFloorItems = z
|
|
144
|
+
.array(PluginCreateFloorItem)
|
|
145
|
+
.min(1)
|
|
146
|
+
.max(PLUGIN_CREATE_BATCH_LIMIT)
|
|
147
|
+
export type PluginCreateFloorItems = z.infer<typeof PluginCreateFloorItems>
|
|
148
|
+
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
// doors / windows
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* One door to place via {@linkcode PluginDesignCreateApi.doors} — the same
|
|
155
|
+
* fields as a `"door"` {@linkcode PluginDesignCreateOpeningOptions}.
|
|
156
|
+
* Values are evaluated before cutting. Numeric lengths use SU; unit strings
|
|
157
|
+
* are accepted in values. `facing` selects local +Z; `hinge` sets the declared
|
|
158
|
+
* hand enum (left = local -X, right = +X). Both are world points.
|
|
159
|
+
*
|
|
160
|
+
* | Property | Type | Description |
|
|
161
|
+
* |---|---|---|
|
|
162
|
+
* | `familyId` | `string` | Hosted door family definition ID |
|
|
163
|
+
* | `version` | `number`? | Exact version; newest known by default |
|
|
164
|
+
* | `values` | `Record<string, number \| string>`? | Authored parameter overrides |
|
|
165
|
+
* | `hostWall` | {@linkcode ComponentHandle} | The wall to host the door |
|
|
166
|
+
* | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
|
|
167
|
+
* | `facing` | {@linkcode Vec3Handle}? | World point on the side the door swings open to (default engine-chosen) |
|
|
168
|
+
* | `hinge` | {@linkcode Vec3Handle}? | World point near the hinged jamb; requires hand control |
|
|
169
|
+
* | `label` | `string`? | Instance name (optional) |
|
|
170
|
+
* | `width` | `number`? | Declared width parameter (SU, > 0), not evaluated hole width |
|
|
171
|
+
* | `height` | `number`? | Declared height parameter (SU, > 0) |
|
|
172
|
+
*/
|
|
173
|
+
export const PluginCreateDoorItem = z
|
|
174
|
+
.object({ ...PluginOpeningBaseOptions })
|
|
175
|
+
.strict()
|
|
176
|
+
export type PluginCreateDoorItem = z.infer<typeof PluginCreateDoorItem>
|
|
177
|
+
|
|
178
|
+
/** The `items` array of {@linkcode PluginDesignCreateApi.doors} (1…1000). */
|
|
179
|
+
export const PluginCreateDoorItems = z
|
|
180
|
+
.array(PluginCreateDoorItem)
|
|
181
|
+
.min(1)
|
|
182
|
+
.max(PLUGIN_CREATE_BATCH_LIMIT)
|
|
183
|
+
export type PluginCreateDoorItems = z.infer<typeof PluginCreateDoorItems>
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* One window to place via {@linkcode PluginDesignCreateApi.windows} — the same
|
|
187
|
+
* fields as a `"window"` {@linkcode PluginDesignCreateOpeningOptions}.
|
|
188
|
+
* `sillHeight` is a nonnegative Snaptrude-unit distance from the host wall's
|
|
189
|
+
* base to the BOTTOM of the window, not to its center. `facing` and `hinge`
|
|
190
|
+
* are WORLD POINTS, not directions: `facing` on the side of the wall the
|
|
191
|
+
* window opens to, `hinge` near the jamb it is hinged on. Rejects unknown
|
|
192
|
+
* fields.
|
|
193
|
+
*
|
|
194
|
+
* | Property | Type | Description |
|
|
195
|
+
* |---|---|---|
|
|
196
|
+
* | `familyId` | `string` | Hosted window family definition ID |
|
|
197
|
+
* | `version` | `number`? | Exact version; newest known by default |
|
|
198
|
+
* | `values` | `Record<string, number \| string>`? | Authored parameter overrides; numeric lengths use SU |
|
|
199
|
+
* | `hostWall` | {@linkcode ComponentHandle} | The wall to host the window |
|
|
200
|
+
* | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
|
|
201
|
+
* | `facing` | {@linkcode Vec3Handle}? | World point on the side the window opens to (default engine-chosen) |
|
|
202
|
+
* | `hinge` | {@linkcode Vec3Handle}? | World point near the hinged jamb; requires hand control |
|
|
203
|
+
* | `label` | `string`? | Instance name (optional) |
|
|
204
|
+
* | `width` | `number`? | Declared width parameter (SU, > 0), not evaluated hole width |
|
|
205
|
+
* | `height` | `number`? | Declared height parameter (SU, > 0) |
|
|
206
|
+
* | `sillHeight` | `number`? | Declared sill parameter (SU, ≥ 0); position Y is ignored |
|
|
207
|
+
*/
|
|
208
|
+
export const PluginCreateWindowItem = z
|
|
209
|
+
.object({
|
|
210
|
+
...PluginOpeningBaseOptions,
|
|
211
|
+
sillHeight: z.number().finite().nonnegative().optional(),
|
|
212
|
+
})
|
|
213
|
+
.strict()
|
|
214
|
+
export type PluginCreateWindowItem = z.infer<typeof PluginCreateWindowItem>
|
|
215
|
+
|
|
216
|
+
/** The `items` array of {@linkcode PluginDesignCreateApi.windows} (1…1000). */
|
|
217
|
+
export const PluginCreateWindowItems = z
|
|
218
|
+
.array(PluginCreateWindowItem)
|
|
219
|
+
.min(1)
|
|
220
|
+
.max(PLUGIN_CREATE_BATCH_LIMIT)
|
|
221
|
+
export type PluginCreateWindowItems = z.infer<typeof PluginCreateWindowItems>
|
|
222
|
+
|
|
223
|
+
// ---------------------------------------------------------------------------
|
|
224
|
+
// furnitureItems
|
|
225
|
+
// ---------------------------------------------------------------------------
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* One furniture instance to place via
|
|
229
|
+
* {@linkcode PluginDesignCreateApi.furnitureItems} — the same inputs as
|
|
230
|
+
* {@linkcode PluginDesignCreateApi.furniture} minus `createNewSourceMesh`: in a
|
|
231
|
+
* batch the host owns source-mesh persistence (a source is recorded once per
|
|
232
|
+
* call, however many items reuse it).
|
|
233
|
+
*
|
|
234
|
+
* `position.y` is the REST elevation: the item is grounded so its bounding-box
|
|
235
|
+
* base sits exactly at `position.y` (the same surface-flush contract as
|
|
236
|
+
* interactive drag-drop) — pass the floor/storey elevation to stand furniture
|
|
237
|
+
* on it; never add half the item's height yourself.
|
|
238
|
+
*
|
|
239
|
+
* | Property | Type | Description |
|
|
240
|
+
* |---|---|---|
|
|
241
|
+
* | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
|
|
242
|
+
* | `position` | {@linkcode Vec3Handle} | Absolute world placement point (`y` = rest elevation) |
|
|
243
|
+
* | `label` | `string`? | Instance name and readable label (default auto `${name}Ins${n}`) |
|
|
244
|
+
* | `angleInDegrees` | `number`? | Rotation about the vertical axis, in degrees (default unrotated) |
|
|
245
|
+
*/
|
|
246
|
+
export const PluginCreateFurnitureItem = z.object({
|
|
247
|
+
catalogId: z.string().min(1),
|
|
248
|
+
position: Vec3Handle,
|
|
249
|
+
label: z.string().optional(),
|
|
250
|
+
angleInDegrees: z.number().optional(),
|
|
251
|
+
})
|
|
252
|
+
export type PluginCreateFurnitureItem = z.infer<
|
|
253
|
+
typeof PluginCreateFurnitureItem
|
|
254
|
+
>
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The `items` array of {@linkcode PluginDesignCreateApi.furnitureItems}
|
|
258
|
+
* (1…1000).
|
|
259
|
+
*/
|
|
260
|
+
export const PluginCreateFurnitureItems = z
|
|
261
|
+
.array(PluginCreateFurnitureItem)
|
|
262
|
+
.min(1)
|
|
263
|
+
.max(PLUGIN_CREATE_BATCH_LIMIT)
|
|
264
|
+
export type PluginCreateFurnitureItems = z.infer<
|
|
265
|
+
typeof PluginCreateFurnitureItems
|
|
266
|
+
>
|
|
267
|
+
|
|
268
|
+
// ---------------------------------------------------------------------------
|
|
269
|
+
// voids
|
|
270
|
+
// ---------------------------------------------------------------------------
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* One void to cut via {@linkcode PluginDesignCreateApi.voids} — the same fields as
|
|
274
|
+
* {@linkcode PluginDesignCreateApi.void}. Rejects unknown fields.
|
|
275
|
+
*
|
|
276
|
+
* | Property | Type | Description |
|
|
277
|
+
* | --- | --- | --- |
|
|
278
|
+
* | `host` | {@linkcode ComponentHandle} | The slab, floor, roof or ceiling to cut through. Not a wall. |
|
|
279
|
+
* | `outline` | {@linkcode ProfileHandle} | Closed, flat plan outline in world SU (all points at one height). That height is ignored: it is dropped straight onto the host's top face. |
|
|
280
|
+
*/
|
|
281
|
+
export const PluginCreateVoidItem = z
|
|
282
|
+
.object({
|
|
283
|
+
host: ComponentHandle,
|
|
284
|
+
outline: ProfileHandle,
|
|
285
|
+
})
|
|
286
|
+
.strict()
|
|
287
|
+
export type PluginCreateVoidItem = z.infer<typeof PluginCreateVoidItem>
|
|
288
|
+
|
|
289
|
+
/** The `items` array of {@linkcode PluginDesignCreateApi.voids} (1…1000; the host takes at most 200, 50 per host). */
|
|
290
|
+
export const PluginCreateVoidItems = z
|
|
291
|
+
.array(PluginCreateVoidItem)
|
|
292
|
+
.min(1)
|
|
293
|
+
.max(PLUGIN_CREATE_BATCH_LIMIT)
|
|
294
|
+
export type PluginCreateVoidItems = z.infer<typeof PluginCreateVoidItems>
|