@snaptrude/plugin-core 1.0.2 → 1.0.4

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 (106) hide show
  1. package/AGENTS.md +17 -0
  2. package/CHANGELOG.md +12 -0
  3. package/api-manifest.json +130 -2098
  4. package/dist/api/core/camera/index.d.ts +16 -6
  5. package/dist/api/core/camera/index.d.ts.map +1 -1
  6. package/dist/api/core/comment/index.d.ts +7 -3
  7. package/dist/api/core/comment/index.d.ts.map +1 -1
  8. package/dist/api/core/geom/create/index.d.ts +69 -21
  9. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  10. package/dist/api/core/geom/query/circle.d.ts +31 -11
  11. package/dist/api/core/geom/query/circle.d.ts.map +1 -1
  12. package/dist/api/core/geom/query/contour.d.ts +19 -7
  13. package/dist/api/core/geom/query/contour.d.ts.map +1 -1
  14. package/dist/api/core/geom/query/curve.d.ts +72 -24
  15. package/dist/api/core/geom/query/curve.d.ts.map +1 -1
  16. package/dist/api/core/geom/query/profile.d.ts +19 -7
  17. package/dist/api/core/geom/query/profile.d.ts.map +1 -1
  18. package/dist/api/core/geom/update/contour.d.ts +36 -12
  19. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  20. package/dist/api/core/geom/update/curve.d.ts +13 -5
  21. package/dist/api/core/geom/update/curve.d.ts.map +1 -1
  22. package/dist/api/core/geom/update/profile.d.ts +36 -12
  23. package/dist/api/core/geom/update/profile.d.ts.map +1 -1
  24. package/dist/api/core/io/import/index.d.ts +7 -3
  25. package/dist/api/core/io/import/index.d.ts.map +1 -1
  26. package/dist/api/core/math/quat.d.ts +2 -2
  27. package/dist/api/core/math/quat.d.ts.map +1 -1
  28. package/dist/api/core/math/vec3.d.ts +15 -15
  29. package/dist/api/core/math/vec3.d.ts.map +1 -1
  30. package/dist/api/core/storeys/index.d.ts +5 -0
  31. package/dist/api/core/storeys/index.d.ts.map +1 -1
  32. package/dist/api/design/boolean/index.d.ts +20 -4
  33. package/dist/api/design/boolean/index.d.ts.map +1 -1
  34. package/dist/api/design/create/bulk-items.d.ts +88 -17
  35. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  36. package/dist/api/design/create/index.d.ts +146 -59
  37. package/dist/api/design/create/index.d.ts.map +1 -1
  38. package/dist/api/design/create/opening-fields.d.ts +18 -6
  39. package/dist/api/design/create/opening-fields.d.ts.map +1 -1
  40. package/dist/api/design/delete/index.d.ts +14 -7
  41. package/dist/api/design/delete/index.d.ts.map +1 -1
  42. package/dist/api/design/dimensions.d.ts +12 -4
  43. package/dist/api/design/dimensions.d.ts.map +1 -1
  44. package/dist/api/design/doors/index.d.ts +37 -0
  45. package/dist/api/design/doors/index.d.ts.map +1 -1
  46. package/dist/api/design/edit/index.d.ts +7 -3
  47. package/dist/api/design/edit/index.d.ts.map +1 -1
  48. package/dist/api/design/family.d.ts +5 -1
  49. package/dist/api/design/family.d.ts.map +1 -1
  50. package/dist/api/design/index.d.ts +1 -0
  51. package/dist/api/design/index.d.ts.map +1 -1
  52. package/dist/api/design/lock.d.ts +3 -0
  53. package/dist/api/design/lock.d.ts.map +1 -1
  54. package/dist/api/design/opening-placement.d.ts +135 -0
  55. package/dist/api/design/opening-placement.d.ts.map +1 -0
  56. package/dist/api/design/transform/index.d.ts +28 -8
  57. package/dist/api/design/transform/index.d.ts.map +1 -1
  58. package/dist/api/design/windows/index.d.ts +23 -0
  59. package/dist/api/design/windows/index.d.ts.map +1 -1
  60. package/dist/api/entity/space.d.ts +30 -6
  61. package/dist/api/entity/space.d.ts.map +1 -1
  62. package/dist/api/entity/story.d.ts +4 -0
  63. package/dist/api/entity/story.d.ts.map +1 -1
  64. package/dist/api/presentation/drawings.d.ts +1 -1
  65. package/dist/api/presentation/views.d.ts +5 -1
  66. package/dist/api/presentation/views.d.ts.map +1 -1
  67. package/dist/handles.d.ts +8 -0
  68. package/dist/handles.d.ts.map +1 -1
  69. package/dist/index.cjs +2510 -2427
  70. package/dist/index.cjs.map +1 -1
  71. package/dist/index.js +2506 -2427
  72. package/dist/index.js.map +1 -1
  73. package/package.json +13 -13
  74. package/src/api/core/camera/index.ts +9 -7
  75. package/src/api/core/comment/index.ts +3 -3
  76. package/src/api/core/geom/create/index.ts +25 -25
  77. package/src/api/core/geom/query/circle.ts +11 -11
  78. package/src/api/core/geom/query/contour.ts +7 -6
  79. package/src/api/core/geom/query/curve.ts +25 -25
  80. package/src/api/core/geom/query/profile.ts +7 -6
  81. package/src/api/core/geom/update/contour.ts +12 -11
  82. package/src/api/core/geom/update/curve.ts +5 -5
  83. package/src/api/core/geom/update/profile.ts +12 -11
  84. package/src/api/core/io/import/index.ts +3 -2
  85. package/src/api/core/math/quat.ts +2 -2
  86. package/src/api/core/math/vec3.ts +16 -16
  87. package/src/api/core/storeys/index.ts +5 -0
  88. package/src/api/design/boolean/index.ts +2 -2
  89. package/src/api/design/create/bulk-items.ts +11 -3
  90. package/src/api/design/create/index.ts +46 -46
  91. package/src/api/design/create/opening-fields.ts +7 -7
  92. package/src/api/design/delete/index.ts +14 -7
  93. package/src/api/design/dimensions.ts +5 -4
  94. package/src/api/design/doors/index.ts +43 -0
  95. package/src/api/design/edit/index.ts +3 -3
  96. package/src/api/design/family.ts +2 -1
  97. package/src/api/design/index.ts +1 -0
  98. package/src/api/design/lock.ts +6 -0
  99. package/src/api/design/opening-placement.ts +79 -0
  100. package/src/api/design/transform/index.ts +15 -7
  101. package/src/api/design/windows/index.ts +29 -0
  102. package/src/api/entity/space.ts +5 -4
  103. package/src/api/entity/story.ts +4 -0
  104. package/src/api/presentation/views.ts +7 -2
  105. package/src/handles.ts +11 -0
  106. package/test/handles.test.mjs +36 -0
