@snaptrude/plugin-core 1.0.2-plainpoint-20261026.2 → 1.0.2
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 +1 -0
- package/CHANGELOG.md +12 -0
- package/api-manifest.json +60 -0
- package/dist/api/core/camera/index.d.ts +4 -12
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/comment/index.d.ts +3 -7
- package/dist/api/core/comment/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +21 -69
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/circle.d.ts +11 -31
- package/dist/api/core/geom/query/circle.d.ts.map +1 -1
- package/dist/api/core/geom/query/contour.d.ts +7 -19
- package/dist/api/core/geom/query/contour.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +24 -72
- package/dist/api/core/geom/query/curve.d.ts.map +1 -1
- package/dist/api/core/geom/query/profile.d.ts +7 -19
- package/dist/api/core/geom/query/profile.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +12 -36
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/geom/update/curve.d.ts +5 -13
- package/dist/api/core/geom/update/curve.d.ts.map +1 -1
- package/dist/api/core/geom/update/profile.d.ts +12 -36
- package/dist/api/core/geom/update/profile.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +3 -7
- package/dist/api/core/io/import/index.d.ts.map +1 -1
- package/dist/api/core/math/quat.d.ts +2 -2
- package/dist/api/core/math/quat.d.ts.map +1 -1
- package/dist/api/core/math/vec3.d.ts +15 -15
- package/dist/api/core/math/vec3.d.ts.map +1 -1
- package/dist/api/design/boolean/index.d.ts +4 -20
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/create/bulk-items.d.ts +4 -20
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/index.d.ts +27 -67
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +7 -14
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +4 -12
- package/dist/api/design/dimensions.d.ts.map +1 -1
- package/dist/api/design/edit/index.d.ts +3 -7
- package/dist/api/design/edit/index.d.ts.map +1 -1
- package/dist/api/design/erase/index.d.ts +2 -10
- package/dist/api/design/erase/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +1 -5
- package/dist/api/design/family.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +5 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/lock.d.ts +0 -3
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/text.d.ts +400 -0
- package/dist/api/design/text.d.ts.map +1 -0
- package/dist/api/design/transform/index.d.ts +8 -28
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +6 -30
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/presentation/drawings.d.ts +46 -1
- package/dist/api/presentation/drawings.d.ts.map +1 -1
- package/dist/api/presentation/graphics.d.ts +4 -0
- package/dist/api/presentation/graphics.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +29 -1
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/standards.d.ts +14 -0
- package/dist/api/presentation/standards.d.ts.map +1 -1
- package/dist/handles.d.ts +0 -8
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +2281 -2188
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2269 -2187
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/api/core/camera/index.ts +5 -5
- package/src/api/core/comment/index.ts +3 -3
- package/src/api/core/geom/create/index.ts +25 -25
- package/src/api/core/geom/query/circle.ts +11 -11
- package/src/api/core/geom/query/contour.ts +6 -7
- package/src/api/core/geom/query/curve.ts +25 -25
- package/src/api/core/geom/query/profile.ts +6 -7
- package/src/api/core/geom/update/contour.ts +11 -12
- package/src/api/core/geom/update/curve.ts +5 -5
- package/src/api/core/geom/update/profile.ts +11 -12
- package/src/api/core/io/import/index.ts +2 -3
- package/src/api/core/math/quat.ts +2 -2
- package/src/api/core/math/vec3.ts +16 -16
- package/src/api/design/boolean/index.ts +2 -2
- package/src/api/design/create/bulk-items.ts +2 -3
- package/src/api/design/create/index.ts +26 -27
- package/src/api/design/delete/index.ts +7 -14
- package/src/api/design/dimensions.ts +4 -5
- package/src/api/design/edit/index.ts +3 -3
- package/src/api/design/erase/index.ts +2 -2
- package/src/api/design/family.ts +1 -2
- package/src/api/design/index.ts +5 -0
- package/src/api/design/lock.ts +0 -6
- package/src/api/design/text.ts +394 -0
- package/src/api/design/transform/index.ts +7 -15
- package/src/api/entity/space.ts +4 -5
- package/src/api/presentation/graphics.ts +4 -1
- package/src/api/presentation/placedViews.ts +12 -0
- package/src/api/presentation/standards.ts +6 -0
- package/src/handles.ts +0 -11
- package/test/designText.test.mjs +72 -0
- package/test/paperPensContract.test.mjs +39 -0
- package/test/handles.test.mjs +0 -36
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
ContourHandle,
|
|
5
5
|
ProfileHandle,
|
|
6
6
|
Vec3Handle,
|
|
7
|
-
Vec3Input,
|
|
8
7
|
Vec3Components,
|
|
9
8
|
} from "../../../../handles"
|
|
10
9
|
|
|
@@ -70,7 +69,7 @@ export abstract class PluginGeomUpdateContourApi {
|
|
|
70
69
|
*/
|
|
71
70
|
public abstract move(
|
|
72
71
|
contour: ContourHandle,
|
|
73
|
-
translation:
|
|
72
|
+
translation: Vec3Handle,
|
|
74
73
|
): PluginApiReturn<ContourHandle>
|
|
75
74
|
|
|
76
75
|
/**
|
|
@@ -97,9 +96,9 @@ export abstract class PluginGeomUpdateContourApi {
|
|
|
97
96
|
*/
|
|
98
97
|
public abstract rotate(
|
|
99
98
|
contour: ContourHandle,
|
|
100
|
-
axis:
|
|
99
|
+
axis: Vec3Handle,
|
|
101
100
|
angle: number,
|
|
102
|
-
pivot?:
|
|
101
|
+
pivot?: Vec3Handle,
|
|
103
102
|
): PluginApiReturn<ContourHandle>
|
|
104
103
|
|
|
105
104
|
/**
|
|
@@ -125,7 +124,7 @@ export abstract class PluginGeomUpdateContourApi {
|
|
|
125
124
|
public abstract scale(
|
|
126
125
|
contour: ContourHandle,
|
|
127
126
|
factor: number | Vec3Components,
|
|
128
|
-
pivot?:
|
|
127
|
+
pivot?: Vec3Handle,
|
|
129
128
|
): PluginApiReturn<ContourHandle>
|
|
130
129
|
|
|
131
130
|
/**
|
|
@@ -150,7 +149,7 @@ export abstract class PluginGeomUpdateContourApi {
|
|
|
150
149
|
*/
|
|
151
150
|
public abstract mirror(
|
|
152
151
|
contour: ContourHandle,
|
|
153
|
-
plane: { point:
|
|
152
|
+
plane: { point: Vec3Handle; normal: Vec3Handle },
|
|
154
153
|
): PluginApiReturn<ContourHandle>
|
|
155
154
|
|
|
156
155
|
/**
|
|
@@ -234,7 +233,7 @@ export type PluginGeomUpdateContourOffsetArgs = z.infer<typeof PluginGeomUpdateC
|
|
|
234
233
|
*/
|
|
235
234
|
export const PluginGeomUpdateContourMoveArgs = z.object({
|
|
236
235
|
contour: ContourHandle,
|
|
237
|
-
translation:
|
|
236
|
+
translation: Vec3Handle,
|
|
238
237
|
})
|
|
239
238
|
|
|
240
239
|
export type PluginGeomUpdateContourMoveArgs = z.infer<typeof PluginGeomUpdateContourMoveArgs>
|
|
@@ -251,9 +250,9 @@ export type PluginGeomUpdateContourMoveArgs = z.infer<typeof PluginGeomUpdateCon
|
|
|
251
250
|
*/
|
|
252
251
|
export const PluginGeomUpdateContourRotateArgs = z.object({
|
|
253
252
|
contour: ContourHandle,
|
|
254
|
-
axis:
|
|
253
|
+
axis: Vec3Handle,
|
|
255
254
|
angle: z.number(),
|
|
256
|
-
pivot:
|
|
255
|
+
pivot: Vec3Handle.optional(),
|
|
257
256
|
})
|
|
258
257
|
|
|
259
258
|
export type PluginGeomUpdateContourRotateArgs = z.infer<typeof PluginGeomUpdateContourRotateArgs>
|
|
@@ -270,7 +269,7 @@ export type PluginGeomUpdateContourRotateArgs = z.infer<typeof PluginGeomUpdateC
|
|
|
270
269
|
export const PluginGeomUpdateContourScaleArgs = z.object({
|
|
271
270
|
contour: ContourHandle,
|
|
272
271
|
factor: z.union([z.number(), Vec3Components]),
|
|
273
|
-
pivot:
|
|
272
|
+
pivot: Vec3Handle.optional(),
|
|
274
273
|
})
|
|
275
274
|
|
|
276
275
|
export type PluginGeomUpdateContourScaleArgs = z.infer<typeof PluginGeomUpdateContourScaleArgs>
|
|
@@ -286,8 +285,8 @@ export type PluginGeomUpdateContourScaleArgs = z.infer<typeof PluginGeomUpdateCo
|
|
|
286
285
|
export const PluginGeomUpdateContourMirrorArgs = z.object({
|
|
287
286
|
contour: ContourHandle,
|
|
288
287
|
plane: z.object({
|
|
289
|
-
point:
|
|
290
|
-
normal:
|
|
288
|
+
point: Vec3Handle,
|
|
289
|
+
normal: Vec3Handle,
|
|
291
290
|
}),
|
|
292
291
|
})
|
|
293
292
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../../../types"
|
|
3
|
-
import { Vec3Handle,
|
|
3
|
+
import { Vec3Handle, 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:
|
|
64
|
+
point: Vec3Handle,
|
|
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:
|
|
113
|
+
vector: Vec3Handle,
|
|
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:
|
|
161
|
+
point: Vec3Handle,
|
|
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:
|
|
193
|
+
vector: Vec3Handle,
|
|
194
194
|
})
|
|
195
195
|
|
|
196
196
|
export type PluginGeomUpdateCurveOffsetArgs = z.infer<typeof PluginGeomUpdateCurveOffsetArgs>
|
|
@@ -3,7 +3,6 @@ import { PluginApiReturn } from "../../../../types"
|
|
|
3
3
|
import {
|
|
4
4
|
ProfileHandle,
|
|
5
5
|
Vec3Handle,
|
|
6
|
-
Vec3Input,
|
|
7
6
|
CurveHandle,
|
|
8
7
|
Vec3Components,
|
|
9
8
|
} from "../../../../handles"
|
|
@@ -67,7 +66,7 @@ export abstract class PluginGeomUpdateProfileApi {
|
|
|
67
66
|
*/
|
|
68
67
|
public abstract move(
|
|
69
68
|
profile: ProfileHandle,
|
|
70
|
-
translation:
|
|
69
|
+
translation: Vec3Handle,
|
|
71
70
|
): PluginApiReturn<ProfileHandle>
|
|
72
71
|
|
|
73
72
|
/**
|
|
@@ -92,9 +91,9 @@ export abstract class PluginGeomUpdateProfileApi {
|
|
|
92
91
|
*/
|
|
93
92
|
public abstract rotate(
|
|
94
93
|
profile: ProfileHandle,
|
|
95
|
-
axis:
|
|
94
|
+
axis: Vec3Handle,
|
|
96
95
|
angle: number,
|
|
97
|
-
pivot?:
|
|
96
|
+
pivot?: Vec3Handle,
|
|
98
97
|
): PluginApiReturn<ProfileHandle>
|
|
99
98
|
|
|
100
99
|
/**
|
|
@@ -119,7 +118,7 @@ export abstract class PluginGeomUpdateProfileApi {
|
|
|
119
118
|
public abstract scale(
|
|
120
119
|
profile: ProfileHandle,
|
|
121
120
|
factor: number | Vec3Components,
|
|
122
|
-
pivot?:
|
|
121
|
+
pivot?: Vec3Handle,
|
|
123
122
|
): PluginApiReturn<ProfileHandle>
|
|
124
123
|
|
|
125
124
|
/**
|
|
@@ -143,7 +142,7 @@ export abstract class PluginGeomUpdateProfileApi {
|
|
|
143
142
|
*/
|
|
144
143
|
public abstract mirror(
|
|
145
144
|
profile: ProfileHandle,
|
|
146
|
-
plane: { point:
|
|
145
|
+
plane: { point: Vec3Handle; normal: Vec3Handle },
|
|
147
146
|
): PluginApiReturn<ProfileHandle>
|
|
148
147
|
|
|
149
148
|
/**
|
|
@@ -262,7 +261,7 @@ export type PluginGeomUpdateProfileOffsetArgs = z.infer<typeof PluginGeomUpdateP
|
|
|
262
261
|
*/
|
|
263
262
|
export const PluginGeomUpdateProfileMoveArgs = z.object({
|
|
264
263
|
profile: ProfileHandle,
|
|
265
|
-
translation:
|
|
264
|
+
translation: Vec3Handle,
|
|
266
265
|
})
|
|
267
266
|
|
|
268
267
|
export type PluginGeomUpdateProfileMoveArgs = z.infer<typeof PluginGeomUpdateProfileMoveArgs>
|
|
@@ -279,9 +278,9 @@ export type PluginGeomUpdateProfileMoveArgs = z.infer<typeof PluginGeomUpdatePro
|
|
|
279
278
|
*/
|
|
280
279
|
export const PluginGeomUpdateProfileRotateArgs = z.object({
|
|
281
280
|
profile: ProfileHandle,
|
|
282
|
-
axis:
|
|
281
|
+
axis: Vec3Handle,
|
|
283
282
|
angle: z.number(),
|
|
284
|
-
pivot:
|
|
283
|
+
pivot: Vec3Handle.optional(),
|
|
285
284
|
})
|
|
286
285
|
|
|
287
286
|
export type PluginGeomUpdateProfileRotateArgs = z.infer<typeof PluginGeomUpdateProfileRotateArgs>
|
|
@@ -298,7 +297,7 @@ export type PluginGeomUpdateProfileRotateArgs = z.infer<typeof PluginGeomUpdateP
|
|
|
298
297
|
export const PluginGeomUpdateProfileScaleArgs = z.object({
|
|
299
298
|
profile: ProfileHandle,
|
|
300
299
|
factor: z.union([z.number(), Vec3Components]),
|
|
301
|
-
pivot:
|
|
300
|
+
pivot: Vec3Handle.optional(),
|
|
302
301
|
})
|
|
303
302
|
|
|
304
303
|
export type PluginGeomUpdateProfileScaleArgs = z.infer<typeof PluginGeomUpdateProfileScaleArgs>
|
|
@@ -314,8 +313,8 @@ export type PluginGeomUpdateProfileScaleArgs = z.infer<typeof PluginGeomUpdatePr
|
|
|
314
313
|
export const PluginGeomUpdateProfileMirrorArgs = z.object({
|
|
315
314
|
profile: ProfileHandle,
|
|
316
315
|
plane: z.object({
|
|
317
|
-
point:
|
|
318
|
-
normal:
|
|
316
|
+
point: Vec3Handle,
|
|
317
|
+
normal: Vec3Handle,
|
|
319
318
|
}),
|
|
320
319
|
})
|
|
321
320
|
|
|
@@ -2,7 +2,6 @@ import * as z from "zod"
|
|
|
2
2
|
import { PluginApiReturn } from "../../../../types"
|
|
3
3
|
import {
|
|
4
4
|
Vec3Handle,
|
|
5
|
-
Vec3Input,
|
|
6
5
|
UnderlayHandle,
|
|
7
6
|
TerrainHandle,
|
|
8
7
|
ImportJobHandle,
|
|
@@ -267,7 +266,7 @@ export abstract class PluginCoreIoImportApi {
|
|
|
267
266
|
source: string,
|
|
268
267
|
storey?: number,
|
|
269
268
|
format?: ModelFormat,
|
|
270
|
-
position?:
|
|
269
|
+
position?: Vec3Handle,
|
|
271
270
|
label?: string,
|
|
272
271
|
): PluginApiReturn<ComponentHandle>
|
|
273
272
|
|
|
@@ -446,7 +445,7 @@ export const PluginImportModelArgs = z.object({
|
|
|
446
445
|
source: ImportSource,
|
|
447
446
|
storey: z.number().int().optional(),
|
|
448
447
|
format: ModelFormat.optional(),
|
|
449
|
-
position:
|
|
448
|
+
position: Vec3Handle.optional(),
|
|
450
449
|
label: z.string().optional(),
|
|
451
450
|
})
|
|
452
451
|
export type PluginImportModelArgs = z.infer<typeof PluginImportModelArgs>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginApiReturn } from "../../../types"
|
|
2
|
-
import { Vec3Handle,
|
|
2
|
+
import { Vec3Handle, 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:
|
|
42
|
+
abstract fromAxisAngle(axis: Vec3Handle, 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,
|
|
2
|
+
import { Vec3Handle, 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:
|
|
34
|
+
abstract add(a: Vec3Handle, b: Vec3Handle): 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:
|
|
45
|
+
abstract subtract(a: Vec3Handle, b: Vec3Handle): 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:
|
|
55
|
+
abstract scale(v: Vec3Handle, 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:
|
|
66
|
+
abstract dot(a: Vec3Handle, b: Vec3Handle): 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:
|
|
77
|
+
abstract cross(a: Vec3Handle, b: Vec3Handle): 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:
|
|
87
|
+
abstract length(v: Vec3Handle): 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:
|
|
97
|
+
abstract lengthSquared(v: Vec3Handle): 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:
|
|
107
|
+
abstract normalize(v: Vec3Handle): 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:
|
|
121
|
+
abstract distance(a: Vec3Handle, b: Vec3Handle): 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:
|
|
132
|
+
abstract lerp(a: Vec3Handle, b: Vec3Handle, 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:
|
|
142
|
+
abstract negate(v: Vec3Handle): 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:
|
|
153
|
+
abstract equals(a: Vec3Handle, b: Vec3Handle): 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:
|
|
166
|
-
b:
|
|
165
|
+
a: Vec3Handle,
|
|
166
|
+
b: Vec3Handle,
|
|
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:
|
|
178
|
+
abstract components(v: Vec3Handle): PluginApiReturn<Vec3Components>
|
|
179
179
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../../types"
|
|
3
|
-
import { ComponentHandle, Vec3Handle
|
|
3
|
+
import { ComponentHandle, Vec3Handle } 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:
|
|
135
|
+
offset: Vec3Handle.optional(),
|
|
136
136
|
})
|
|
137
137
|
export type BooleanOptions = z.infer<typeof BooleanOptions>
|
|
138
138
|
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
ContourHandle,
|
|
5
5
|
ProfileHandle,
|
|
6
6
|
Vec3Handle,
|
|
7
|
-
Vec3Input,
|
|
8
7
|
} from "../../../handles"
|
|
9
8
|
import { PluginOpeningBaseOptions } from "./opening-fields"
|
|
10
9
|
import { PluginWallType } from "../types"
|
|
@@ -136,7 +135,7 @@ export type PluginCreateWallRunItems = z.infer<typeof PluginCreateWallRunItems>
|
|
|
136
135
|
export const PluginCreateFloorItem = z.object({
|
|
137
136
|
contour: ContourHandle,
|
|
138
137
|
thickness: z.number(),
|
|
139
|
-
position:
|
|
138
|
+
position: Vec3Handle.optional(),
|
|
140
139
|
})
|
|
141
140
|
export type PluginCreateFloorItem = z.infer<typeof PluginCreateFloorItem>
|
|
142
141
|
|
|
@@ -246,7 +245,7 @@ export type PluginCreateWindowItems = z.infer<typeof PluginCreateWindowItems>
|
|
|
246
245
|
*/
|
|
247
246
|
export const PluginCreateFurnitureItem = z.object({
|
|
248
247
|
catalogId: z.string().min(1),
|
|
249
|
-
position:
|
|
248
|
+
position: Vec3Handle,
|
|
250
249
|
label: z.string().optional(),
|
|
251
250
|
angleInDegrees: z.number().optional(),
|
|
252
251
|
})
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
CurveHandle,
|
|
9
9
|
ProfileHandle,
|
|
10
10
|
Vec3Handle,
|
|
11
|
-
Vec3Input,
|
|
12
11
|
} from "../../../handles"
|
|
13
12
|
import { PluginGridStyleOptions } from "./grids"
|
|
14
13
|
import { PluginGraphicsLineStyleId } from "../../presentation/graphics"
|
|
@@ -131,7 +130,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
131
130
|
contour: ContourHandle,
|
|
132
131
|
height: number,
|
|
133
132
|
label?: string,
|
|
134
|
-
position?:
|
|
133
|
+
position?: Vec3Handle,
|
|
135
134
|
spaceType?: PluginSpaceType,
|
|
136
135
|
massType?: PluginMassType,
|
|
137
136
|
departmentId?: PluginDepartmentId,
|
|
@@ -166,7 +165,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
166
165
|
contour: ContourHandle,
|
|
167
166
|
height: number,
|
|
168
167
|
label?: string,
|
|
169
|
-
position?:
|
|
168
|
+
position?: Vec3Handle,
|
|
170
169
|
massType?: PluginMassType,
|
|
171
170
|
): PluginApiReturn<ComponentHandle>
|
|
172
171
|
|
|
@@ -289,7 +288,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
289
288
|
*/
|
|
290
289
|
public abstract floor(
|
|
291
290
|
...args:
|
|
292
|
-
| [contour: ContourHandle, thickness: number, position?:
|
|
291
|
+
| [contour: ContourHandle, thickness: number, position?: Vec3Handle]
|
|
293
292
|
| [contour: ContourHandle, options: PluginFamilyFloorOptions]
|
|
294
293
|
): PluginApiReturn<ComponentHandle[]>
|
|
295
294
|
|
|
@@ -423,10 +422,10 @@ export abstract class PluginDesignCreateApi {
|
|
|
423
422
|
public abstract column(
|
|
424
423
|
...args:
|
|
425
424
|
| [
|
|
426
|
-
position:
|
|
425
|
+
position: Vec3Handle,
|
|
427
426
|
crossSection: ContourHandle,
|
|
428
427
|
height: number,
|
|
429
|
-
directionUp?:
|
|
428
|
+
directionUp?: Vec3Handle,
|
|
430
429
|
]
|
|
431
430
|
| [axis: LineHandle, options: PluginFamilyPlacement]
|
|
432
431
|
): PluginApiReturn<ComponentHandle>
|
|
@@ -473,7 +472,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
473
472
|
*/
|
|
474
473
|
public abstract beam(
|
|
475
474
|
...args:
|
|
476
|
-
| [section: ContourHandle, length: number, direction?:
|
|
475
|
+
| [section: ContourHandle, length: number, direction?: Vec3Handle]
|
|
477
476
|
| [axis: LineHandle, options: PluginFamilyPlacement]
|
|
478
477
|
): PluginApiReturn<ComponentHandle>
|
|
479
478
|
|
|
@@ -650,7 +649,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
650
649
|
*/
|
|
651
650
|
public abstract staircase(
|
|
652
651
|
preset: PluginStaircasePreset,
|
|
653
|
-
position:
|
|
652
|
+
position: Vec3Handle,
|
|
654
653
|
label?: string,
|
|
655
654
|
structureId?: string,
|
|
656
655
|
level?: string,
|
|
@@ -741,7 +740,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
741
740
|
spacingY: number,
|
|
742
741
|
options?: {
|
|
743
742
|
angle?: number
|
|
744
|
-
center?:
|
|
743
|
+
center?: Vec3Handle
|
|
745
744
|
} & PluginGridStyleOptions,
|
|
746
745
|
): PluginApiReturn<ComponentHandle>
|
|
747
746
|
|
|
@@ -896,7 +895,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
896
895
|
*/
|
|
897
896
|
public abstract furniture(
|
|
898
897
|
catalogId: string,
|
|
899
|
-
position:
|
|
898
|
+
position: Vec3Handle,
|
|
900
899
|
options?: { label?: string; createNewSourceMesh?: boolean },
|
|
901
900
|
angleInDegrees?: number,
|
|
902
901
|
): PluginApiReturn<ComponentHandle>
|
|
@@ -1009,14 +1008,14 @@ export abstract class PluginDesignCreateApi {
|
|
|
1009
1008
|
public abstract door(
|
|
1010
1009
|
familyId: string,
|
|
1011
1010
|
hostWall: ComponentHandle,
|
|
1012
|
-
position:
|
|
1011
|
+
position: Vec3Handle,
|
|
1013
1012
|
options?: {
|
|
1014
1013
|
label?: string
|
|
1015
|
-
hinge?:
|
|
1014
|
+
hinge?: Vec3Handle
|
|
1016
1015
|
version?: number
|
|
1017
1016
|
values?: Record<string, number | string>
|
|
1018
1017
|
},
|
|
1019
|
-
facing?:
|
|
1018
|
+
facing?: Vec3Handle,
|
|
1020
1019
|
): PluginApiReturn<ComponentHandle>
|
|
1021
1020
|
|
|
1022
1021
|
/**
|
|
@@ -1113,14 +1112,14 @@ export abstract class PluginDesignCreateApi {
|
|
|
1113
1112
|
public abstract window(
|
|
1114
1113
|
familyId: string,
|
|
1115
1114
|
hostWall: ComponentHandle,
|
|
1116
|
-
position:
|
|
1115
|
+
position: Vec3Handle,
|
|
1117
1116
|
options?: {
|
|
1118
1117
|
label?: string
|
|
1119
|
-
hinge?:
|
|
1118
|
+
hinge?: Vec3Handle
|
|
1120
1119
|
version?: number
|
|
1121
1120
|
values?: Record<string, number | string>
|
|
1122
1121
|
},
|
|
1123
|
-
facing?:
|
|
1122
|
+
facing?: Vec3Handle,
|
|
1124
1123
|
): PluginApiReturn<ComponentHandle>
|
|
1125
1124
|
|
|
1126
1125
|
/**
|
|
@@ -1447,7 +1446,7 @@ export abstract class PluginDesignCreateApi {
|
|
|
1447
1446
|
*/
|
|
1448
1447
|
public abstract copy(
|
|
1449
1448
|
components: ComponentHandle[],
|
|
1450
|
-
displacement:
|
|
1449
|
+
displacement: Vec3Handle,
|
|
1451
1450
|
options?: { count?: number; mode?: PluginCopyMode },
|
|
1452
1451
|
): PluginApiReturn<ComponentHandle[]>
|
|
1453
1452
|
|
|
@@ -1670,7 +1669,7 @@ export const PluginDesignCreateSpaceArgs = z.object({
|
|
|
1670
1669
|
contour: ContourHandle,
|
|
1671
1670
|
height: z.number(),
|
|
1672
1671
|
label: z.string().optional(),
|
|
1673
|
-
position:
|
|
1672
|
+
position: Vec3Handle.optional(),
|
|
1674
1673
|
spaceType: PluginSpaceType.optional(),
|
|
1675
1674
|
massType: PluginMassType.optional(),
|
|
1676
1675
|
departmentId: PluginDepartmentId.optional(),
|
|
@@ -1701,7 +1700,7 @@ export const PluginDesignCreateMassArgs = z.object({
|
|
|
1701
1700
|
contour: ContourHandle,
|
|
1702
1701
|
height: z.number(),
|
|
1703
1702
|
label: z.string().optional(),
|
|
1704
|
-
position:
|
|
1703
|
+
position: Vec3Handle.optional(),
|
|
1705
1704
|
massType: PluginMassType.optional(),
|
|
1706
1705
|
})
|
|
1707
1706
|
export type PluginDesignCreateMassArgs = z.infer<
|
|
@@ -1768,7 +1767,7 @@ export type PluginDesignCreateSlabArgs = z.infer<
|
|
|
1768
1767
|
export const PluginDesignCreateFloorArgs = z.object({
|
|
1769
1768
|
contour: ContourHandle,
|
|
1770
1769
|
thickness: z.number(),
|
|
1771
|
-
position:
|
|
1770
|
+
position: Vec3Handle.optional(),
|
|
1772
1771
|
})
|
|
1773
1772
|
export type PluginDesignCreateFloorArgs = z.infer<
|
|
1774
1773
|
typeof PluginDesignCreateFloorArgs
|
|
@@ -1831,10 +1830,10 @@ export type PluginDesignCreateCeilingArgs = z.infer<
|
|
|
1831
1830
|
* | `directionUp` | {@linkcode Vec3Handle}? | Up axis (default world up) |
|
|
1832
1831
|
*/
|
|
1833
1832
|
export const PluginDesignCreateColumnArgs = z.object({
|
|
1834
|
-
position:
|
|
1833
|
+
position: Vec3Handle,
|
|
1835
1834
|
crossSection: ContourHandle,
|
|
1836
1835
|
height: z.number(),
|
|
1837
|
-
directionUp:
|
|
1836
|
+
directionUp: Vec3Handle.optional(),
|
|
1838
1837
|
})
|
|
1839
1838
|
export type PluginDesignCreateColumnArgs = z.infer<
|
|
1840
1839
|
typeof PluginDesignCreateColumnArgs
|
|
@@ -1856,7 +1855,7 @@ export type PluginDesignCreateColumnArgs = z.infer<
|
|
|
1856
1855
|
export const PluginDesignCreateBeamArgs = z.object({
|
|
1857
1856
|
section: ContourHandle,
|
|
1858
1857
|
length: z.number(),
|
|
1859
|
-
direction:
|
|
1858
|
+
direction: Vec3Handle.optional(),
|
|
1860
1859
|
})
|
|
1861
1860
|
export type PluginDesignCreateBeamArgs = z.infer<
|
|
1862
1861
|
typeof PluginDesignCreateBeamArgs
|
|
@@ -1911,7 +1910,7 @@ export type PluginDesignCreateWallsArgs = z.infer<
|
|
|
1911
1910
|
*/
|
|
1912
1911
|
export const PluginDesignCreateStaircaseArgs = z.object({
|
|
1913
1912
|
preset: PluginStaircasePreset,
|
|
1914
|
-
position:
|
|
1913
|
+
position: Vec3Handle,
|
|
1915
1914
|
label: z.string().optional(),
|
|
1916
1915
|
structureId: z.string().optional(),
|
|
1917
1916
|
level: z.string().optional(),
|
|
@@ -1938,7 +1937,7 @@ export type PluginDesignCreateStaircaseArgs = z.infer<
|
|
|
1938
1937
|
*/
|
|
1939
1938
|
export const PluginDesignCreateFurnitureArgs = z.object({
|
|
1940
1939
|
catalogId: z.string().min(1),
|
|
1941
|
-
position:
|
|
1940
|
+
position: Vec3Handle,
|
|
1942
1941
|
label: z.string().optional(),
|
|
1943
1942
|
createNewSourceMesh: z.boolean().optional(),
|
|
1944
1943
|
angleInDegrees: z.number().optional(),
|
|
@@ -2196,7 +2195,7 @@ export type PluginCopyMode = z.infer<typeof PluginCopyMode>
|
|
|
2196
2195
|
*/
|
|
2197
2196
|
export const PluginDesignCreateCopyArgs = z.object({
|
|
2198
2197
|
components: z.array(ComponentHandle).min(1),
|
|
2199
|
-
displacement:
|
|
2198
|
+
displacement: Vec3Handle,
|
|
2200
2199
|
count: z.number().int().positive().optional(),
|
|
2201
2200
|
mode: PluginCopyMode.optional(),
|
|
2202
2201
|
})
|
|
@@ -2229,7 +2228,7 @@ export const PluginCreateSpaceItem = z.object({
|
|
|
2229
2228
|
contour: ContourHandle,
|
|
2230
2229
|
height: z.number(),
|
|
2231
2230
|
label: z.string().optional(),
|
|
2232
|
-
position:
|
|
2231
|
+
position: Vec3Handle.optional(),
|
|
2233
2232
|
spaceType: PluginSpaceType.optional(),
|
|
2234
2233
|
massType: PluginMassType.optional(),
|
|
2235
2234
|
departmentId: PluginDepartmentId.optional(),
|
|
@@ -8,7 +8,7 @@ import { PluginDesignChangeResult } from "../lock"
|
|
|
8
8
|
*
|
|
9
9
|
* | Property | Type | Description |
|
|
10
10
|
* |---|---|---|
|
|
11
|
-
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to delete.
|
|
11
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to delete. Unknown/forged handles reject the whole call (fail-fast). |
|
|
12
12
|
*
|
|
13
13
|
* `.min(1)` is deliberately stricter than the shipped `PluginDesignLockArgs`
|
|
14
14
|
* (which allows an empty array) — an empty delete is a caller error, not a no-op.
|
|
@@ -43,19 +43,12 @@ export abstract class PluginDesignDeleteApi {
|
|
|
43
43
|
* entry, exactly as the editor's Delete key does — see `design.dimensions`. They are
|
|
44
44
|
* NOT listed in `affected`, which reports component handles only.
|
|
45
45
|
*
|
|
46
|
-
* @param components - Entities to delete.
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* resolved and were skipped; `rejected`, handles the engine accepted but left standing
|
|
53
|
-
* (delete them again, one at a time, or report them). Deleted handles are **stale**
|
|
54
|
-
* afterwards: re-resolving one throws `HANDLE_STALE`.
|
|
55
|
-
* @throws `HANDLE_INVALID` when NONE of the supplied handles resolve (nothing is deleted);
|
|
56
|
-
* hosts before Oct 2026 reject the whole call when any handle is gone. `OPERATION_FAILED`
|
|
57
|
-
* when the parametric engine rejects the deletion — the batch is rolled back.
|
|
58
|
-
* `HANDLE_STALE` for a handle the caller held that has since been retired.
|
|
46
|
+
* @param components - Entities to delete. Unknown/forged handles reject the whole call (fail-fast).
|
|
47
|
+
* @returns The entities that were deleted, as {@linkcode ComponentHandle}`[]`
|
|
48
|
+
* (echoed host-side from the resolved+deleted set — the engine returns no ids).
|
|
49
|
+
* Deleted handles are **stale** afterwards: re-resolving one throws `HANDLE_INVALID`.
|
|
50
|
+
* @throws If any supplied handle is unknown/forged (`HANDLE_INVALID`) — the whole
|
|
51
|
+
* call rejects before anything is deleted (all-or-nothing resolution).
|
|
59
52
|
*
|
|
60
53
|
* @examplePrompt Delete the selected objects
|
|
61
54
|
* @examplePrompt Remove these walls from the model
|