@snaptrude/plugin-core 0.9.15 → 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.
Files changed (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/api/analysis/daylight.d.ts +5 -5
  3. package/dist/api/analysis/solar.d.ts +2 -2
  4. package/dist/api/core/camera/index.d.ts +418 -0
  5. package/dist/api/core/camera/index.d.ts.map +1 -1
  6. package/dist/api/design/bim.d.ts +209 -0
  7. package/dist/api/design/bim.d.ts.map +1 -0
  8. package/dist/api/design/catalog.d.ts +242 -0
  9. package/dist/api/design/catalog.d.ts.map +1 -0
  10. package/dist/api/design/create/bulk-items.d.ts +11 -3
  11. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  12. package/dist/api/design/create/index.d.ts +47 -20
  13. package/dist/api/design/create/index.d.ts.map +1 -1
  14. package/dist/api/design/family.d.ts +576 -12
  15. package/dist/api/design/family.d.ts.map +1 -1
  16. package/dist/api/design/index.d.ts +16 -0
  17. package/dist/api/design/index.d.ts.map +1 -1
  18. package/dist/api/design/networks.d.ts +1703 -0
  19. package/dist/api/design/networks.d.ts.map +1 -0
  20. package/dist/api/design/query/index.d.ts +30 -30
  21. package/dist/api/design/selection/index.d.ts +10 -10
  22. package/dist/api/design/types/index.d.ts +40 -24
  23. package/dist/api/design/types/index.d.ts.map +1 -1
  24. package/dist/api/design/update/index.d.ts +40 -3
  25. package/dist/api/design/update/index.d.ts.map +1 -1
  26. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  27. package/dist/api/presentation/index.d.ts +9 -0
  28. package/dist/api/presentation/index.d.ts.map +1 -1
  29. package/dist/api/presentation/walkthroughs.d.ts +1350 -0
  30. package/dist/api/presentation/walkthroughs.d.ts.map +1 -0
  31. package/dist/index.cjs +3255 -2176
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.js +3146 -2176
  34. package/dist/index.js.map +1 -1
  35. package/package.json +1 -1
  36. package/scripts/generate-manifest.mjs +5 -0
  37. package/src/api/core/camera/index.ts +400 -1
  38. package/src/api/design/bim.ts +121 -0
  39. package/src/api/design/catalog.ts +128 -0
  40. package/src/api/design/create/bulk-items.ts +6 -2
  41. package/src/api/design/create/index.ts +62 -32
  42. package/src/api/design/family.ts +448 -17
  43. package/src/api/design/index.ts +34 -4
  44. package/src/api/design/networks.ts +607 -0
  45. package/src/api/design/types/index.ts +31 -24
  46. package/src/api/design/update/index.ts +41 -3
  47. package/src/api/presentation/index.ts +9 -0
  48. package/src/api/presentation/walkthroughs.ts +1201 -0
  49. package/api-manifest.full.json +0 -8930
  50. package/api-manifest.json +0 -9318
@@ -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
@@ -88,7 +90,7 @@ export type PluginWallTopProfile = z.infer<typeof PluginWallTopProfile>
88
90
  * | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (wall centerlines) |
89
91
  * | `height` | `number`? | Wall height (Snaptrude units, > 0; default engine default) |
90
92
  * | `thickness` | `number`? | Wall thickness (Snaptrude units, > 0; default: `wallType`'s total layer thickness when given, else engine default) |
91
- * | `wallType` | `string`? | Wall type name from `design.types.list("wall")` — layers/material/thickness defaults (default generic) |
93
+ * | `wallType` | {@linkcode PluginWallType}? | Legacy name/id or exact native `{ id, version }` pin from `design.types.list("wall")` (default generic) |
92
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) |
93
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) |
94
96
  */
@@ -96,9 +98,11 @@ export const PluginCreateWallRunItem = z.object({
96
98
  profile: ProfileHandle,
97
99
  height: z.number().optional(),
98
100
  thickness: z.number().optional(),
99
- wallType: z.string().min(1).optional(),
101
+ wallType: PluginWallType.optional(),
100
102
  storey: z.number().int().optional(),
101
103
  topProfiles: z.array(PluginWallTopProfile.nullable()).optional(),
104
+ /** Optional family overrides in mm/degrees. Host length/height stay geometry inputs. */
105
+ values: PluginFamilyValues.optional(),
102
106
  })
