@snaptrude/plugin-core 1.1.0-pbr-20261102.2 → 1.1.0
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 +19 -0
- package/dist/api/core/camera/index.d.ts +16 -6
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/comment/index.d.ts +7 -3
- package/dist/api/core/comment/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +69 -21
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/circle.d.ts +31 -11
- package/dist/api/core/geom/query/circle.d.ts.map +1 -1
- package/dist/api/core/geom/query/contour.d.ts +19 -7
- package/dist/api/core/geom/query/contour.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +72 -24
- package/dist/api/core/geom/query/curve.d.ts.map +1 -1
- package/dist/api/core/geom/query/profile.d.ts +19 -7
- package/dist/api/core/geom/query/profile.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +36 -12
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/geom/update/curve.d.ts +13 -5
- package/dist/api/core/geom/update/curve.d.ts.map +1 -1
- package/dist/api/core/geom/update/profile.d.ts +36 -12
- package/dist/api/core/geom/update/profile.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +7 -3
- 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/core/storeys/index.d.ts +5 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/design/boolean/index.d.ts +20 -4
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/create/bulk-items.d.ts +84 -16
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/index.d.ts +146 -59
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +18 -6
- package/dist/api/design/create/opening-fields.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +14 -7
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +12 -4
- package/dist/api/design/dimensions.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +25 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/edit/index.d.ts +7 -3
- package/dist/api/design/edit/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +5 -1
- package/dist/api/design/family.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +1 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/lock.d.ts +3 -0
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/opening-placement.d.ts +135 -0
- package/dist/api/design/opening-placement.d.ts.map +1 -0
- package/dist/api/design/transform/index.d.ts +28 -8
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +23 -0
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +30 -6
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +4 -0
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/presentation/drawings.d.ts +1 -1
- package/dist/api/presentation/lighting.d.ts +28 -5
- package/dist/api/presentation/lighting.d.ts.map +1 -1
- package/dist/api/presentation/views.d.ts +15 -3
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/handles.d.ts +8 -0
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +2526 -2435
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2521 -2435
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/core/camera/index.ts +9 -7
- 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 +7 -6
- package/src/api/core/geom/query/curve.ts +25 -25
- package/src/api/core/geom/query/profile.ts +7 -6
- package/src/api/core/geom/update/contour.ts +12 -11
- package/src/api/core/geom/update/curve.ts +5 -5
- package/src/api/core/geom/update/profile.ts +12 -11
- package/src/api/core/io/import/index.ts +3 -2
- package/src/api/core/math/quat.ts +2 -2
- package/src/api/core/math/vec3.ts +16 -16
- package/src/api/core/storeys/index.ts +5 -0
- package/src/api/design/boolean/index.ts +2 -2
- package/src/api/design/create/bulk-items.ts +7 -2
- package/src/api/design/create/index.ts +46 -46
- package/src/api/design/create/opening-fields.ts +7 -7
- package/src/api/design/delete/index.ts +14 -7
- package/src/api/design/dimensions.ts +5 -4
- package/src/api/design/doors/index.ts +31 -0
- package/src/api/design/edit/index.ts +3 -3
- package/src/api/design/family.ts +2 -1
- package/src/api/design/index.ts +1 -0
- package/src/api/design/lock.ts +6 -0
- package/src/api/design/opening-placement.ts +79 -0
- package/src/api/design/transform/index.ts +15 -7
- package/src/api/design/windows/index.ts +29 -0
- package/src/api/entity/space.ts +5 -4
- package/src/api/entity/story.ts +4 -0
- package/src/api/presentation/lighting.ts +29 -5
- package/src/api/presentation/views.ts +17 -4
- package/src/handles.ts +11 -0
- package/test/handles.test.mjs +36 -0
- package/api-manifest.json +0 -10774
|
@@ -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:
|
|
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:
|
|
100
|
+
axis: Vec3Input,
|
|
100
101
|
angle: number,
|
|
101
|
-
pivot?:
|
|
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?:
|
|
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:
|
|
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:
|
|
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:
|
|
254
|
+
axis: Vec3Input,
|
|
254
255
|
angle: z.number(),
|
|
255
|
-
pivot:
|
|
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:
|
|
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:
|
|
289
|
-
normal:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
95
|
+
axis: Vec3Input,
|
|
95
96
|
angle: number,
|
|
96
|
-
pivot?:
|
|
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?:
|
|
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:
|
|
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:
|
|
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:
|
|
282
|
+
axis: Vec3Input,
|
|
282
283
|
angle: z.number(),
|
|
283
|
-
pivot:
|
|
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:
|
|
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:
|
|
317
|
-
normal:
|
|
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?:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
166
|
-
b:
|
|
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:
|
|
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:
|
|
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:
|
|
143
|
+
position: Vec3Input.optional(),
|
|
139
144
|
})
|
|
140
145
|
export type PluginCreateFloorItem = z.infer<typeof PluginCreateFloorItem>
|
|
141
146
|
|
|
@@ -248,7 +253,7 @@ export type PluginCreateWindowItems = z.infer<typeof PluginCreateWindowItems>
|
|
|
248
253
|
*/
|
|
249
254
|
export const PluginCreateFurnitureItem = z.object({
|
|
250
255
|
catalogId: z.string().min(1),
|
|
251
|
-
position:
|
|
256
|
+
position: Vec3Input,
|
|
252
257
|
label: z.string().optional(),
|
|
253
258
|
angleInDegrees: z.number().optional(),
|
|
254
259
|
})
|