@snaptrude/plugin-core 0.9.14 → 0.9.16-networks-20261008.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/CHANGELOG.md +28 -0
- 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 +418 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/index.d.ts +4 -4
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +377 -255
- package/dist/api/core/layers.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +4 -3
- package/dist/api/core/proposals/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +12 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/core/storeys/layers.d.ts +408 -0
- package/dist/api/core/storeys/layers.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +3 -3
- package/dist/api/design/bim.d.ts +209 -0
- package/dist/api/design/bim.d.ts.map +1 -0
- package/dist/api/design/catalog.d.ts +242 -0
- package/dist/api/design/catalog.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +55 -3
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/index.d.ts +77 -22
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +576 -12
- 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/index.d.ts +30 -30
- package/dist/api/design/selection/index.d.ts +12 -12
- 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 +113 -3
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +23 -23
- package/dist/api/presentation/camera.d.ts +265 -0
- package/dist/api/presentation/camera.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +14 -0
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +1 -1
- package/dist/api/presentation/views.d.ts +3 -1
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/presentation/walkthroughs.d.ts +1350 -0
- package/dist/api/presentation/walkthroughs.d.ts.map +1 -0
- package/dist/index.cjs +3886 -2598
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3744 -2595
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/generate-manifest.mjs +5 -0
- package/scripts/generate-manifest.test.mjs +14 -3
- package/src/api/core/camera/index.ts +400 -1
- package/src/api/core/index.ts +4 -4
- package/src/api/core/layers.ts +380 -173
- package/src/api/core/proposals/index.ts +4 -3
- package/src/api/core/storeys/index.ts +14 -0
- package/src/api/core/storeys/layers.ts +339 -0
- package/src/api/design/bim.ts +121 -0
- package/src/api/design/catalog.ts +128 -0
- package/src/api/design/create/bulk-items.ts +74 -2
- package/src/api/design/create/index.ts +92 -36
- package/src/api/design/family.ts +448 -17
- package/src/api/design/index.ts +34 -4
- package/src/api/design/networks.ts +607 -0
- package/src/api/design/types/index.ts +31 -24
- package/src/api/design/update/index.ts +121 -4
- package/src/api/presentation/camera.ts +289 -0
- package/src/api/presentation/index.ts +14 -0
- package/src/api/presentation/views.ts +3 -1
- package/src/api/presentation/walkthroughs.ts +1201 -0
- package/api-manifest.json +0 -9117
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { ContourHandle, ProfileHandle, Vec3Handle } from "../../../handles"
|
|
3
3
|
import { PluginOpeningBaseOptions } from "./opening-fields"
|
|
4
|
+
import { PluginWallType } from "../types"
|
|
5
|
+
import { PluginFamilyValues } from "../catalog"
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Maximum items per bulk `design.create.*` call. A bounded request keeps
|
|
@@ -9,6 +11,72 @@ import { PluginOpeningBaseOptions } from "./opening-fields"
|
|
|
9
11
|
*/
|
|
10
12
|
export const PLUGIN_CREATE_BATCH_LIMIT = 1000
|
|
11
13
|
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// wall top profile (raked / gabled walls)
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* One break point of a wall's top edge — see {@linkcode PluginWallTopProfile}.
|
|
20
|
+
*
|
|
21
|
+
* | Property | Type | Description |
|
|
22
|
+
* |---|---|---|
|
|
23
|
+
* | `along` | `number` | Position along the wall centerline as a fraction: `0` = start of the curve, `1` = end |
|
|
24
|
+
* | `height` | `number` | Top height above the wall base at that point (Snaptrude units, > 0) |
|
|
25
|
+
*/
|
|
26
|
+
export const PluginWallTopProfilePoint = z.object({
|
|
27
|
+
along: z.number().min(0).max(1),
|
|
28
|
+
height: z.number().positive(),
|
|
29
|
+
})
|
|
30
|
+
export type PluginWallTopProfilePoint = z.infer<
|
|
31
|
+
typeof PluginWallTopProfilePoint
|
|
32
|
+
>
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The top edge of ONE wall as a polyline over its centerline: at least two
|
|
36
|
+
* points, `along` strictly increasing from `0` (curve start) to `1` (curve end),
|
|
37
|
+
* straight segments between them. Two points give a single slope (a raked
|
|
38
|
+
* wall), three give a gable, more give any stepped or folded ridge. Heights are
|
|
39
|
+
* measured from the wall base, like `height`. Both long faces follow the same
|
|
40
|
+
* profile, so the top stays a set of flat faces and the wall keeps its thickness
|
|
41
|
+
* end to end.
|
|
42
|
+
*
|
|
43
|
+
* Only straight centerlines take a top profile (an arc curve with one is
|
|
44
|
+
* rejected). A wall built this way is a real Wall — doors and windows host on
|
|
45
|
+
* it, corners mitre, quantities and Revit export read its geometry — but it is
|
|
46
|
+
* **non-parametric**: the parametric wall graph does not rebuild it, so a later
|
|
47
|
+
* move of a neighbour does not re-mitre its corner, exactly like a wall whose
|
|
48
|
+
* top edge was dragged by hand. `design.update.wall({ height })` scales it
|
|
49
|
+
* proportionally.
|
|
50
|
+
*/
|
|
51
|
+
export const PluginWallTopProfile = z
|
|
52
|
+
.array(PluginWallTopProfilePoint)
|
|
53
|
+
.min(2)
|
|
54
|
+
.superRefine((points, ctx) => {
|
|
55
|
+
if (points[0].along !== 0) {
|
|
56
|
+
ctx.addIssue({
|
|
57
|
+
code: "custom",
|
|
58
|
+
message: "topProfile must start at along = 0",
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
if (points[points.length - 1].along !== 1) {
|
|
62
|
+
ctx.addIssue({
|
|
63
|
+
code: "custom",
|
|
64
|
+
message: "topProfile must end at along = 1",
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
for (let i = 1; i < points.length; i++) {
|
|
68
|
+
if (points[i].along <= points[i - 1].along) {
|
|
69
|
+
ctx.addIssue({
|
|
70
|
+
code: "custom",
|
|
71
|
+
message:
|
|
72
|
+
"topProfile points must be in strictly increasing `along` order",
|
|
73
|
+
})
|
|
74
|
+
break
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
export type PluginWallTopProfile = z.infer<typeof PluginWallTopProfile>
|
|
79
|
+
|
|
12
80
|
// ---------------------------------------------------------------------------
|
|
13
81
|
// wallRuns
|
|
14
82
|
// ---------------------------------------------------------------------------
|
|
@@ -22,15 +90,19 @@ export const PLUGIN_CREATE_BATCH_LIMIT = 1000
|
|
|
22
90
|
* | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (wall centerlines) |
|
|
23
91
|
* | `height` | `number`? | Wall height (Snaptrude units, > 0; default engine default) |
|
|
24
92
|
* | `thickness` | `number`? | Wall thickness (Snaptrude units, > 0; default: `wallType`'s total layer thickness when given, else engine default) |
|
|
25
|
-
* | `wallType` |
|
|
93
|
+
* | `wallType` | {@linkcode PluginWallType}? | Legacy name/id or exact native `{ id, version }` pin from `design.types.list("wall")` (default generic) |
|
|
26
94
|
* | `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) |
|
|
95
|
+
* | `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) |
|
|
27
96
|
*/
|
|
28
97
|
export const PluginCreateWallRunItem = z.object({
|
|
29
98
|
profile: ProfileHandle,
|
|
30
99
|
height: z.number().optional(),
|
|
31
100
|
thickness: z.number().optional(),
|
|
32
|
-
wallType:
|
|
101
|
+
wallType: PluginWallType.optional(),
|
|
33
102
|
storey: z.number().int().optional(),
|
|
103
|
+
topProfiles: z.array(PluginWallTopProfile.nullable()).optional(),
|
|
104
|
+
/** Optional family overrides in mm/degrees. Host length/height stay geometry inputs. */
|
|
105
|
+
values: PluginFamilyValues.optional(),
|
|
34
106
|
})
|
|
35
107
|
export type PluginCreateWallRunItem = z.infer<typeof PluginCreateWallRunItem>
|
|
36
108
|
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
BrepHandle,
|
|
5
5
|
ComponentHandle,
|
|
6
6
|
ContourHandle,
|
|
7
|
+
LineHandle,
|
|
7
8
|
CurveHandle,
|
|
8
9
|
ProfileHandle,
|
|
9
10
|
Vec3Handle,
|
|
@@ -28,6 +29,15 @@ import type {
|
|
|
28
29
|
PluginCreateWallRunItem,
|
|
29
30
|
PluginCreateWindowItem,
|
|
30
31
|
} from "./bulk-items"
|
|
32
|
+
import { PluginWallTopProfile } from "./bulk-items"
|
|
33
|
+
import { PluginWallType } from "../types"
|
|
34
|
+
import {
|
|
35
|
+
PluginFamilyPlacement,
|
|
36
|
+
PluginFamilyFloorOptions,
|
|
37
|
+
PluginFamilySlabOptions,
|
|
38
|
+
PluginFamilyCeilingOptions,
|
|
39
|
+
PluginFamilyValues,
|
|
40
|
+
} from "../catalog"
|
|
31
41
|
|
|
32
42
|
/**
|
|
33
43
|
* `design.create.*` — author new scene-committed BIM entities.
|
|
@@ -42,6 +52,12 @@ import type {
|
|
|
42
52
|
* Footprint objects take a {@linkcode ContourHandle} (outer profile + holes);
|
|
43
53
|
* build one with `snaptrude.core.geom.create.contourFromProfile(s)`.
|
|
44
54
|
*
|
|
55
|
+
* Family overloads take `{ type, values? }` from `design.catalog`. The family supplies
|
|
56
|
+
* construction; the contour or axis supplies instance geometry. Geometry uses SU,
|
|
57
|
+
* while family length overrides use mm and angles use degrees. Omitted parameters
|
|
58
|
+
* retain family defaults; shared/type, formula and geometry-bound overrides are refused.
|
|
59
|
+
* Placement never publishes a definition. Unsupported references or geometry fail before mutation.
|
|
60
|
+
*
|
|
45
61
|
* `door`/`window` place a catalog item into a host wall (the world point is
|
|
46
62
|
* projected onto the wall face to locate the opening; the wall is re-cut in one
|
|
47
63
|
* undo entry) and throw if the point projects outside the wall. `smartLayout` is
|
|
@@ -218,20 +234,29 @@ export abstract class PluginDesignCreateApi {
|
|
|
218
234
|
* ```
|
|
219
235
|
*/
|
|
220
236
|
public abstract slab(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
237
|
+
...args:
|
|
238
|
+
| [
|
|
239
|
+
contour: ContourHandle,
|
|
240
|
+
thickness: number,
|
|
241
|
+
direction?: "up" | "down",
|
|
242
|
+
slabType?: PluginSlabType,
|
|
243
|
+
]
|
|
244
|
+
| [contour: ContourHandle, options: PluginFamilySlabOptions]
|
|
225
245
|
): PluginApiReturn<ComponentHandle>
|
|
226
246
|
|
|
227
247
|
/**
|
|
228
248
|
* Create a **floor** by extruding a footprint contour by `thickness`
|
|
229
249
|
* (extruded upward).
|
|
230
250
|
*
|
|
251
|
+
* The native family overload takes `{ type, values?, position? }`. Contour
|
|
252
|
+
* geometry uses SU; family values use mm. The family supplies layer thickness.
|
|
253
|
+
* PG2 can split or merge the footprint, so both overloads return an array.
|
|
254
|
+
* A merge into an existing floor can return no newly created handles.
|
|
255
|
+
*
|
|
231
256
|
* @param contour - Footprint (outer + holes)
|
|
232
257
|
* @param thickness - Floor thickness (> 0)
|
|
233
258
|
* @param position - Offset from origin
|
|
234
|
-
* @returns
|
|
259
|
+
* @returns Newly created {@linkcode ComponentHandle}s; an empty array after a merge
|
|
235
260
|
* @throws if the contour is invalid or the thickness is not positive
|
|
236
261
|
*
|
|
237
262
|
* @examplePrompt Create a floor from this room outline
|
|
@@ -246,15 +271,15 @@ export abstract class PluginDesignCreateApi {
|
|
|
246
271
|
* const floor = await snaptrude.design.create.floor(contour, 0.1)
|
|
247
272
|
* ```
|
|
248
273
|
*
|
|
249
|
-
* @performance For
|
|
250
|
-
* host round-trip and
|
|
251
|
-
*
|
|
274
|
+
* @performance For dimensional floors, `design.create.floors(items[])` uses one
|
|
275
|
+
* host round-trip and one undo entry. That bulk method does not accept native
|
|
276
|
+
* family options; use this method for a family-backed floor.
|
|
252
277
|
*/
|
|
253
278
|
public abstract floor(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
): PluginApiReturn<ComponentHandle>
|
|
279
|
+
...args:
|
|
280
|
+
| [contour: ContourHandle, thickness: number, position?: Vec3Handle]
|
|
281
|
+
| [contour: ContourHandle, options: PluginFamilyFloorOptions]
|
|
282
|
+
): PluginApiReturn<ComponentHandle[]>
|
|
258
283
|
|
|
259
284
|
/**
|
|
260
285
|
* Create **many floors** in one undoable operation (bulk plural of
|
|
@@ -319,7 +344,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
319
344
|
*/
|
|
320
345
|
public abstract roof(
|
|
321
346
|
contour: ContourHandle,
|
|
322
|
-
thickness: number,
|
|
347
|
+
thickness: number | PluginFamilyPlacement,
|
|
323
348
|
): PluginApiReturn<ComponentHandle>
|
|
324
349
|
|
|
325
350
|
/**
|
|
@@ -345,9 +370,9 @@ export abstract class PluginDesignCreateApi {
|
|
|
345
370
|
* ```
|
|
346
371
|
*/
|
|
347
372
|
public abstract ceiling(
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
373
|
+
...args:
|
|
374
|
+
| [contour: ContourHandle, thickness: number, heightFromFloor?: number]
|
|
375
|
+
| [contour: ContourHandle, options: PluginFamilyCeilingOptions]
|
|
351
376
|
): PluginApiReturn<ComponentHandle>
|
|
352
377
|
|
|
353
378
|
/**
|
|
@@ -378,10 +403,14 @@ export abstract class PluginDesignCreateApi {
|
|
|
378
403
|
* ```
|
|
379
404
|
*/
|
|
380
405
|
public abstract column(
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
406
|
+
...args:
|
|
407
|
+
| [
|
|
408
|
+
position: Vec3Handle,
|
|
409
|
+
crossSection: ContourHandle,
|
|
410
|
+
height: number,
|
|
411
|
+
directionUp?: Vec3Handle,
|
|
412
|
+
]
|
|
413
|
+
| [axis: LineHandle, options: PluginFamilyPlacement]
|
|
385
414
|
): PluginApiReturn<ComponentHandle>
|
|
386
415
|
|
|
387
416
|
/**
|
|
@@ -425,9 +454,9 @@ export abstract class PluginDesignCreateApi {
|
|
|
425
454
|
* ```
|
|
426
455
|
*/
|
|
427
456
|
public abstract beam(
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
457
|
+
...args:
|
|
458
|
+
| [section: ContourHandle, length: number, direction?: Vec3Handle]
|
|
459
|
+
| [axis: LineHandle, options: PluginFamilyPlacement]
|
|
431
460
|
): PluginApiReturn<ComponentHandle>
|
|
432
461
|
|
|
433
462
|
/**
|
|
@@ -438,21 +467,27 @@ export abstract class PluginDesignCreateApi {
|
|
|
438
467
|
* @param height - Wall height (default engine default)
|
|
439
468
|
* @param thickness - Wall thickness (default: the `wallType`'s total layer
|
|
440
469
|
* thickness when `wallType` is given, else the engine default)
|
|
441
|
-
* @param wallType -
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
* generic wall.
|
|
470
|
+
* @param wallType - Legacy label/`wall:` id, or the exact `nativeFamily`
|
|
471
|
+
* `{ id, version }` pin from `design.types.list("wall")`. Native pins are
|
|
472
|
+
* authorized on every use; selecting a family in Draw is not registration.
|
|
473
|
+
* Native pins support straight horizontal centerlines and flat tops only.
|
|
474
|
+
* Omit thickness for native pins; a conflicting explicit thickness rejects.
|
|
475
|
+
* Default: the engine's generic wall.
|
|
447
476
|
* @param storey - Target storey (integer: `1` ground, `2` first floor, `-1`
|
|
448
477
|
* basement — same convention as `design.create.space`). The walls are
|
|
449
478
|
* assigned to it and lifted to its base elevation, all inside the same
|
|
450
479
|
* single undo entry. The storey must already exist
|
|
451
480
|
* (`core.storeys.create` first). Default: geometry-derived — a profile
|
|
452
481
|
* drawn at y = 0 lands on storey 1; the ACTIVE storey is NOT consulted.
|
|
482
|
+
* @param topProfiles - Optional top edge per curve of `profile` (same order):
|
|
483
|
+
* a {@linkcode PluginWallTopProfile} makes that wall raked / gabled; `null`
|
|
484
|
+
* or a missing entry keeps it flat at `height`. Straight curves only. Such
|
|
485
|
+
* walls are non-parametric (see {@linkcode PluginWallTopProfile}).
|
|
453
486
|
* @returns a {@linkcode ComponentHandle}`[]` (one per wall), in profile order
|
|
454
487
|
* @throws if the profile is empty, `wallType` names no wall type in the
|
|
455
|
-
* project, `storey` does not exist,
|
|
488
|
+
* project, `storey` does not exist, `topProfiles` has more entries than the
|
|
489
|
+
* profile has curves or names an arc curve, a top profile drops to the wall
|
|
490
|
+
* base at a mitred corner, or wall creation fails
|
|
456
491
|
*
|
|
457
492
|
* @examplePrompt Draw walls along this centerline
|
|
458
493
|
* @examplePrompt Create 3m high, 200mm thick walls from these points
|
|
@@ -461,6 +496,9 @@ export abstract class PluginDesignCreateApi {
|
|
|
461
496
|
* @examplePrompt Add walls with mitred corners along the path
|
|
462
497
|
* @examplePrompt Draw brick walls with plaster along this outline
|
|
463
498
|
* @examplePrompt Build the perimeter in exposed concrete walls
|
|
499
|
+
* @examplePrompt Create a raked wall that slopes from 3m to 5m
|
|
500
|
+
* @examplePrompt Build a gable end wall with the ridge in the middle
|
|
501
|
+
* @examplePrompt Draw a wall with a sloped top edge
|
|
464
502
|
*
|
|
465
503
|
* # Example
|
|
466
504
|
* ```ts
|
|
@@ -476,6 +514,13 @@ export abstract class PluginDesignCreateApi {
|
|
|
476
514
|
* const brickWalls = await snaptrude.design.create.walls(
|
|
477
515
|
* centerlines, 3, undefined, brick.label,
|
|
478
516
|
* )
|
|
517
|
+
* // …a raked wall (3m at the start, 5m at the end) on a single centerline:
|
|
518
|
+
* const run = await snaptrude.core.geom.create.profileFromCurves([
|
|
519
|
+
* await snaptrude.core.geom.create.line(await v.new(0, 0, 10), await v.new(8, 0, 10)),
|
|
520
|
+
* ])
|
|
521
|
+
* const [raked] = await snaptrude.design.create.walls(run, undefined, 0.2, undefined, undefined, [
|
|
522
|
+
* [{ along: 0, height: 3 }, { along: 1, height: 5 }],
|
|
523
|
+
* ])
|
|
479
524
|
* ```
|
|
480
525
|
*
|
|
481
526
|
* @performance For MORE THAN ONE run, call `design.create.wallRuns(items[])` — one
|
|
@@ -486,8 +531,10 @@ export abstract class PluginDesignCreateApi {
|
|
|
486
531
|
profile: ProfileHandle,
|
|
487
532
|
height?: number,
|
|
488
533
|
thickness?: number,
|
|
489
|
-
wallType?:
|
|
534
|
+
wallType?: PluginWallType,
|
|
490
535
|
storey?: number,
|
|
536
|
+
topProfiles?: (PluginWallTopProfile | null)[],
|
|
537
|
+
values?: PluginFamilyValues,
|
|
491
538
|
): PluginApiReturn<ComponentHandle[]>
|
|
492
539
|
|
|
493
540
|
/**
|
|
@@ -496,7 +543,9 @@ export abstract class PluginDesignCreateApi {
|
|
|
496
543
|
* item's profile chain, mitred at shared endpoints. Junctions resolve within a
|
|
497
544
|
* run, not between runs. Each item carries its own
|
|
498
545
|
* dimensions, `wallType` and `storey`, so a single call can build a whole
|
|
499
|
-
* floor plate or several storeys at once.
|
|
546
|
+
* floor plate or several storeys at once. Per-curve `topProfiles` make raked
|
|
547
|
+
* or gabled walls (see {@linkcode PluginWallTopProfile}). Validate-all-or-throw;
|
|
548
|
+
* one command.
|
|
500
549
|
*
|
|
501
550
|
* @param items - One {@linkcode PluginCreateWallRunItem} per run to create
|
|
502
551
|
* (≥1, ≤1000)
|
|
@@ -516,6 +565,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
516
565
|
* @examplePrompt Bulk create wall runs from these centerlines
|
|
517
566
|
* @examplePrompt Create the walls for both storeys in a single undo step
|
|
518
567
|
* @examplePrompt Turn these polylines into 200mm brick walls together
|
|
568
|
+
* @examplePrompt Import these raked walls with their top profiles in one go
|
|
519
569
|
*
|
|
520
570
|
* @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
|
|
521
571
|
* entry. Always prefer this over calling `design.create.walls` in a loop: build the
|
|
@@ -536,6 +586,9 @@ export abstract class PluginDesignCreateApi {
|
|
|
536
586
|
* const [groundWalls, upperWalls] = await snaptrude.design.create.wallRuns([
|
|
537
587
|
* { profile: ground, height: 3, thickness: 0.2 },
|
|
538
588
|
* { profile: upper, height: 3, storey: 2 },
|
|
589
|
+
* // one gable wall: 3m at both ends, 5m ridge in the middle
|
|
590
|
+
* { profile: upper, thickness: 0.2, storey: 3,
|
|
591
|
+
* topProfiles: [[{ along: 0, height: 3 }, { along: 0.5, height: 5 }, { along: 1, height: 3 }]] },
|
|
539
592
|
* ])
|
|
540
593
|
* console.log(groundWalls.length, "walls on the ground floor")
|
|
541
594
|
* ```
|
|
@@ -1636,21 +1689,24 @@ export type PluginDesignCreateBeamArgs = z.infer<
|
|
|
1636
1689
|
* | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (wall centerlines) |
|
|
1637
1690
|
* | `height` | `number`? | Wall height (default engine default) |
|
|
1638
1691
|
* | `thickness` | `number`? | Wall thickness (default: `wallType`'s total layer thickness when given, else engine default) |
|
|
1639
|
-
* | `wallType` |
|
|
1692
|
+
* | `wallType` | {@linkcode PluginWallType}? | Legacy name/id or exact native `{ id, version }` pin from `design.types.list("wall")` (default generic) |
|
|
1640
1693
|
* | `storey` | `number`? | Target storey (integer, must exist) — walls assigned + lifted to its base in the same undo entry (default: geometry-derived) |
|
|
1694
|
+
* | `topProfiles` | ({@linkcode PluginWallTopProfile} \| `null`)[]? | Top edge per curve (same order); `null`/missing = flat at `height`. Straight curves only |
|
|
1641
1695
|
*/
|
|
1642
1696
|
export const PluginDesignCreateWallsArgs = z.object({
|
|
1643
1697
|
profile: ProfileHandle,
|
|
1644
1698
|
height: z.number().optional(),
|
|
1645
1699
|
thickness: z.number().optional(),
|
|
1646
|
-
wallType:
|
|
1700
|
+
wallType: PluginWallType.optional(),
|
|
1647
1701
|
storey: z.number().int().optional(),
|
|
1702
|
+
topProfiles: z.array(PluginWallTopProfile.nullable()).optional(),
|
|
1703
|
+
values: PluginFamilyValues.optional(),
|
|
1648
1704
|
})
|
|
1649
1705
|
export type PluginDesignCreateWallsArgs = z.infer<
|
|
1650
1706
|
typeof PluginDesignCreateWallsArgs
|
|
1651
1707
|
>
|
|
1652
|
-
// TRANSPORT: positional signature shipped — storey is the
|
|
1653
|
-
// walls(profile: ProfileHandle, height?: number, thickness?: number, wallType?: string, storey?: number)
|
|
1708
|
+
// TRANSPORT: positional signature shipped — storey is the 5th arg, topProfiles the trailing 6th:
|
|
1709
|
+
// walls(profile: ProfileHandle, height?: number, thickness?: number, wallType?: string, storey?: number, topProfiles?: (PluginWallTopProfile | null)[])
|
|
1654
1710
|
|
|
1655
1711
|
// ---------------------------------------------------------------------------
|
|
1656
1712
|
// staircase
|