103
107
  export type PluginCreateWallRunItem = z.infer<typeof PluginCreateWallRunItem>
104
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,
@@ -29,6 +30,14 @@ import type {
29
30
  PluginCreateWindowItem,
30
31
  } from "./bulk-items"
31
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"
32
41
 
33
42
  /**
34
43
  * `design.create.*` — author new scene-committed BIM entities.
@@ -43,6 +52,12 @@ import { PluginWallTopProfile } from "./bulk-items"
43
52
  * Footprint objects take a {@linkcode ContourHandle} (outer profile + holes);
44
53
  * build one with `snaptrude.core.geom.create.contourFromProfile(s)`.
45
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
+ *
46
61
  * `door`/`window` place a catalog item into a host wall (the world point is
47
62
  * projected onto the wall face to locate the opening; the wall is re-cut in one
48
63
  * undo entry) and throw if the point projects outside the wall. `smartLayout` is
@@ -219,20 +234,29 @@ export abstract class PluginDesignCreateApi {
219
234
  * ```
220
235
  */
221
236
  public abstract slab(
222
- contour: ContourHandle,
223
- thickness: number,
224
- direction?: "up" | "down",
225
- slabType?: PluginSlabType,
237
+ ...args:
238
+ | [
239
+ contour: ContourHandle,
240
+ thickness: number,
241
+ direction?: "up" | "down",
242
+ slabType?: PluginSlabType,
243
+ ]
244
+ | [contour: ContourHandle, options: PluginFamilySlabOptions]
226
245
  ): PluginApiReturn<ComponentHandle>
227
246
 
228
247
  /**
229
248
  * Create a **floor** by extruding a footprint contour by `thickness`
230
249
  * (extruded upward).
231
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
+ *
232
256
  * @param contour - Footprint (outer + holes)
233
257
  * @param thickness - Floor thickness (> 0)
234
258
  * @param position - Offset from origin
235
- * @returns the {@linkcode ComponentHandle} of the created floor
259
+ * @returns Newly created {@linkcode ComponentHandle}s; an empty array after a merge
236
260
  * @throws if the contour is invalid or the thickness is not positive
237
261
  *
238
262
  * @examplePrompt Create a floor from this room outline
@@ -247,15 +271,15 @@ export abstract class PluginDesignCreateApi {
247
271
  * const floor = await snaptrude.design.create.floor(contour, 0.1)
248
272
  * ```
249
273
  *
250
- * @performance For MORE THAN ONE floor, call `design.create.floors(items[])` — one
251
- * host round-trip and ONE undo entry for the whole batch. Looping this single-floor
252
- * creator is N round-trips and N undo entries.
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.
253
277
  */
254
278
  public abstract floor(
255
- contour: ContourHandle,
256
- thickness: number,
257
- position?: Vec3Handle,
258
- ): PluginApiReturn<ComponentHandle>
279
+ ...args:
280
+ | [contour: ContourHandle, thickness: number, position?: Vec3Handle]
281
+ | [contour: ContourHandle, options: PluginFamilyFloorOptions]
282
+ ): PluginApiReturn<ComponentHandle[]>
259
283
 
260
284
  /**
261
285
  * Create **many floors** in one undoable operation (bulk plural of
@@ -320,7 +344,7 @@ export abstract class PluginDesignCreateApi {
320
344
  */
321
345
  public abstract roof(
322
346
  contour: ContourHandle,
323
- thickness: number,
347
+ thickness: number | PluginFamilyPlacement,
324
348
  ): PluginApiReturn<ComponentHandle>
325
349
 
326
350
  /**
@@ -346,9 +370,9 @@ export abstract class PluginDesignCreateApi {
346
370
  * ```
347
371
  */
348
372
  public abstract ceiling(
349
- contour: ContourHandle,
350
- thickness: number,
351
- heightFromFloor?: number,
373
+ ...args:
374
+ | [contour: ContourHandle, thickness: number, heightFromFloor?: number]
375
+ | [contour: ContourHandle, options: PluginFamilyCeilingOptions]
352
376
  ): PluginApiReturn<ComponentHandle>
353
377
 
354
378
  /**
@@ -379,10 +403,14 @@ export abstract class PluginDesignCreateApi {
379
403
  * ```
380
404
  */