@@ -3,6 +3,7 @@ import { PluginApiReturn } from "../../../../types"
3
3
  import {
4
4
  ProfileHandle,
5
5
  Vec3Handle,
6
+ Vec3Input,
6
7
  CurveHandle,
7
8
  Vec3Components,
8
9
  BBoxComponents,
@@ -136,7 +137,7 @@ export abstract class PluginGeomQueryProfileApi {
136
137
  */
137
138
  public abstract getNearestPoint(
138
139
  profile: ProfileHandle,
139
- point: Vec3Handle,
140
+ point: Vec3Input,
140
141
  ): PluginApiReturn<Vec3Components>
141
142
 
142
143
  /**
@@ -157,7 +158,7 @@ export abstract class PluginGeomQueryProfileApi {
157
158
  */
158
159
  public abstract hasPoint(
159
160
  profile: ProfileHandle,
160
- point: Vec3Handle,
161
+ point: Vec3Input,
161
162
  ): PluginApiReturn<boolean>
162
163
 
163
164
  /**
@@ -175,7 +176,7 @@ export abstract class PluginGeomQueryProfileApi {
175
176
  */
176
177
  public abstract isOnBoundary(
177
178
  profile: ProfileHandle,
178
- point: Vec3Handle,
179
+ point: Vec3Input,
179
180
  ): PluginApiReturn<boolean>
180
181
 
181
182
  /**
@@ -357,7 +358,7 @@ export type PluginGeomQueryProfileGetNormalArgs = z.infer<typeof PluginGeomQuery
357
358
  */
358
359
  export const PluginGeomQueryProfileGetNearestPointArgs = z.object({
359
360
  profile: ProfileHandle,
360
- point: Vec3Handle,
361
+ point: Vec3Input,
361
362
  })
362
363
 
363
364
  export type PluginGeomQueryProfileGetNearestPointArgs = z.infer<typeof PluginGeomQueryProfileGetNearestPointArgs>
@@ -372,7 +373,7 @@ export type PluginGeomQueryProfileGetNearestPointArgs = z.infer<typeof PluginGeo
372
373
  */
373
374
  export const PluginGeomQueryProfileHasPointArgs = z.object({
374
375
  profile: ProfileHandle,
375
- point: Vec3Handle,
376
+ point: Vec3Input,
376
377
  })
377
378
 
378
379
  export type PluginGeomQueryProfileHasPointArgs = z.infer<typeof PluginGeomQueryProfileHasPointArgs>
@@ -387,7 +388,7 @@ export type PluginGeomQueryProfileHasPointArgs = z.infer<typeof PluginGeomQueryP
387
388
  */
388
389
  export const PluginGeomQueryProfileIsOnBoundaryArgs = z.object({
389
390
  profile: ProfileHandle,
390
- point: Vec3Handle,
391
+ point: Vec3Input,
391
392
  })
392
393
 
393
394
  export type PluginGeomQueryProfileIsOnBoundaryArgs = z.infer<typeof PluginGeomQueryProfileIsOnBoundaryArgs>
@@ -4,6 +4,7 @@ import {
4
4
  ContourHandle,
5
5
  ProfileHandle,
6
6
  Vec3Handle,
7
+ Vec3Input,
7
8
  Vec3Components,
8
9
  } from "../../../../handles"
9
10
 
@@ -69,7 +70,7 @@ export abstract class PluginGeomUpdateContourApi {
69
70
  */
70
71
  public abstract move(
71
72
  contour: ContourHandle,
72
- translation: Vec3Handle,
73
+ translation: Vec3Input,
73
74
  ): PluginApiReturn<ContourHandle>
74
75
 
75
76
  /**
@@ -96,9 +97,9 @@ export abstract class PluginGeomUpdateContourApi {
96
97
  */
97
98
  public abstract rotate(
98
99
  contour: ContourHandle,
99
- axis: Vec3Handle,
100
+ axis: Vec3Input,
100
101
  angle: number,
101
- pivot?: Vec3Handle,
102
+ pivot?: Vec3Input,
102
103
  ): PluginApiReturn<ContourHandle>
103
104
 
104
105
  /**
@@ -124,7 +125,7 @@ export abstract class PluginGeomUpdateContourApi {
124
125
  public abstract scale(
125
126
  contour: ContourHandle,
126
127
  factor: number | Vec3Components,
127
- pivot?: Vec3Handle,
128
+ pivot?: Vec3Input,
128
129
  ): PluginApiReturn<ContourHandle>
129
130
 
130
131
  /**
@@ -149,7 +150,7 @@ export abstract class PluginGeomUpdateContourApi {
149
150
  */
150
151
  public abstract mirror(
151
152
  contour: ContourHandle,
152
- plane: { point: Vec3Handle; normal: Vec3Handle },
153
+ plane: { point: Vec3Input; normal: Vec3Input },
153
154
  ): PluginApiReturn<ContourHandle>
154
155
 
155
156
  /**
@@ -233,7 +234,7 @@ export type PluginGeomUpdateContourOffsetArgs = z.infer<typeof PluginGeomUpdateC
233
234
  */
234
235
  export const PluginGeomUpdateContourMoveArgs = z.object({
235
236
  contour: ContourHandle,
236
- translation: Vec3Handle,
237
+ translation: Vec3Input,
237
238
  })
238
239
 
239
240
  export type PluginGeomUpdateContourMoveArgs = z.infer<typeof PluginGeomUpdateContourMoveArgs>
@@ -250,9 +251,9 @@ export type PluginGeomUpdateContourMoveArgs = z.infer<typeof PluginGeomUpdateCon
250
251
  */
251
252
  export const PluginGeomUpdateContourRotateArgs = z.object({
252
253
  contour: ContourHandle,
253
- axis: Vec3Handle,
254
+ axis: Vec3Input,
254
255
  angle: z.number(),
255
- pivot: Vec3Handle.optional(),
256
+ pivot: Vec3Input.optional(),
256
257
  })
257
258
 
258
259
  export type PluginGeomUpdateContourRotateArgs = z.infer<typeof PluginGeomUpdateContourRotateArgs>
@@ -269,7 +270,7 @@ export type PluginGeomUpdateContourRotateArgs = z.infer<typeof PluginGeomUpdateC
269
270
  export const PluginGeomUpdateContourScaleArgs = z.object({
270
271
  contour: ContourHandle,
271
272
  factor: z.union([z.number(), Vec3Components]),
272
- pivot: Vec3Handle.optional(),
273
+ pivot: Vec3Input.optional(),
273
274
  })
274
275
 
275
276
  export type PluginGeomUpdateContourScaleArgs = z.infer<typeof PluginGeomUpdateContourScaleArgs>
@@ -285,8 +286,8 @@ export type PluginGeomUpdateContourScaleArgs = z.infer<typeof PluginGeomUpdateCo
285
286
  export const PluginGeomUpdateContourMirrorArgs = z.object({
286
287
  contour: ContourHandle,
287
288
  plane: z.object({
288
- point: Vec3Handle,
289
- normal: Vec3Handle,
289
+ point: Vec3Input,
290
+ normal: Vec3Input,
290
291
  }),
291
292
  })
292
293
 
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../../../types"
3
- import { Vec3Handle, CurveHandle } from "../../../../handles"
3
+ import { Vec3Handle, Vec3Input, CurveHandle } from "../../../../handles"
4
4
 
5
5
  /**
6
6
  * Curve editing — produce NEW curves from an existing one (all-handle model, §11).
@@ -61,7 +61,7 @@ export abstract class PluginGeomUpdateCurveApi {
61
61
  */
62
62
  public abstract split(
63
63
  curve: CurveHandle,
64
- point: Vec3Handle,
64
+ point: Vec3Input,
65
65
  ): PluginApiReturn<CurveHandle[]>
66
66
 
67
67
  /**
@@ -110,7 +110,7 @@ export abstract class PluginGeomUpdateCurveApi {
110
110
  */
111
111
  public abstract offset(
112
112
  curve: CurveHandle,
113
- vector: Vec3Handle,
113
+ vector: Vec3Input,
114
114
  ): PluginApiReturn<CurveHandle>
115
115
 
116
116
  /**
@@ -158,7 +158,7 @@ export type PluginGeomUpdateCurveExtendArgs = z.infer<typeof PluginGeomUpdateCur
158
158
  */
159
159
  export const PluginGeomUpdateCurveSplitArgs = z.object({
160
160
  curve: CurveHandle,
161
- point: Vec3Handle,
161
+ point: Vec3Input,
162
162
  })
163
163
 
164
164
  export type PluginGeomUpdateCurveSplitArgs = z.infer<typeof PluginGeomUpdateCurveSplitArgs>
@@ -190,7 +190,7 @@ export type PluginGeomUpdateCurveTrimArgs = z.infer<typeof PluginGeomUpdateCurve
190
190
  */
191
191
  export const PluginGeomUpdateCurveOffsetArgs = z.object({
192
192
  curve: CurveHandle,
193
- vector: Vec3Handle,
193
+ vector: Vec3Input,
194
194
  })
195
195
 
196
196
  export type PluginGeomUpdateCurveOffsetArgs = z.infer<typeof PluginGeomUpdateCurveOffsetArgs>
@@ -3,6 +3,7 @@ import { PluginApiReturn } from "../../../../types"
3
3
  import {
4
4
  ProfileHandle,
5
5
  Vec3Handle,
6
+ Vec3Input,
6
7
  CurveHandle,
7
8
  Vec3Components,
8
9
  } from "../../../../handles"
@@ -66,7 +67,7 @@ export abstract class PluginGeomUpdateProfileApi {
66
67
  */
67
68
  public abstract move(
68
69
  profile: ProfileHandle,
69
- translation: Vec3Handle,
70
+ translation: Vec3Input,
70
71
  ): PluginApiReturn<ProfileHandle>
71
72
 
72
73
  /**
@@ -91,9 +92,9 @@ export abstract class PluginGeomUpdateProfileApi {
91
92
  */
92
93
  public abstract rotate(
93
94
  profile: ProfileHandle,
94
- axis: Vec3Handle,
95
+ axis: Vec3Input,
95
96
  angle: number,
96
- pivot?: Vec3Handle,
97
+ pivot?: Vec3Input,
97
98
  ): PluginApiReturn<ProfileHandle>
98
99
 
99
100
  /**
@@ -118,7 +119,7 @@ export abstract class PluginGeomUpdateProfileApi {
118
119
  public abstract scale(
119
120
  profile: ProfileHandle,
120
121
  factor: number | Vec3Components,
121
- pivot?: Vec3Handle,
122
+ pivot?: Vec3Input,
122
123
  ): PluginApiReturn<ProfileHandle>
123
124
 
124
125
  /**
@@ -142,7 +143,7 @@ export abstract class PluginGeomUpdateProfileApi {
142
143
  */
143
144
  public abstract mirror(
144
145
  profile: ProfileHandle,
145
- plane: { point: Vec3Handle; normal: Vec3Handle },
146
+ plane: { point: Vec3Input; normal: Vec3Input },
146
147
  ): PluginApiReturn<ProfileHandle>
147
148
 
148
149
  /**
@@ -261,7 +262,7 @@ export type PluginGeomUpdateProfileOffsetArgs = z.infer<typeof PluginGeomUpdateP
261
262
  */
262
263
  export const PluginGeomUpdateProfileMoveArgs = z.object({
263
264
  profile: ProfileHandle,
264
- translation: Vec3Handle,
265
+ translation: Vec3Input,
265
266
  })
266
267
 
267
268
  export type PluginGeomUpdateProfileMoveArgs = z.infer<typeof PluginGeomUpdateProfileMoveArgs>
@@ -278,9 +279,9 @@ export type PluginGeomUpdateProfileMoveArgs = z.infer<typeof PluginGeomUpdatePro
278
279
  */
279
280
  export const PluginGeomUpdateProfileRotateArgs = z.object({
280
281
  profile: ProfileHandle,
281
- axis: Vec3Handle,
282
+ axis: Vec3Input,
282
283
  angle: z.number(),
283
- pivot: Vec3Handle.optional(),
284
+ pivot: Vec3Input.optional(),
284
285
  })
285
286
 
286
287
  export type PluginGeomUpdateProfileRotateArgs = z.infer<typeof PluginGeomUpdateProfileRotateArgs>
@@ -297,7 +298,7 @@ export type PluginGeomUpdateProfileRotateArgs = z.infer<typeof PluginGeomUpdateP
297
298
  export const PluginGeomUpdateProfileScaleArgs = z.object({
298
299
  profile: ProfileHandle,
299
300
  factor: z.union([z.number(), Vec3Components]),
300
- pivot: Vec3Handle.optional(),
301
+ pivot: Vec3Input.optional(),
301
302
  })
302
303
 
303
304
  export type PluginGeomUpdateProfileScaleArgs = z.infer<typeof PluginGeomUpdateProfileScaleArgs>
@@ -313,8 +314,8 @@ export type PluginGeomUpdateProfileScaleArgs = z.infer<typeof PluginGeomUpdatePr
313
314
  export const PluginGeomUpdateProfileMirrorArgs = z.object({
314
315
  profile: ProfileHandle,
315
316
  plane: z.object({
316
- point: Vec3Handle,
317
- normal: Vec3Handle,
317
+ point: Vec3Input,
318
+ normal: Vec3Input,
318
319
  }),
319
320
  })
320
321
 
@@ -2,6 +2,7 @@ import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../../../types"
3
3
  import {
4
4
  Vec3Handle,
5
+ Vec3Input,
5
6
  UnderlayHandle,
6
7
  TerrainHandle,
7
8
  ImportJobHandle,
@@ -266,7 +267,7 @@ export abstract class PluginCoreIoImportApi {
266
267
  source: string,
267
268
  storey?: number,
268
269
  format?: ModelFormat,
269
- position?: Vec3Handle,
270
+ position?: Vec3Input,
270
271
  label?: string,
271
272
  ): PluginApiReturn<ComponentHandle>
272
273
 
@@ -445,7 +446,7 @@ export const PluginImportModelArgs = z.object({
445
446
  source: ImportSource,
446
447
  storey: z.number().int().optional(),
447
448
  format: ModelFormat.optional(),
448
- position: Vec3Handle.optional(),
449
+ position: Vec3Input.optional(),
449
450
  label: z.string().optional(),
450
451
  })
451
452
  export type PluginImportModelArgs = z.infer<typeof PluginImportModelArgs>
@@ -1,5 +1,5 @@
1
1
  import { PluginApiReturn } from "../../../types"
2
- import { Vec3Handle, QuatHandle, QuatComponents } from "../../../handles"
2
+ import { Vec3Handle, Vec3Input, QuatHandle, QuatComponents } from "../../../handles"
3
3
 
4
4
  /**
5
5
  * Quaternion operations (all-handle model, §11).
@@ -39,7 +39,7 @@ export abstract class PluginQuatApi {
39
39
  * const quarterTurn = await snaptrude.core.math.quat.fromAxisAngle(axis, Math.PI / 2)
40
40
  * ```
41
41
  */
42
- abstract fromAxisAngle(axis: Vec3Handle, angle: number): PluginApiReturn<QuatHandle>
42
+ abstract fromAxisAngle(axis: Vec3Input, angle: number): PluginApiReturn<QuatHandle>
43
43
  /**
44
44
  * Build a quaternion from Euler angles in radians.
45
45
  *
@@ -1,5 +1,5 @@
1
1
  import { PluginApiReturn } from "../../../types"
2
- import { Vec3Handle, Vec3Components } from "../../../handles"
2
+ import { Vec3Handle, Vec3Input, Vec3Components } from "../../../handles"
3
3
 
4
4
  /**
5
5
  * 3D vector operations (all-handle model, §11).
@@ -31,7 +31,7 @@ export abstract class PluginVec3Api {
31
31
  * const sum = await snaptrude.core.math.vec3.add(a, b)
32
32
  * ```
33
33
  */
34
- abstract add(a: Vec3Handle, b: Vec3Handle): PluginApiReturn<Vec3Handle>
34
+ abstract add(a: Vec3Input, b: Vec3Input): PluginApiReturn<Vec3Handle>
35
35
  /**
36
36
  * Subtract vector `b` from `a` component-wise (`a - b`).
37
37
  *
@@ -42,7 +42,7 @@ export abstract class PluginVec3Api {
42
42
  * const diff = await snaptrude.core.math.vec3.subtract(a, b)
43
43
  * ```
44
44
  */
45
- abstract subtract(a: Vec3Handle, b: Vec3Handle): PluginApiReturn<Vec3Handle>
45
+ abstract subtract(a: Vec3Input, b: Vec3Input): PluginApiReturn<Vec3Handle>
46
46
  /**
47
47
  * Scale `v` by a scalar.
48
48
  *
@@ -52,7 +52,7 @@ export abstract class PluginVec3Api {
52
52
  * const doubled = await snaptrude.core.math.vec3.scale(v, 2)
53
53
  * ```
54
54
  */
55
- abstract scale(v: Vec3Handle, scalar: number): PluginApiReturn<Vec3Handle>
55
+ abstract scale(v: Vec3Input, scalar: number): PluginApiReturn<Vec3Handle>
56
56
  /**
57
57
  * Compute the dot product of two vectors.
58
58
  *
@@ -63,7 +63,7 @@ export abstract class PluginVec3Api {
63
63
  * const d = await snaptrude.core.math.vec3.dot(a, b) // 0.5
64
64
  * ```
65
65
  */
66
- abstract dot(a: Vec3Handle, b: Vec3Handle): PluginApiReturn<number>
66
+ abstract dot(a: Vec3Input, b: Vec3Input): PluginApiReturn<number>
67
67
  /**
68
68
  * Compute the cross product `a × b` — the vector perpendicular to both.
69
69
  *
@@ -74,7 +74,7 @@ export abstract class PluginVec3Api {
74
74
  * const perpendicular = await snaptrude.core.math.vec3.cross(a, b)
75
75
  * ```
76
76
  */
77
- abstract cross(a: Vec3Handle, b: Vec3Handle): PluginApiReturn<Vec3Handle>
77
+ abstract cross(a: Vec3Input, b: Vec3Input): PluginApiReturn<Vec3Handle>
78
78
  /**
79
79
  * Compute the Euclidean length (magnitude) of a vector.
80
80
  *
@@ -84,7 +84,7 @@ export abstract class PluginVec3Api {
84
84
  * const len = await snaptrude.core.math.vec3.length(v) // 5
85
85
  * ```
86
86
  */
87
- abstract length(v: Vec3Handle): PluginApiReturn<number>
87
+ abstract length(v: Vec3Input): PluginApiReturn<number>
88
88
  /**
89
89
  * Compute the squared Euclidean length of a vector (avoids the sqrt).
90
90
  *
@@ -94,7 +94,7 @@ export abstract class PluginVec3Api {
94
94
  * const sq = await snaptrude.core.math.vec3.lengthSquared(v) // 25
95
95
  * ```
96
96
  */
97
- abstract lengthSquared(v: Vec3Handle): PluginApiReturn<number>
97
+ abstract lengthSquared(v: Vec3Input): PluginApiReturn<number>
98
98
  /**
99
99
  * Return the unit vector in the same direction (the zero vector if length is 0).
100
100
  *
@@ -104,7 +104,7 @@ export abstract class PluginVec3Api {
104
104
  * const unit = await snaptrude.core.math.vec3.normalize(v) // (0, 0, 1)
105
105
  * ```
106
106
  */
107
- abstract normalize(v: Vec3Handle): PluginApiReturn<Vec3Handle>
107
+ abstract normalize(v: Vec3Input): PluginApiReturn<Vec3Handle>
108
108
  /**
109
109
  * Measure the straight-line (Euclidean) distance between two points.
110
110
  *
@@ -118,7 +118,7 @@ export abstract class PluginVec3Api {
118
118
  * const dist = await snaptrude.core.math.vec3.distance(a, b) // 5
119
119
  * ```
120
120
  */
121
- abstract distance(a: Vec3Handle, b: Vec3Handle): PluginApiReturn<number>
121
+ abstract distance(a: Vec3Input, b: Vec3Input): PluginApiReturn<number>
122
122
  /**
123
123
  * Linearly interpolate between two vectors: `a + (b - a) * t`.
124
124
  *
@@ -129,7 +129,7 @@ export abstract class PluginVec3Api {
129
129
  * const midpoint = await snaptrude.core.math.vec3.lerp(a, b, 0.5)
130
130
  * ```
131
131
  */
132
- abstract lerp(a: Vec3Handle, b: Vec3Handle, t: number): PluginApiReturn<Vec3Handle>
132
+ abstract lerp(a: Vec3Input, b: Vec3Input, t: number): PluginApiReturn<Vec3Handle>
133
133
  /**
134
134
  * Negate a vector, reversing its direction.
135
135
  *
@@ -139,7 +139,7 @@ export abstract class PluginVec3Api {
139
139
  * const reversed = await snaptrude.core.math.vec3.negate(v) // (-1, 2, -3)
140
140
  * ```
141
141
  */
142
- abstract negate(v: Vec3Handle): PluginApiReturn<Vec3Handle>
142
+ abstract negate(v: Vec3Input): PluginApiReturn<Vec3Handle>
143
143
  /**
144
144
  * Test whether two vectors have exactly equal components.
145
145
  *
@@ -150,7 +150,7 @@ export abstract class PluginVec3Api {
150
150
  * const same = await snaptrude.core.math.vec3.equals(a, b) // true
151
151
  * ```
152
152
  */
153
- abstract equals(a: Vec3Handle, b: Vec3Handle): PluginApiReturn<boolean>
153
+ abstract equals(a: Vec3Input, b: Vec3Input): PluginApiReturn<boolean>
154
154
  /**
155
155
  * Test whether two vectors are equal within a tolerance `epsilon` (default `1e-6`).
156
156
  *
@@ -162,8 +162,8 @@ export abstract class PluginVec3Api {
162
162
  * ```
163
163
  */
164
164
  abstract equalsApprox(
165
- a: Vec3Handle,
166
- b: Vec3Handle,
165
+ a: Vec3Input,
166
+ b: Vec3Input,
167
167
  epsilon?: number,
168
168
  ): PluginApiReturn<boolean>
169
169
  /**
@@ -175,5 +175,5 @@ export abstract class PluginVec3Api {
175
175
  * const { x, y, z } = await snaptrude.core.math.vec3.components(v)
176
176
  * ```
177
177
  */
178
- abstract components(v: Vec3Handle): PluginApiReturn<Vec3Components>
178
+ abstract components(v: Vec3Input): PluginApiReturn<Vec3Components>
179
179
  }
@@ -101,6 +101,11 @@ export abstract class PluginCoreStoreysApi {
101
101
  * The new storey is inserted at the position specified by `storyValue`. This
102
102
  * operation is undoable.
103
103
  *
104
+ * Storeys are added at the ends of the stack only. A value above the top (or below the
105
+ * bottom) also creates every storey in between at the default height — `create(5)` on a
106
+ * stack of 1–2 adds 3, 4 and 5 and returns only 5 — and a value inside a gap of the
107
+ * stack is refused (PRECONDITION_FAILED). Read the stack back with `list` afterwards.
108
+ *
104
109
  * @param storyValue - Integer storey number
105
110
  * to create (e.g. `3` to add a third floor)
106
111
  * @param height - Optional height in Babylon
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod"
2
2
  import { PluginApiReturn } from "../../../types"
3
- import { ComponentHandle, Vec3Handle } from "../../../handles"
3
+ import { ComponentHandle, Vec3Handle, Vec3Input } from "../../../handles"
4
4
  import { BooleanOutcome } from "../shared"
5
5
 
6
6
  /**
@@ -132,7 +132,7 @@ export abstract class PluginDesignBooleanApi {
132
132
  * | `offset` | {@linkcode Vec3Handle} | Translation added to the created result mass(es) (default: none) |
133
133
  */
134
134
  export const BooleanOptions = z.object({
135
- offset: Vec3Handle.optional(),
135
+ offset: Vec3Input.optional(),
136
136
  })
137
137
  export type BooleanOptions = z.infer<typeof BooleanOptions>
138
138
 
@@ -4,6 +4,7 @@ import {
4
4
  ContourHandle,
5
5
  ProfileHandle,
6
6
  Vec3Handle,
7
+ Vec3Input,
7
8
  } from "../../../handles"
8
9
  import { PluginOpeningBaseOptions } from "./opening-fields"
9
10
  import { PluginWallType } from "../types"
@@ -37,6 +38,10 @@ export type PluginWallTopProfilePoint = z.infer<
37
38
  >
38
39
 
39
40
  /**
41
+ * Current hosts refuse a non-null top profile (`PRECONDITION_FAILED`, "Walls have one
42
+ * height: sloped or stepped tops are not supported") and create nothing; the shape is
43
+ * kept for compatibility. The description below is the original contract.
44
+ *
40
45
  * The top edge of ONE wall as a polyline over its centerline: at least two
41
46
  * points, `along` strictly increasing from `0` (curve start) to `1` (curve end),
42
47
  * straight segments between them. Two points give a single slope (a raked
@@ -135,7 +140,7 @@ export type PluginCreateWallRunItems = z.infer<typeof PluginCreateWallRunItems>
135
140
  export const PluginCreateFloorItem = z.object({
136
141
  contour: ContourHandle,
137
142
  thickness: z.number(),
138
- position: Vec3Handle.optional(),
143
+ position: Vec3Input.optional(),
139
144
  })
140
145
  export type PluginCreateFloorItem = z.infer<typeof PluginCreateFloorItem>
141
146
 
@@ -156,6 +161,9 @@ export type PluginCreateFloorItems = z.infer<typeof PluginCreateFloorItems>
156
161
  * Values are evaluated before cutting. Numeric lengths use SU; unit strings
157
162
  * are accepted in values. `facing` selects local +Z; `hinge` sets the declared
158
163
  * hand enum (left = local -X, right = +X). Both are world points.
164
+ * A door between a room and a corridor, lobby or hall swings into the room:
165
+ * pass `facing` inside the room it serves, never in the corridor. Toilets,
166
+ * cupboards, shafts and exits on an escape route open outward instead.
159
167
  *
160
168
  * | Property | Type | Description |
161
169
  * |---|---|---|
@@ -164,7 +172,7 @@ export type PluginCreateFloorItems = z.infer<typeof PluginCreateFloorItems>
164
172
  * | `values` | `Record<string, number \| string>`? | Authored parameter overrides |
165
173
  * | `hostWall` | {@linkcode ComponentHandle} | The wall to host the door |
166
174
  * | `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) |
175
+ * | `facing` | {@linkcode Vec3Handle}? | World point on the side the door swings open to: inside the room it serves (default engine-chosen) |
168
176
  * | `hinge` | {@linkcode Vec3Handle}? | World point near the hinged jamb; requires hand control |
169
177
  * | `label` | `string`? | Instance name (optional) |
170
178
  * | `width` | `number`? | Declared width parameter (SU, > 0), not evaluated hole width |
@@ -245,7 +253,7 @@ export type PluginCreateWindowItems = z.infer<typeof PluginCreateWindowItems>
245
253
  */
246
254
  export const PluginCreateFurnitureItem = z.object({
247
255
  catalogId: z.string().min(1),
248
- position: Vec3Handle,
256
+ position: Vec3Input,
249
257
  label: z.string().optional(),
250
258
  angleInDegrees: z.number().optional(),
251
259
  })