@snaptrude/plugin-core 1.0.2-plainpoint-20261102.2 → 1.0.3
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 +17 -0
- package/CHANGELOG.md +6 -0
- package/api-manifest.json +35 -31
- package/dist/api/core/camera/index.d.ts +6 -16
- 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/core/storeys/index.d.ts +0 -5
- package/dist/api/core/storeys/index.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 +20 -85
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/index.d.ts +71 -134
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +6 -18
- package/dist/api/design/create/opening-fields.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/doors/index.d.ts +37 -0
- package/dist/api/design/doors/index.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/family.d.ts +1 -5
- 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 +0 -3
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/opening-placement.d.ts +123 -0
- package/dist/api/design/opening-placement.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/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 +6 -30
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +0 -4
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/presentation/drawings.d.ts +1 -1
- package/dist/api/presentation/views.d.ts +1 -5
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/handles.d.ts +0 -8
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +2496 -2441
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2493 -2440
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/api/core/camera/index.ts +7 -9
- 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/core/storeys/index.ts +0 -5
- package/src/api/design/boolean/index.ts +2 -2
- package/src/api/design/create/bulk-items.ts +6 -8
- package/src/api/design/create/index.ts +58 -34
- package/src/api/design/create/opening-fields.ts +7 -7
- package/src/api/design/delete/index.ts +7 -14
- package/src/api/design/dimensions.ts +4 -5
- package/src/api/design/doors/index.ts +43 -0
- package/src/api/design/edit/index.ts +3 -3
- package/src/api/design/family.ts +1 -2
- package/src/api/design/index.ts +1 -0
- package/src/api/design/lock.ts +0 -6
- package/src/api/design/opening-placement.ts +79 -0
- package/src/api/design/transform/index.ts +7 -15
- package/src/api/design/windows/index.ts +29 -0
- package/src/api/entity/space.ts +4 -5
- package/src/api/entity/story.ts +0 -4
- package/src/api/presentation/views.ts +2 -7
- package/src/handles.ts +0 -11
- package/test/handles.test.mjs +0 -36
|
@@ -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
|
BBoxComponents,
|
|
@@ -137,7 +136,7 @@ export abstract class PluginGeomQueryProfileApi {
|
|
|
137
136
|
*/
|
|
138
137
|
public abstract getNearestPoint(
|
|
139
138
|
profile: ProfileHandle,
|
|
140
|
-
point:
|
|
139
|
+
point: Vec3Handle,
|
|
141
140
|
): PluginApiReturn<Vec3Components>
|
|
142
141
|
|
|
143
142
|
/**
|
|
@@ -158,7 +157,7 @@ export abstract class PluginGeomQueryProfileApi {
|
|
|
158
157
|
*/
|
|
159
158
|
public abstract hasPoint(
|
|
160
159
|
profile: ProfileHandle,
|
|
161
|
-
point:
|
|
160
|
+
point: Vec3Handle,
|
|
162
161
|
): PluginApiReturn<boolean>
|
|
163
162
|
|
|
164
163
|
/**
|
|
@@ -176,7 +175,7 @@ export abstract class PluginGeomQueryProfileApi {
|
|
|
176
175
|
*/
|
|
177
176
|
public abstract isOnBoundary(
|
|
178
177
|
profile: ProfileHandle,
|
|
179
|
-
point:
|
|
178
|
+
point: Vec3Handle,
|
|
180
179
|
): PluginApiReturn<boolean>
|
|
181
180
|
|
|
182
181
|
/**
|
|
@@ -358,7 +357,7 @@ export type PluginGeomQueryProfileGetNormalArgs = z.infer<typeof PluginGeomQuery
|
|
|
358
357
|
*/
|
|
359
358
|
export const PluginGeomQueryProfileGetNearestPointArgs = z.object({
|
|
360
359
|
profile: ProfileHandle,
|
|
361
|
-
point:
|
|
360
|
+
point: Vec3Handle,
|
|
362
361
|
})
|
|
363
362
|
|
|
364
363
|
export type PluginGeomQueryProfileGetNearestPointArgs = z.infer<typeof PluginGeomQueryProfileGetNearestPointArgs>
|
|
@@ -373,7 +372,7 @@ export type PluginGeomQueryProfileGetNearestPointArgs = z.infer<typeof PluginGeo
|
|
|
373
372
|
*/
|
|
374
373
|
export const PluginGeomQueryProfileHasPointArgs = z.object({
|
|
375
374
|
profile: ProfileHandle,
|
|
376
|
-
point:
|
|
375
|
+
point: Vec3Handle,
|
|
377
376
|
})
|
|
378
377
|
|
|
379
378
|
export type PluginGeomQueryProfileHasPointArgs = z.infer<typeof PluginGeomQueryProfileHasPointArgs>
|
|
@@ -388,7 +387,7 @@ export type PluginGeomQueryProfileHasPointArgs = z.infer<typeof PluginGeomQueryP
|
|
|
388
387
|
*/
|
|
389
388
|
export const PluginGeomQueryProfileIsOnBoundaryArgs = z.object({
|
|
390
389
|
profile: ProfileHandle,
|
|
391
|
-
point:
|
|
390
|
+
point: Vec3Handle,
|
|
392
391
|
})
|
|
393
392
|
|
|
394
393
|
export type PluginGeomQueryProfileIsOnBoundaryArgs = z.infer<typeof PluginGeomQueryProfileIsOnBoundaryArgs>
|
|
@@ -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
|
}
|
|
@@ -101,11 +101,6 @@ 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
|
-
*
|
|
109
104
|
* @param storyValue - Integer storey number
|
|
110
105
|
* to create (e.g. `3` to add a third floor)
|
|
111
106
|
* @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
|
|
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"
|
|
@@ -38,10 +37,6 @@ export type PluginWallTopProfilePoint = z.infer<
|
|
|
38
37
|
>
|
|
39
38
|
|
|
40
39
|
/**
|
|
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
|
-
*
|
|
45
40
|
* The top edge of ONE wall as a polyline over its centerline: at least two
|
|
46
41
|
* points, `along` strictly increasing from `0` (curve start) to `1` (curve end),
|
|
47
42
|
* straight segments between them. Two points give a single slope (a raked
|
|
@@ -140,7 +135,7 @@ export type PluginCreateWallRunItems = z.infer<typeof PluginCreateWallRunItems>
|
|
|
140
135
|
export const PluginCreateFloorItem = z.object({
|
|
141
136
|
contour: ContourHandle,
|
|
142
137
|
thickness: z.number(),
|
|
143
|
-
position:
|
|
138
|
+
position: Vec3Handle.optional(),
|
|
144
139
|
})
|
|
145
140
|
export type PluginCreateFloorItem = z.infer<typeof PluginCreateFloorItem>
|
|
146
141
|
|
|
@@ -161,6 +156,9 @@ export type PluginCreateFloorItems = z.infer<typeof PluginCreateFloorItems>
|
|
|
161
156
|
* Values are evaluated before cutting. Numeric lengths use SU; unit strings
|
|
162
157
|
* are accepted in values. `facing` selects local +Z; `hinge` sets the declared
|
|
163
158
|
* hand enum (left = local -X, right = +X). Both are world points.
|
|
159
|
+
* A door between a room and a corridor, lobby or hall swings into the room:
|
|
160
|
+
* pass `facing` inside the room it serves, never in the corridor. Toilets,
|
|
161
|
+
* cupboards, shafts and exits on an escape route open outward instead.
|
|
164
162
|
*
|
|
165
163
|
* | Property | Type | Description |
|
|
166
164
|
* |---|---|---|
|
|
@@ -169,7 +167,7 @@ export type PluginCreateFloorItems = z.infer<typeof PluginCreateFloorItems>
|
|
|
169
167
|
* | `values` | `Record<string, number \| string>`? | Authored parameter overrides |
|
|
170
168
|
* | `hostWall` | {@linkcode ComponentHandle} | The wall to host the door |
|
|
171
169
|
* | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
|
|
172
|
-
* | `facing` | {@linkcode Vec3Handle}? | World point on the side the door swings open to (default engine-chosen) |
|
|
170
|
+
* | `facing` | {@linkcode Vec3Handle}? | World point on the side the door swings open to: inside the room it serves (default engine-chosen) |
|
|
173
171
|
* | `hinge` | {@linkcode Vec3Handle}? | World point near the hinged jamb; requires hand control |
|
|
174
172
|
* | `label` | `string`? | Instance name (optional) |
|
|
175
173
|
* | `width` | `number`? | Declared width parameter (SU, > 0), not evaluated hole width |
|
|
@@ -250,7 +248,7 @@ export type PluginCreateWindowItems = z.infer<typeof PluginCreateWindowItems>
|
|
|
250
248
|
*/
|
|
251
249
|
export const PluginCreateFurnitureItem = z.object({
|
|
252
250
|
catalogId: z.string().min(1),
|
|
253
|
-
position:
|
|
251
|
+
position: Vec3Handle,
|
|
254
252
|
label: z.string().optional(),
|
|
255
253
|
angleInDegrees: z.number().optional(),
|
|
256
254
|
})
|