381
405
  public abstract column(
382
- position: Vec3Handle,
383
- crossSection: ContourHandle,
384
- height: number,
385
- directionUp?: Vec3Handle,
406
+ ...args:
407
+ | [
408
+ position: Vec3Handle,
409
+ crossSection: ContourHandle,
410
+ height: number,
411
+ directionUp?: Vec3Handle,
412
+ ]
413
+ | [axis: LineHandle, options: PluginFamilyPlacement]
386
414
  ): PluginApiReturn<ComponentHandle>
387
415
 
388
416
  /**
@@ -426,9 +454,9 @@ export abstract class PluginDesignCreateApi {
426
454
  * ```
427
455
  */
428
456
  public abstract beam(
429
- section: ContourHandle,
430
- length: number,
431
- direction?: Vec3Handle,
457
+ ...args:
458
+ | [section: ContourHandle, length: number, direction?: Vec3Handle]
459
+ | [axis: LineHandle, options: PluginFamilyPlacement]
432
460
  ): PluginApiReturn<ComponentHandle>
433
461
 
434
462
  /**
@@ -439,12 +467,12 @@ export abstract class PluginDesignCreateApi {
439
467
  * @param height - Wall height (default engine default)
440
468
  * @param thickness - Wall thickness (default: the `wallType`'s total layer
441
469
  * thickness when `wallType` is given, else the engine default)
442
- * @param wallType - Wall type to build with — the same searchable list the
443
- * Draw tab's Wall Type dropdown offers. Pass a name from
444
- * `design.types.list("wall")` (the summary's `label`, or its `"wall:…"` id).
445
- * Drives the wall's construction layers and default material, and — when
446
- * `thickness` is omitted — its total layer thickness. Default: the engine's
447
- * 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.
448
476
  * @param storey - Target storey (integer: `1` ground, `2` first floor, `-1`
449
477
  * basement — same convention as `design.create.space`). The walls are
450
478
  * assigned to it and lifted to its base elevation, all inside the same
@@ -503,9 +531,10 @@ export abstract class PluginDesignCreateApi {
503
531
  profile: ProfileHandle,
504
532
  height?: number,
505
533
  thickness?: number,
506
- wallType?: string,
534
+ wallType?: PluginWallType,
507
535
  storey?: number,
508
536
  topProfiles?: (PluginWallTopProfile | null)[],
537
+ values?: PluginFamilyValues,
509
538
  ): PluginApiReturn<ComponentHandle[]>
510
539
 
511
540
  /**
@@ -1660,7 +1689,7 @@ export type PluginDesignCreateBeamArgs = z.infer<
1660
1689
  * | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (wall centerlines) |
1661
1690
  * | `height` | `number`? | Wall height (default engine default) |
1662
1691
  * | `thickness` | `number`? | Wall thickness (default: `wallType`'s total layer thickness when given, else engine default) |
1663
- * | `wallType` | `string`? | Wall type name from `design.types.list("wall")` — layers/material/thickness defaults (default generic) |
1692
+ * | `wallType` | {@linkcode PluginWallType}? | Legacy name/id or exact native `{ id, version }` pin from `design.types.list("wall")` (default generic) |
1664
1693
  * | `storey` | `number`? | Target storey (integer, must exist) — walls assigned + lifted to its base in the same undo entry (default: geometry-derived) |
1665
1694
  * | `topProfiles` | ({@linkcode PluginWallTopProfile} \| `null`)[]? | Top edge per curve (same order); `null`/missing = flat at `height`. Straight curves only |
1666
1695
  */
@@ -1668,9 +1697,10 @@ export const PluginDesignCreateWallsArgs = z.object({
1668
1697
  profile: ProfileHandle,
1669
1698
  height: z.number().optional(),
1670
1699
  thickness: z.number().optional(),
1671
- wallType: z.string().min(1).optional(),
1700
+ wallType: PluginWallType.optional(),
1672
1701
  storey: z.number().int().optional(),
1673
1702
  topProfiles: z.array(PluginWallTopProfile.nullable()).optional(),
1703
+ values: PluginFamilyValues.optional(),
1674
1704
  })
1675
1705
  export type PluginDesignCreateWallsArgs = z.infer<
1676
1706
  typeof PluginDesignCreateWallsArgs