@snaptrude/plugin-core 1.0.3 → 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.
- package/CHANGELOG.md +6 -0
- package/api-manifest.json +146 -2135
- 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 +134 -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/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/lock.d.ts +3 -0
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/opening-placement.d.ts +15 -3
- package/dist/api/design/opening-placement.d.ts.map +1 -1
- package/dist/api/design/transform/index.d.ts +28 -8
- package/dist/api/design/transform/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/views.d.ts +5 -1
- 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 +96 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +95 -82
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- 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 +34 -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/edit/index.ts +3 -3
- package/src/api/design/family.ts +2 -1
- package/src/api/design/lock.ts +6 -0
- package/src/api/design/transform/index.ts +15 -7
- package/src/api/entity/space.ts +5 -4
- package/src/api/entity/story.ts +4 -0
- package/src/api/presentation/views.ts +7 -2
- package/src/handles.ts +11 -0
- package/test/handles.test.mjs +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snaptrude/plugin-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -16,17 +16,6 @@
|
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"ts-morph": "^28.0.0",
|
|
21
|
-
"tsup": "^8.5.1",
|
|
22
|
-
"typescript": "^5.5.4"
|
|
23
|
-
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"zod": "^4.3.6"
|
|
26
|
-
},
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"zod": "^3.25.0 || ^4.0.0"
|
|
29
|
-
},
|
|
30
19
|
"scripts": {
|
|
31
20
|
"check-types": "tsc --noEmit",
|
|
32
21
|
"build": "tsup --clean",
|
|
@@ -38,5 +27,16 @@
|
|
|
38
27
|
"generate:manifest:check": "node scripts/generate-manifest.mjs --check",
|
|
39
28
|
"generate:manifest:all": "node scripts/generate-manifest.mjs --all",
|
|
40
29
|
"generate:manifest:all:check": "node scripts/generate-manifest.mjs --all --check"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"ts-morph": "^28.0.0",
|
|
33
|
+
"tsup": "^8.5.1",
|
|
34
|
+
"typescript": "^5.5.4"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"zod": "^4.3.6"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"zod": "^3.25.0 || ^4.0.0"
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../../types"
|
|
3
|
-
import { Vec3Components, Vec3Handle } from "../../../handles"
|
|
3
|
+
import { Vec3Components, Vec3Handle, Vec3Input } from "../../../handles"
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Camera controls.
|
|
@@ -30,12 +30,14 @@ export abstract class PluginCameraApi {
|
|
|
30
30
|
* Point the camera: place its eye at `eye` looking toward `target` (world
|
|
31
31
|
* coordinates, internal `babylon` units). View-state only — not undoable.
|
|
32
32
|
*
|
|
33
|
+
* From a 2D plan the camera first switches to 3D (a plan's camera is pinned
|
|
34
|
+
* top-down, so an eye there would be ignored); read `getPose().mode` after.
|
|
33
35
|
* While Present is open this sets the Design frame a view saved in Present
|
|
34
36
|
* is taken from; it never moves the Present sheet canvas; use
|
|
35
37
|
* `presentation.camera` for that.
|
|
36
38
|
*
|
|
37
|
-
* @param eye - Camera position
|
|
38
|
-
* @param target - Point the camera looks at
|
|
39
|
+
* @param eye - Camera position: a {@linkcode Vec3Handle} or a plain `{ x, y, z }`
|
|
40
|
+
* @param target - Point the camera looks at: a {@linkcode Vec3Handle} or a plain `{ x, y, z }`
|
|
39
41
|
* @returns `true` once the camera has been positioned.
|
|
40
42
|
*
|
|
41
43
|
* @examplePrompt Look at the model from above the north-east corner
|
|
@@ -50,8 +52,8 @@ export abstract class PluginCameraApi {
|
|
|
50
52
|
* ```
|
|
51
53
|
*/
|
|
52
54
|
public abstract lookFrom(
|
|
53
|
-
eye:
|
|
54
|
-
target:
|
|
55
|
+
eye: Vec3Input,
|
|
56
|
+
target: Vec3Input,
|
|
55
57
|
): PluginApiReturn<boolean>
|
|
56
58
|
|
|
57
59
|
/**
|
|
@@ -432,8 +434,8 @@ export type PluginCameraProjection = z.infer<typeof PluginCameraProjection>
|
|
|
432
434
|
* | `target` | {@linkcode Vec3Handle} | Point the camera looks at |
|
|
433
435
|
*/
|
|
434
436
|
export const PluginCameraLookFromArgs = z.object({
|
|
435
|
-
eye:
|
|
436
|
-
target:
|
|
437
|
+
eye: Vec3Input,
|
|
438
|
+
target: Vec3Input,
|
|
437
439
|
})
|
|
438
440
|
export type PluginCameraLookFromArgs = z.infer<typeof PluginCameraLookFromArgs>
|
|
439
441
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../../types"
|
|
3
|
-
import { Vec3Handle, ComponentHandle, Vec3Components } from "../../../handles"
|
|
3
|
+
import { Vec3Handle, Vec3Input, ComponentHandle, Vec3Components } from "../../../handles"
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Comments — create, edit, resolve, tag, and list scene/project comments.
|
|
@@ -40,7 +40,7 @@ export abstract class PluginCommentApi {
|
|
|
40
40
|
public abstract create(
|
|
41
41
|
message: string,
|
|
42
42
|
component?: ComponentHandle,
|
|
43
|
-
position?:
|
|
43
|
+
position?: Vec3Input,
|
|
44
44
|
mentions?: string[],
|
|
45
45
|
): PluginApiReturn<CommentHandle>
|
|
46
46
|
|
|
@@ -258,7 +258,7 @@ export const CommentHandle = z
|
|
|
258
258
|
*/
|
|
259
259
|
export const PluginCommentCreateArgs = z.object({
|
|
260
260
|
component: ComponentHandle.optional(),
|
|
261
|
-
position:
|
|
261
|
+
position: Vec3Input.optional(),
|
|
262
262
|
message: z.string(),
|
|
263
263
|
mentions: z.array(z.string()).optional(),
|
|
264
264
|
})
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
MAX_FILLET_LAW_SAMPLES,
|
|
9
9
|
} from "../../../../massParameters"
|
|
10
10
|
import type { SweepAlongCurveRecordOptions } from "../../../../massParameters"
|
|
11
|
-
import { Vec3Handle, LineHandle, ArcHandle, SplineHandle, CircleHandle, CurveHandle, ProfileHandle, ContourHandle, BrepHandle, FaceHandle, EdgeHandle, Vec3Components } from "../../../../handles"
|
|
11
|
+
import { Vec3Handle, Vec3Input, LineHandle, ArcHandle, SplineHandle, CircleHandle, CurveHandle, ProfileHandle, ContourHandle, BrepHandle, FaceHandle, EdgeHandle, Vec3Components } from "../../../../handles"
|
|
12
12
|
|
|
13
13
|
/** Maximum boundary items one patch may span. */
|
|
14
14
|
export const MAX_PATCH_BOUNDARY_CURVES = 16
|
|
@@ -63,7 +63,7 @@ export abstract class PluginGeomCreateApi {
|
|
|
63
63
|
* const line = snaptrude.core.geom.create.line(startPoint, endPoint)
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
public abstract line(startPoint:
|
|
66
|
+
public abstract line(startPoint: Vec3Input, endPoint: Vec3Input): PluginApiReturn<LineHandle>
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Create a circular arc from its start, end, centre, and axis point handles.
|
|
@@ -84,10 +84,10 @@ export abstract class PluginGeomCreateApi {
|
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
86
|
public abstract arc(
|
|
87
|
-
startPoint:
|
|
88
|
-
endPoint:
|
|
89
|
-
centrePoint:
|
|
90
|
-
axis:
|
|
87
|
+
startPoint: Vec3Input,
|
|
88
|
+
endPoint: Vec3Input,
|
|
89
|
+
centrePoint: Vec3Input,
|
|
90
|
+
axis: Vec3Input,
|
|
91
91
|
): PluginApiReturn<ArcHandle>
|
|
92
92
|
|
|
93
93
|
/**
|
|
@@ -109,8 +109,8 @@ export abstract class PluginGeomCreateApi {
|
|
|
109
109
|
* ```
|
|
110
110
|
*/
|
|
111
111
|
public abstract circle(
|
|
112
|
-
centrePoint:
|
|
113
|
-
axis:
|
|
112
|
+
centrePoint: Vec3Input,
|
|
113
|
+
axis: Vec3Input,
|
|
114
114
|
radius: number,
|
|
115
115
|
): PluginApiReturn<CircleHandle>
|
|
116
116
|
|
|
@@ -144,7 +144,7 @@ export abstract class PluginGeomCreateApi {
|
|
|
144
144
|
* const profile = await snaptrude.core.geom.create.profileFromCurves([spline, base])
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
-
public abstract splineFromPoints(points:
|
|
147
|
+
public abstract splineFromPoints(points: Vec3Input[]): PluginApiReturn<SplineHandle>
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
150
|
* Create an open NURBS curve DEFINED BY control points — the curve is pulled
|
|
@@ -179,7 +179,7 @@ export abstract class PluginGeomCreateApi {
|
|
|
179
179
|
* ```
|
|
180
180
|
*/
|
|
181
181
|
public abstract splineFromControlPoints(
|
|
182
|
-
controlPoints:
|
|
182
|
+
controlPoints: Vec3Input[],
|
|
183
183
|
options?: { degree?: number },
|
|
184
184
|
): PluginApiReturn<SplineHandle>
|
|
185
185
|
|
|
@@ -220,7 +220,7 @@ export abstract class PluginGeomCreateApi {
|
|
|
220
220
|
* const profile = snaptrude.core.geom.create.profileFromLinePoints(points)
|
|
221
221
|
* ```
|
|
222
222
|
*/
|
|
223
|
-
public abstract profileFromLinePoints(points:
|
|
223
|
+
public abstract profileFromLinePoints(points: Vec3Input[]): PluginApiReturn<ProfileHandle>
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
226
|
* Create a profile from an ordered list of curve handles forming a closed loop.
|
|
@@ -269,7 +269,7 @@ export abstract class PluginGeomCreateApi {
|
|
|
269
269
|
* const podium = await snaptrude.design.create.massFromBrep(brep, "Podium")
|
|
270
270
|
* ```
|
|
271
271
|
*/
|
|
272
|
-
public abstract profileFromSplinePoints(points:
|
|
272
|
+
public abstract profileFromSplinePoints(points: Vec3Input[]): PluginApiReturn<ProfileHandle>
|
|
273
273
|
|
|
274
274
|
/**
|
|
275
275
|
* Create an axis-aligned **rectangle** profile in the XZ plane,
|
|
@@ -298,7 +298,7 @@ export abstract class PluginGeomCreateApi {
|
|
|
298
298
|
public abstract profileRect(
|
|
299
299
|
width: number,
|
|
300
300
|
depth: number,
|
|
301
|
-
center?:
|
|
301
|
+
center?: Vec3Input,
|
|
302
302
|
): PluginApiReturn<ProfileHandle>
|
|
303
303
|
|
|
304
304
|
/**
|
|
@@ -1482,8 +1482,8 @@ export abstract class PluginGeomCreateApi {
|
|
|
1482
1482
|
* | `endPoint` | {@linkcode Vec3Handle} | End point of the line segment |
|
|
1483
1483
|
*/
|
|
1484
1484
|
export const PluginGeomCreateLineArgs = z.object({
|
|
1485
|
-
startPoint:
|
|
1486
|
-
endPoint:
|
|
1485
|
+
startPoint: Vec3Input,
|
|
1486
|
+
endPoint: Vec3Input,
|
|
1487
1487
|
})
|
|
1488
1488
|
|
|
1489
1489
|
export type PluginGeomCreateLineArgs = z.infer<typeof PluginGeomCreateLineArgs>
|
|
@@ -1499,10 +1499,10 @@ export type PluginGeomCreateLineArgs = z.infer<typeof PluginGeomCreateLineArgs>
|
|
|
1499
1499
|
* | `axis` | {@linkcode Vec3Handle} | Axis direction of the arc |
|
|
1500
1500
|
*/
|
|
1501
1501
|
export const PluginGeomCreateArcArgs = z.object({
|
|
1502
|
-
startPoint:
|
|
1503
|
-
endPoint:
|
|
1504
|
-
centrePoint:
|
|
1505
|
-
axis:
|
|
1502
|
+
startPoint: Vec3Input,
|
|
1503
|
+
endPoint: Vec3Input,
|
|
1504
|
+
centrePoint: Vec3Input,
|
|
1505
|
+
axis: Vec3Input,
|
|
1506
1506
|
})
|
|
1507
1507
|
|
|
1508
1508
|
export type PluginGeomCreateArcArgs = z.infer<typeof PluginGeomCreateArcArgs>
|
|
@@ -1517,8 +1517,8 @@ export type PluginGeomCreateArcArgs = z.infer<typeof PluginGeomCreateArcArgs>
|
|
|
1517
1517
|
* | `radius` | `number` | Radius of the circle |
|
|
1518
1518
|
*/
|
|
1519
1519
|
export const PluginGeomCreateCircleArgs = z.object({
|
|
1520
|
-
centrePoint:
|
|
1521
|
-
axis:
|
|
1520
|
+
centrePoint: Vec3Input,
|
|
1521
|
+
axis: Vec3Input,
|
|
1522
1522
|
radius: z.number(),
|
|
1523
1523
|
})
|
|
1524
1524
|
|
|
@@ -1532,7 +1532,7 @@ export type PluginGeomCreateCircleArgs = z.infer<typeof PluginGeomCreateCircleAr
|
|
|
1532
1532
|
* | `points` | {@linkcode Vec3Handle}`[]` | 3..256 ordered through-points of the curve |
|
|
1533
1533
|
*/
|
|
1534
1534
|
export const PluginGeomCreateSplineFromPointsArgs = z.object({
|
|
1535
|
-
points: z.array(
|
|
1535
|
+
points: z.array(Vec3Input).min(3).max(MAX_SPLINE_THROUGH_POINTS),
|
|
1536
1536
|
})
|
|
1537
1537
|
|
|
1538
1538
|
export type PluginGeomCreateSplineFromPointsArgs = z.infer<
|
|
@@ -1548,7 +1548,7 @@ export type PluginGeomCreateSplineFromPointsArgs = z.infer<
|
|
|
1548
1548
|
* | `options` | `object`? | `degree`: 2 or 3 (default `min(3, controlPoints.length - 1)`) |
|
|
1549
1549
|
*/
|
|
1550
1550
|
export const PluginGeomCreateSplineFromControlPointsArgs = z.object({
|
|
1551
|
-
controlPoints: z.array(
|
|
1551
|
+
controlPoints: z.array(Vec3Input).min(3).max(MAX_SPLINE_POLES),
|
|
1552
1552
|
options: z.object({ degree: z.number().int().min(2).max(3).optional() }).optional(),
|
|
1553
1553
|
})
|
|
1554
1554
|
|
|
@@ -1564,7 +1564,7 @@ export type PluginGeomCreateSplineFromControlPointsArgs = z.infer<
|
|
|
1564
1564
|
* | `points` | {@linkcode Vec3Handle}`[]` | Ordered vertex handles of the profile |
|
|
1565
1565
|
*/
|
|
1566
1566
|
export const PluginGeomCreateProfileFromLinePointsArgs = z.object({
|
|
1567
|
-
points: z.array(
|
|
1567
|
+
points: z.array(Vec3Input),
|
|
1568
1568
|
})
|
|
1569
1569
|
|
|
1570
1570
|
export type PluginGeomCreateProfileFromLinePointsArgs = z.infer<
|
|
@@ -1594,7 +1594,7 @@ export type PluginGeomCreateProfileFromCurvesArgs = z.infer<
|
|
|
1594
1594
|
* | `points` | {@linkcode Vec3Handle}`[]` | 3..256 ordered through-points of the closed loop (first point NOT repeated) |
|
|
1595
1595
|
*/
|
|
1596
1596
|
export const PluginGeomCreateProfileFromSplinePointsArgs = z.object({
|
|
1597
|
-
points: z.array(
|
|
1597
|
+
points: z.array(Vec3Input).min(3).max(MAX_SPLINE_THROUGH_POINTS),
|
|
1598
1598
|
})
|
|
1599
1599
|
|
|
1600
1600
|
export type PluginGeomCreateProfileFromSplinePointsArgs = z.infer<
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../../../types"
|
|
3
|
-
import { CircleHandle, Vec3Handle, Vec3Components } from "../../../../handles"
|
|
3
|
+
import { CircleHandle, Vec3Handle, Vec3Input, Vec3Components } from "../../../../handles"
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Circle-specific geometry queries — read closed-circle properties as plain values
|
|
@@ -123,7 +123,7 @@ export abstract class PluginGeomQueryCircleApi {
|
|
|
123
123
|
*/
|
|
124
124
|
public abstract getNearestPoint(
|
|
125
125
|
circle: CircleHandle,
|
|
126
|
-
point:
|
|
126
|
+
point: Vec3Input
|
|
127
127
|
): PluginApiReturn<Vec3Components>
|
|
128
128
|
|
|
129
129
|
/**
|
|
@@ -143,7 +143,7 @@ export abstract class PluginGeomQueryCircleApi {
|
|
|
143
143
|
* const onCircle = await snaptrude.core.geom.query.circle.hasPoint(circle, pt)
|
|
144
144
|
* ```
|
|
145
145
|
*/
|
|
146
|
-
public abstract hasPoint(circle: CircleHandle, point:
|
|
146
|
+
public abstract hasPoint(circle: CircleHandle, point: Vec3Input): PluginApiReturn<boolean>
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* Get the tangent direction of a circle at a point on it.
|
|
@@ -161,7 +161,7 @@ export abstract class PluginGeomQueryCircleApi {
|
|
|
161
161
|
* console.log(tangent.x, tangent.y, tangent.z)
|
|
162
162
|
* ```
|
|
163
163
|
*/
|
|
164
|
-
public abstract getTangent(circle: CircleHandle, point:
|
|
164
|
+
public abstract getTangent(circle: CircleHandle, point: Vec3Input): PluginApiReturn<Vec3Components>
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
167
|
* Get the (in-plane, radial) normal direction of a circle at a point on it.
|
|
@@ -179,7 +179,7 @@ export abstract class PluginGeomQueryCircleApi {
|
|
|
179
179
|
* console.log(normal.x, normal.y, normal.z)
|
|
180
180
|
* ```
|
|
181
181
|
*/
|
|
182
|
-
public abstract getNormal(circle: CircleHandle, point:
|
|
182
|
+
public abstract getNormal(circle: CircleHandle, point: Vec3Input): PluginApiReturn<Vec3Components>
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
* Get the point reached by travelling a signed arc-distance along the circle from
|
|
@@ -204,7 +204,7 @@ export abstract class PluginGeomQueryCircleApi {
|
|
|
204
204
|
*/
|
|
205
205
|
public abstract getPointAtDistance(
|
|
206
206
|
circle: CircleHandle,
|
|
207
|
-
referencePoint:
|
|
207
|
+
referencePoint: Vec3Input,
|
|
208
208
|
distance: number,
|
|
209
209
|
forward?: boolean
|
|
210
210
|
): PluginApiReturn<Vec3Components>
|
|
@@ -307,7 +307,7 @@ export type PluginGeomQueryCircleIsValidArgs = z.infer<typeof PluginGeomQueryCir
|
|
|
307
307
|
*/
|
|
308
308
|
export const PluginGeomQueryCircleGetNearestPointArgs = z.object({
|
|
309
309
|
circle: CircleHandle,
|
|
310
|
-
point:
|
|
310
|
+
point: Vec3Input,
|
|
311
311
|
})
|
|
312
312
|
export type PluginGeomQueryCircleGetNearestPointArgs = z.infer<
|
|
313
313
|
typeof PluginGeomQueryCircleGetNearestPointArgs
|
|
@@ -323,7 +323,7 @@ export type PluginGeomQueryCircleGetNearestPointArgs = z.infer<
|
|
|
323
323
|
*/
|
|
324
324
|
export const PluginGeomQueryCircleHasPointArgs = z.object({
|
|
325
325
|
circle: CircleHandle,
|
|
326
|
-
point:
|
|
326
|
+
point: Vec3Input,
|
|
327
327
|
})
|
|
328
328
|
export type PluginGeomQueryCircleHasPointArgs = z.infer<typeof PluginGeomQueryCircleHasPointArgs>
|
|
329
329
|
|
|
@@ -337,7 +337,7 @@ export type PluginGeomQueryCircleHasPointArgs = z.infer<typeof PluginGeomQueryCi
|
|
|
337
337
|
*/
|
|
338
338
|
export const PluginGeomQueryCircleGetTangentArgs = z.object({
|
|
339
339
|
circle: CircleHandle,
|
|
340
|
-
point:
|
|
340
|
+
point: Vec3Input,
|
|
341
341
|
})
|
|
342
342
|
export type PluginGeomQueryCircleGetTangentArgs = z.infer<typeof PluginGeomQueryCircleGetTangentArgs>
|
|
343
343
|
|
|
@@ -351,7 +351,7 @@ export type PluginGeomQueryCircleGetTangentArgs = z.infer<typeof PluginGeomQuery
|
|
|
351
351
|
*/
|
|
352
352
|
export const PluginGeomQueryCircleGetNormalArgs = z.object({
|
|
353
353
|
circle: CircleHandle,
|
|
354
|
-
point:
|
|
354
|
+
point: Vec3Input,
|
|
355
355
|
})
|
|
356
356
|
export type PluginGeomQueryCircleGetNormalArgs = z.infer<typeof PluginGeomQueryCircleGetNormalArgs>
|
|
357
357
|
|
|
@@ -367,7 +367,7 @@ export type PluginGeomQueryCircleGetNormalArgs = z.infer<typeof PluginGeomQueryC
|
|
|
367
367
|
*/
|
|
368
368
|
export const PluginGeomQueryCircleGetPointAtDistanceArgs = z.object({
|
|
369
369
|
circle: CircleHandle,
|
|
370
|
-
referencePoint:
|
|
370
|
+
referencePoint: Vec3Input,
|
|
371
371
|
distance: z.number(),
|
|
372
372
|
forward: z.boolean().optional(),
|
|
373
373
|
})
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
ContourHandle,
|
|
5
5
|
ProfileHandle,
|
|
6
6
|
Vec3Handle,
|
|
7
|
+
Vec3Input,
|
|
7
8
|
Vec3Components,
|
|
8
9
|
BBoxComponents,
|
|
9
10
|
} from "../../../../handles"
|
|
@@ -175,7 +176,7 @@ export abstract class PluginGeomQueryContourApi {
|
|
|
175
176
|
*/
|
|
176
177
|
public abstract getNearestPoint(
|
|
177
178
|
contour: ContourHandle,
|
|
178
|
-
point:
|
|
179
|
+
point: Vec3Input
|
|
179
180
|
): PluginApiReturn<Vec3Components>
|
|
180
181
|
|
|
181
182
|
/**
|
|
@@ -199,7 +200,7 @@ export abstract class PluginGeomQueryContourApi {
|
|
|
199
200
|
*/
|
|
200
201
|
public abstract hasPoint(
|
|
201
202
|
contour: ContourHandle,
|
|
202
|
-
point:
|
|
203
|
+
point: Vec3Input
|
|
203
204
|
): PluginApiReturn<boolean>
|
|
204
205
|
|
|
205
206
|
/**
|
|
@@ -218,7 +219,7 @@ export abstract class PluginGeomQueryContourApi {
|
|
|
218
219
|
*/
|
|
219
220
|
public abstract isOnBoundary(
|
|
220
221
|
contour: ContourHandle,
|
|
221
|
-
point:
|
|
222
|
+
point: Vec3Input
|
|
222
223
|
): PluginApiReturn<boolean>
|
|
223
224
|
|
|
224
225
|
/**
|
|
@@ -424,7 +425,7 @@ export type PluginGeomQueryContourGetNormalArgs = z.infer<typeof PluginGeomQuery
|
|
|
424
425
|
*/
|
|
425
426
|
export const PluginGeomQueryContourGetNearestPointArgs = z.object({
|
|
426
427
|
contour: ContourHandle,
|
|
427
|
-
point:
|
|
428
|
+
point: Vec3Input,
|
|
428
429
|
})
|
|
429
430
|
|
|
430
431
|
export type PluginGeomQueryContourGetNearestPointArgs = z.infer<typeof PluginGeomQueryContourGetNearestPointArgs>
|
|
@@ -439,7 +440,7 @@ export type PluginGeomQueryContourGetNearestPointArgs = z.infer<typeof PluginGeo
|
|
|
439
440
|
*/
|
|
440
441
|
export const PluginGeomQueryContourHasPointArgs = z.object({
|
|
441
442
|
contour: ContourHandle,
|
|
442
|
-
point:
|
|
443
|
+
point: Vec3Input,
|
|
443
444
|
})
|
|
444
445
|
|
|
445
446
|
export type PluginGeomQueryContourHasPointArgs = z.infer<typeof PluginGeomQueryContourHasPointArgs>
|
|
@@ -454,7 +455,7 @@ export type PluginGeomQueryContourHasPointArgs = z.infer<typeof PluginGeomQueryC
|
|
|
454
455
|
*/
|
|
455
456
|
export const PluginGeomQueryContourIsOnBoundaryArgs = z.object({
|
|
456
457
|
contour: ContourHandle,
|
|
457
|
-
point:
|
|
458
|
+
point: Vec3Input,
|
|
458
459
|
})
|
|
459
460
|
|
|
460
461
|
export type PluginGeomQueryContourIsOnBoundaryArgs = z.infer<typeof PluginGeomQueryContourIsOnBoundaryArgs>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../../../types"
|
|
3
|
-
import { Vec3Handle, CurveHandle, LineHandle, Vec3Components } from "../../../../handles"
|
|
3
|
+
import { Vec3Handle, Vec3Input, CurveHandle, LineHandle, Vec3Components } from "../../../../handles"
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Curve queries — read-only geometric questions about curves (lines, arcs and
|
|
@@ -152,7 +152,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
152
152
|
*/
|
|
153
153
|
public abstract getTangent(
|
|
154
154
|
curve: CurveHandle,
|
|
155
|
-
point:
|
|
155
|
+
point: Vec3Input,
|
|
156
156
|
): PluginApiReturn<Vec3Components>
|
|
157
157
|
|
|
158
158
|
/**
|
|
@@ -171,7 +171,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
171
171
|
*/
|
|
172
172
|
public abstract getNormal(
|
|
173
173
|
curve: CurveHandle,
|
|
174
|
-
point:
|
|
174
|
+
point: Vec3Input,
|
|
175
175
|
): PluginApiReturn<Vec3Components>
|
|
176
176
|
|
|
177
177
|
/**
|
|
@@ -194,7 +194,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
194
194
|
*/
|
|
195
195
|
public abstract getNearestPoint(
|
|
196
196
|
curve: CurveHandle,
|
|
197
|
-
point:
|
|
197
|
+
point: Vec3Input,
|
|
198
198
|
): PluginApiReturn<Vec3Components>
|
|
199
199
|
|
|
200
200
|
/**
|
|
@@ -214,7 +214,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
214
214
|
*/
|
|
215
215
|
public abstract getProjection(
|
|
216
216
|
curve: CurveHandle,
|
|
217
|
-
point:
|
|
217
|
+
point: Vec3Input,
|
|
218
218
|
): PluginApiReturn<Vec3Components>
|
|
219
219
|
|
|
220
220
|
/**
|
|
@@ -239,7 +239,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
239
239
|
*/
|
|
240
240
|
public abstract getPointAtDistance(
|
|
241
241
|
curve: CurveHandle,
|
|
242
|
-
referencePoint:
|
|
242
|
+
referencePoint: Vec3Input,
|
|
243
243
|
distance: number,
|
|
244
244
|
forward?: boolean,
|
|
245
245
|
): PluginApiReturn<Vec3Components>
|
|
@@ -260,7 +260,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
260
260
|
*/
|
|
261
261
|
public abstract getParameterAtPoint(
|
|
262
262
|
curve: CurveHandle,
|
|
263
|
-
point:
|
|
263
|
+
point: Vec3Input,
|
|
264
264
|
): PluginApiReturn<number>
|
|
265
265
|
|
|
266
266
|
/**
|
|
@@ -281,7 +281,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
281
281
|
*/
|
|
282
282
|
public abstract getCurvature(
|
|
283
283
|
curve: CurveHandle,
|
|
284
|
-
point:
|
|
284
|
+
point: Vec3Input,
|
|
285
285
|
): PluginApiReturn<number>
|
|
286
286
|
|
|
287
287
|
/**
|
|
@@ -305,7 +305,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
305
305
|
*/
|
|
306
306
|
public abstract getDistanceToPoint(
|
|
307
307
|
curve: CurveHandle,
|
|
308
|
-
point:
|
|
308
|
+
point: Vec3Input,
|
|
309
309
|
): PluginApiReturn<number>
|
|
310
310
|
|
|
311
311
|
/**
|
|
@@ -328,8 +328,8 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
328
328
|
*/
|
|
329
329
|
public abstract getDistanceAlong(
|
|
330
330
|
curve: CurveHandle,
|
|
331
|
-
pointA:
|
|
332
|
-
pointB:
|
|
331
|
+
pointA: Vec3Input,
|
|
332
|
+
pointB: Vec3Input,
|
|
333
333
|
): PluginApiReturn<number>
|
|
334
334
|
|
|
335
335
|
/**
|
|
@@ -415,7 +415,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
415
415
|
*/
|
|
416
416
|
public abstract isOnCurve(
|
|
417
417
|
curve: CurveHandle,
|
|
418
|
-
point:
|
|
418
|
+
point: Vec3Input,
|
|
419
419
|
threshold?: number,
|
|
420
420
|
): PluginApiReturn<boolean>
|
|
421
421
|
|
|
@@ -437,7 +437,7 @@ export abstract class PluginGeomQueryCurveApi {
|
|
|
437
437
|
*/
|
|
438
438
|
public abstract hasPoint(
|
|
439
439
|
curve: CurveHandle,
|
|
440
|
-
point:
|
|
440
|
+
point: Vec3Input,
|
|
441
441
|
includeEndPoints?: boolean,
|
|
442
442
|
): PluginApiReturn<boolean>
|
|
443
443
|
|
|
@@ -748,7 +748,7 @@ export type PluginGeomQueryCurveGetChordLengthArgs = z.infer<typeof PluginGeomQu
|
|
|
748
748
|
*/
|
|
749
749
|
export const PluginGeomQueryCurveGetTangentArgs = z.object({
|
|
750
750
|
curve: CurveHandle,
|
|
751
|
-
point:
|
|
751
|
+
point: Vec3Input,
|
|
752
752
|
})
|
|
753
753
|
|
|
754
754
|
export type PluginGeomQueryCurveGetTangentArgs = z.infer<typeof PluginGeomQueryCurveGetTangentArgs>
|
|
@@ -763,7 +763,7 @@ export type PluginGeomQueryCurveGetTangentArgs = z.infer<typeof PluginGeomQueryC
|
|
|
763
763
|
*/
|
|
764
764
|
export const PluginGeomQueryCurveGetNormalArgs = z.object({
|
|
765
765
|
curve: CurveHandle,
|
|
766
|
-
point:
|
|
766
|
+
point: Vec3Input,
|
|
767
767
|
})
|
|
768
768
|
|
|
769
769
|
export type PluginGeomQueryCurveGetNormalArgs = z.infer<typeof PluginGeomQueryCurveGetNormalArgs>
|
|
@@ -778,7 +778,7 @@ export type PluginGeomQueryCurveGetNormalArgs = z.infer<typeof PluginGeomQueryCu
|
|
|
778
778
|
*/
|
|
779
779
|
export const PluginGeomQueryCurveGetNearestPointArgs = z.object({
|
|
780
780
|
curve: CurveHandle,
|
|
781
|
-
point:
|
|
781
|
+
point: Vec3Input,
|
|
782
782
|
})
|
|
783
783
|
|
|
784
784
|
export type PluginGeomQueryCurveGetNearestPointArgs = z.infer<typeof PluginGeomQueryCurveGetNearestPointArgs>
|
|
@@ -793,7 +793,7 @@ export type PluginGeomQueryCurveGetNearestPointArgs = z.infer<typeof PluginGeomQ
|
|
|
793
793
|
*/
|
|
794
794
|
export const PluginGeomQueryCurveGetProjectionArgs = z.object({
|
|
795
795
|
curve: CurveHandle,
|
|
796
|
-
point:
|
|
796
|
+
point: Vec3Input,
|
|
797
797
|
})
|
|
798
798
|
|
|
799
799
|
export type PluginGeomQueryCurveGetProjectionArgs = z.infer<typeof PluginGeomQueryCurveGetProjectionArgs>
|
|
@@ -810,7 +810,7 @@ export type PluginGeomQueryCurveGetProjectionArgs = z.infer<typeof PluginGeomQue
|
|
|
810
810
|
*/
|
|
811
811
|
export const PluginGeomQueryCurveGetPointAtDistanceArgs = z.object({
|
|
812
812
|
curve: CurveHandle,
|
|
813
|
-
referencePoint:
|
|
813
|
+
referencePoint: Vec3Input,
|
|
814
814
|
distance: z.number(),
|
|
815
815
|
forward: z.boolean().optional(),
|
|
816
816
|
})
|
|
@@ -827,7 +827,7 @@ export type PluginGeomQueryCurveGetPointAtDistanceArgs = z.infer<typeof PluginGe
|
|
|
827
827
|
*/
|
|
828
828
|
export const PluginGeomQueryCurveGetParameterAtPointArgs = z.object({
|
|
829
829
|
curve: CurveHandle,
|
|
830
|
-
point:
|
|
830
|
+
point: Vec3Input,
|
|
831
831
|
})
|
|
832
832
|
|
|
833
833
|
export type PluginGeomQueryCurveGetParameterAtPointArgs = z.infer<typeof PluginGeomQueryCurveGetParameterAtPointArgs>
|
|
@@ -842,7 +842,7 @@ export type PluginGeomQueryCurveGetParameterAtPointArgs = z.infer<typeof PluginG
|
|
|
842
842
|
*/
|
|
843
843
|
export const PluginGeomQueryCurveGetCurvatureArgs = z.object({
|
|
844
844
|
curve: CurveHandle,
|
|
845
|
-
point:
|
|
845
|
+
point: Vec3Input,
|
|
846
846
|
})
|
|
847
847
|
|
|
848
848
|
export type PluginGeomQueryCurveGetCurvatureArgs = z.infer<typeof PluginGeomQueryCurveGetCurvatureArgs>
|
|
@@ -857,7 +857,7 @@ export type PluginGeomQueryCurveGetCurvatureArgs = z.infer<typeof PluginGeomQuer
|
|
|
857
857
|
*/
|
|
858
858
|
export const PluginGeomQueryCurveGetDistanceToPointArgs = z.object({
|
|
859
859
|
curve: CurveHandle,
|
|
860
|
-
point:
|
|
860
|
+
point: Vec3Input,
|
|
861
861
|
})
|
|
862
862
|
|
|
863
863
|
export type PluginGeomQueryCurveGetDistanceToPointArgs = z.infer<typeof PluginGeomQueryCurveGetDistanceToPointArgs>
|
|
@@ -873,8 +873,8 @@ export type PluginGeomQueryCurveGetDistanceToPointArgs = z.infer<typeof PluginGe
|
|
|
873
873
|
*/
|
|
874
874
|
export const PluginGeomQueryCurveGetDistanceAlongArgs = z.object({
|
|
875
875
|
curve: CurveHandle,
|
|
876
|
-
pointA:
|
|
877
|
-
pointB:
|
|
876
|
+
pointA: Vec3Input,
|
|
877
|
+
pointB: Vec3Input,
|
|
878
878
|
})
|
|
879
879
|
|
|
880
880
|
export type PluginGeomQueryCurveGetDistanceAlongArgs = z.infer<typeof PluginGeomQueryCurveGetDistanceAlongArgs>
|
|
@@ -933,7 +933,7 @@ export type PluginGeomQueryCurveIsLinearArgs = z.infer<typeof PluginGeomQueryCur
|
|
|
933
933
|
*/
|
|
934
934
|
export const PluginGeomQueryCurveIsOnCurveArgs = z.object({
|
|
935
935
|
curve: CurveHandle,
|
|
936
|
-
point:
|
|
936
|
+
point: Vec3Input,
|
|
937
937
|
threshold: z.number().optional(),
|
|
938
938
|
})
|
|
939
939
|
|
|
@@ -950,7 +950,7 @@ export type PluginGeomQueryCurveIsOnCurveArgs = z.infer<typeof PluginGeomQueryCu
|
|
|
950
950
|
*/
|
|
951
951
|
export const PluginGeomQueryCurveHasPointArgs = z.object({
|
|
952
952
|
curve: CurveHandle,
|
|
953
|
-
point:
|
|
953
|
+
point: Vec3Input,
|
|
954
954
|
includeEndPoints: z.boolean().optional(),
|
|
955
955
|
})
|
|
956
956
|
|