@snaptrude/plugin-core 0.0.5 → 0.0.7
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/dist/api/core/geom/arc.d.ts +50 -1
- package/dist/api/core/geom/arc.d.ts.map +1 -1
- package/dist/api/core/geom/curve.d.ts +26 -1
- package/dist/api/core/geom/curve.d.ts.map +1 -1
- package/dist/api/core/geom/index.d.ts +16 -0
- package/dist/api/core/geom/index.d.ts.map +1 -1
- package/dist/api/core/geom/line.d.ts +35 -1
- package/dist/api/core/geom/line.d.ts.map +1 -1
- package/dist/api/core/geom/profile.d.ts +66 -2
- package/dist/api/core/geom/profile.d.ts.map +1 -1
- package/dist/api/core/index.d.ts +8 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/math/index.d.ts +8 -0
- package/dist/api/core/math/index.d.ts.map +1 -1
- package/dist/api/core/math/quat.d.ts +156 -15
- package/dist/api/core/math/quat.d.ts.map +1 -1
- package/dist/api/core/math/vec3.d.ts +131 -14
- package/dist/api/core/math/vec3.d.ts.map +1 -1
- package/dist/api/entity/index.d.ts +13 -0
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +259 -0
- package/dist/api/entity/referenceLine.d.ts.map +1 -0
- package/dist/api/entity/space.d.ts +467 -7
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +166 -0
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +14 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/tools/index.d.ts +8 -0
- package/dist/api/tools/index.d.ts.map +1 -1
- package/dist/api/tools/selection.d.ts +37 -0
- package/dist/api/tools/selection.d.ts.map +1 -1
- package/dist/api/tools/transform.d.ts +82 -0
- package/dist/api/tools/transform.d.ts.map +1 -1
- package/dist/api/units/index.d.ts +81 -13
- package/dist/api/units/index.d.ts.map +1 -1
- package/dist/index.cjs +547 -126
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +533 -126
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/core/geom/arc.ts +50 -1
- package/src/api/core/geom/curve.ts +26 -1
- package/src/api/core/geom/index.ts +16 -0
- package/src/api/core/geom/line.ts +35 -1
- package/src/api/core/geom/profile.ts +66 -2
- package/src/api/core/index.ts +8 -0
- package/src/api/core/math/index.ts +8 -0
- package/src/api/core/math/quat.ts +156 -15
- package/src/api/core/math/vec3.ts +131 -14
- package/src/api/entity/index.ts +13 -0
- package/src/api/entity/referenceLine.ts +215 -0
- package/src/api/entity/space.ts +447 -11
- package/src/api/entity/story.ts +166 -0
- package/src/api/index.ts +14 -0
- package/src/api/tools/index.ts +8 -0
- package/src/api/tools/selection.ts +37 -0
- package/src/api/tools/transform.ts +82 -0
- package/src/api/units/index.ts +81 -13
- package/src/types.ts +8 -1
- package/tsup.config.ts +0 -1
|
@@ -1,35 +1,152 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* 3D vector operations for positions, directions, and displacements.
|
|
4
|
+
*
|
|
5
|
+
* All methods are **pure** — they return new {@linkcode PVec3} values
|
|
6
|
+
* without mutating the inputs.
|
|
7
|
+
*
|
|
8
|
+
* Accessed via `snaptrude.core.math.vec3`.
|
|
9
|
+
*/
|
|
2
10
|
export declare abstract class PluginVec3Api {
|
|
3
11
|
constructor();
|
|
4
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Create a new 3D vector.
|
|
14
|
+
*
|
|
15
|
+
* @param x - The X component
|
|
16
|
+
* @param y - The Y component
|
|
17
|
+
* @param z - The Z component
|
|
18
|
+
* @returns A new {@linkcode PVec3}
|
|
19
|
+
*
|
|
20
|
+
* # Example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const position = snaptrude.core.math.vec3.new(1, 2, 3)
|
|
23
|
+
* // { x: 1, y: 2, z: 3 }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
5
26
|
new(x: number, y: number, z: number): PVec3;
|
|
6
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Add two vectors component-wise.
|
|
29
|
+
*
|
|
30
|
+
* @param a - First vector
|
|
31
|
+
* @param b - Second vector
|
|
32
|
+
* @returns A new {@linkcode PVec3} where each component is `a[i] + b[i]`
|
|
33
|
+
*/
|
|
7
34
|
add(a: PVec3, b: PVec3): PVec3;
|
|
8
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Subtract vector {@linkcode b} from vector {@linkcode a} component-wise.
|
|
37
|
+
*
|
|
38
|
+
* @param a - Vector to subtract from
|
|
39
|
+
* @param b - Vector to subtract
|
|
40
|
+
* @returns A new {@linkcode PVec3} where each component is `a[i] - b[i]`
|
|
41
|
+
*/
|
|
9
42
|
subtract(a: PVec3, b: PVec3): PVec3;
|
|
10
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Scale a vector by a scalar value.
|
|
45
|
+
*
|
|
46
|
+
* @param v - The vector to scale
|
|
47
|
+
* @param scalar - The scalar multiplier
|
|
48
|
+
* @returns A new {@linkcode PVec3} where each component is `v[i] * scalar`
|
|
49
|
+
*/
|
|
11
50
|
scale(v: PVec3, scalar: number): PVec3;
|
|
12
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Compute the dot product of two vectors.
|
|
53
|
+
*
|
|
54
|
+
* The dot product equals `|a| * |b| * cos(θ)` where `θ` is the angle
|
|
55
|
+
* between the vectors. Useful for checking orthogonality (result = 0)
|
|
56
|
+
* or projection.
|
|
57
|
+
*
|
|
58
|
+
* @param a - First vector
|
|
59
|
+
* @param b - Second vector
|
|
60
|
+
* @returns The scalar dot product
|
|
61
|
+
*/
|
|
13
62
|
dot(a: PVec3, b: PVec3): number;
|
|
14
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Compute the cross product of two vectors.
|
|
65
|
+
*
|
|
66
|
+
* The result is a vector perpendicular to both inputs, with magnitude
|
|
67
|
+
* equal to the area of the parallelogram they span. Useful for computing
|
|
68
|
+
* surface normals.
|
|
69
|
+
*
|
|
70
|
+
* @param a - First vector
|
|
71
|
+
* @param b - Second vector
|
|
72
|
+
* @returns A new {@linkcode PVec3} perpendicular to both {@linkcode a} and {@linkcode b}
|
|
73
|
+
*/
|
|
15
74
|
cross(a: PVec3, b: PVec3): PVec3;
|
|
16
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* Compute the length (magnitude) of a vector.
|
|
77
|
+
*
|
|
78
|
+
* @param v - The vector
|
|
79
|
+
* @returns The Euclidean length `√(x² + y² + z²)`
|
|
80
|
+
*/
|
|
17
81
|
length(v: PVec3): number;
|
|
18
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Compute the squared length of a vector.
|
|
84
|
+
*
|
|
85
|
+
* Avoids the `sqrt` call — prefer this over {@linkcode PluginVec3Api.length}
|
|
86
|
+
* when comparing relative magnitudes.
|
|
87
|
+
*
|
|
88
|
+
* @param v - The vector
|
|
89
|
+
* @returns The squared length `x² + y² + z²`
|
|
90
|
+
*/
|
|
19
91
|
lengthSquared(v: PVec3): number;
|
|
20
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Normalize a vector to unit length.
|
|
94
|
+
*
|
|
95
|
+
* @param v - The vector to normalize
|
|
96
|
+
* @returns A new unit-length {@linkcode PVec3} in the same direction,
|
|
97
|
+
* or a zero vector `(0, 0, 0)` if the input has zero length
|
|
98
|
+
*/
|
|
21
99
|
normalize(v: PVec3): PVec3;
|
|
22
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Compute the Euclidean distance between two points.
|
|
102
|
+
*
|
|
103
|
+
* @param a - First point
|
|
104
|
+
* @param b - Second point
|
|
105
|
+
* @returns The distance `|a - b|`
|
|
106
|
+
*/
|
|
23
107
|
distance(a: PVec3, b: PVec3): number;
|
|
24
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Linearly interpolate between two vectors.
|
|
110
|
+
*
|
|
111
|
+
* @param a - Start vector (returned when `t = 0`)
|
|
112
|
+
* @param b - End vector (returned when `t = 1`)
|
|
113
|
+
* @param t - Interpolation factor, typically in `[0, 1]`
|
|
114
|
+
* @returns A new {@linkcode PVec3} at `a + (b - a) * t`
|
|
115
|
+
*/
|
|
25
116
|
lerp(a: PVec3, b: PVec3, t: number): PVec3;
|
|
26
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Negate a vector (reverse its direction).
|
|
119
|
+
*
|
|
120
|
+
* @param v - The vector to negate
|
|
121
|
+
* @returns A new {@linkcode PVec3} with all components negated
|
|
122
|
+
*/
|
|
27
123
|
negate(v: PVec3): PVec3;
|
|
28
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Check if two vectors are exactly equal (strict equality per component).
|
|
126
|
+
*
|
|
127
|
+
* For floating-point comparisons, prefer {@linkcode PluginVec3Api.equalsApprox}.
|
|
128
|
+
*
|
|
129
|
+
* @param a - First vector
|
|
130
|
+
* @param b - Second vector
|
|
131
|
+
* @returns `true` if all components match exactly
|
|
132
|
+
*/
|
|
29
133
|
equals(a: PVec3, b: PVec3): boolean;
|
|
30
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Check if two vectors are approximately equal within a tolerance.
|
|
136
|
+
*
|
|
137
|
+
* @param a - First vector
|
|
138
|
+
* @param b - Second vector
|
|
139
|
+
* @param epsilon - Maximum allowed difference per component (default `1e-6`)
|
|
140
|
+
* @returns `true` if `|a[i] - b[i]| < epsilon` for all components
|
|
141
|
+
*/
|
|
31
142
|
equalsApprox(a: PVec3, b: PVec3, epsilon?: number): boolean;
|
|
32
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* A 3D vector with `x`, `y`, and `z` components.
|
|
146
|
+
*
|
|
147
|
+
* Used throughout the plugin API for positions, directions, displacements,
|
|
148
|
+
* and Euler rotation angles. Equivalent to `BABYLON.Vector3`.
|
|
149
|
+
*/
|
|
33
150
|
export declare const PVec3: z.ZodObject<{
|
|
34
151
|
x: z.ZodNumber;
|
|
35
152
|
y: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vec3.d.ts","sourceRoot":"","sources":["../../../../src/api/core/math/vec3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,8BAAsB,aAAa;;IAGjC
|
|
1
|
+
{"version":3,"file":"vec3.d.ts","sourceRoot":"","sources":["../../../../src/api/core/math/vec3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB;;;;;;;GAOG;AACH,8BAAsB,aAAa;;IAGjC;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK;IAI3C;;;;;;OAMG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK;IAI9B;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK;IAInC;;;;;;OAMG;IACH,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK;IAItC;;;;;;;;;;OAUG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM;IAI/B;;;;;;;;;;OAUG;IACH,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK;IAQhC;;;;;OAKG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAIxB;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAI/B;;;;;;OAMG;IACH,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK;IAM1B;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM;IAIpC;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK;IAQ1C;;;;;OAKG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK;IAIvB;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,OAAO;IAInC;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO;CAOlE;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;;iBAIhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAA"}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import { PluginReferenceLineApi } from "./referenceLine";
|
|
1
2
|
import { PluginSpaceApi } from "./space";
|
|
2
3
|
import { PluginStoryApi } from "./story";
|
|
4
|
+
/**
|
|
5
|
+
* CRUD operations on Snaptrude building entities.
|
|
6
|
+
*
|
|
7
|
+
* - {@linkcode PluginEntityApi.space} — Create, query, and delete spaces (rooms/masses)
|
|
8
|
+
* - {@linkcode PluginEntityApi.story} — Create, query, and update stories (floors)
|
|
9
|
+
* - {@linkcode PluginEntityApi.referenceLine} — Create, query, and delete reference lines
|
|
10
|
+
*/
|
|
3
11
|
export declare abstract class PluginEntityApi {
|
|
12
|
+
/** Space (room/mass) operations. See {@linkcode PluginSpaceApi}. */
|
|
4
13
|
abstract space: PluginSpaceApi;
|
|
14
|
+
/** Story (floor/storey) operations. See {@linkcode PluginStoryApi}. */
|
|
5
15
|
abstract story: PluginStoryApi;
|
|
16
|
+
/** Reference line operations. See {@linkcode PluginReferenceLineApi}. */
|
|
17
|
+
abstract referenceLine: PluginReferenceLineApi;
|
|
6
18
|
constructor();
|
|
7
19
|
}
|
|
20
|
+
export * from "./referenceLine";
|
|
8
21
|
export * from "./space";
|
|
9
22
|
export * from "./story";
|
|
10
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/entity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,8BAAsB,eAAe;IACnC,SAAgB,KAAK,EAAE,cAAc,CAAA;IACrC,SAAgB,KAAK,EAAE,cAAc,CAAA;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/entity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;;GAMG;AACH,8BAAsB,eAAe;IACnC,oEAAoE;IACpE,SAAgB,KAAK,EAAE,cAAc,CAAA;IACrC,uEAAuE;IACvE,SAAgB,KAAK,EAAE,cAAc,CAAA;IACrC,yEAAyE;IACzE,SAAgB,aAAa,EAAE,sBAAsB,CAAA;;CAGtD;AAED,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Reference line management — create, query, and delete reference lines.
|
|
5
|
+
*
|
|
6
|
+
* A **reference line** is a 2D guide line (or arc) in the Snaptrude scene,
|
|
7
|
+
* typically used for grid lines and alignment guides. Reference lines
|
|
8
|
+
* carry properties such as grid tags, labels, and line styles.
|
|
9
|
+
*
|
|
10
|
+
* All methods are **host API calls** that return Promises and support
|
|
11
|
+
* undo/redo via Snaptrude's command system.
|
|
12
|
+
*
|
|
13
|
+
* Accessed via `snaptrude.entity.referenceLine`.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class PluginReferenceLineApi {
|
|
16
|
+
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Create multiple reference lines from a profile.
|
|
19
|
+
*
|
|
20
|
+
* Each {@linkcode PCurve} in the given {@linkcode PProfile} becomes
|
|
21
|
+
* a separate reference line. Uses `ReferenceLineConstructor.createFromProfile`
|
|
22
|
+
* internally.
|
|
23
|
+
*
|
|
24
|
+
* @param args - An object containing:
|
|
25
|
+
* - {@linkcode PluginReferenceLineCreateMultiArgs.profile args.profile} — A
|
|
26
|
+
* {@linkcode PProfile} whose curves define the reference lines to create
|
|
27
|
+
* @returns A {@linkcode PluginReferenceLineCreateMultiResult} with the
|
|
28
|
+
* `referenceLineIds` of the created reference lines
|
|
29
|
+
* @throws If reference line creation fails
|
|
30
|
+
*
|
|
31
|
+
* # Example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const { vec3 } = snaptrude.core.math
|
|
34
|
+
*
|
|
35
|
+
* const l1 = snaptrude.core.geom.line.new(vec3.new(0, 0, 0), vec3.new(10, 0, 0))
|
|
36
|
+
* const l2 = snaptrude.core.geom.line.new(vec3.new(10, 0, 0), vec3.new(10, 0, 10))
|
|
37
|
+
* const profile = snaptrude.core.geom.profile.new([l1, l2])
|
|
38
|
+
*
|
|
39
|
+
* const { referenceLineIds } = await snaptrude.entity.referenceLine.createMulti({
|
|
40
|
+
* profile,
|
|
41
|
+
* })
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
abstract createMulti(args: PluginReferenceLineCreateMultiArgs): PluginApiReturn<PluginReferenceLineCreateMultiResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Get properties of a reference line by its ID.
|
|
47
|
+
*
|
|
48
|
+
* Only the properties listed in {@linkcode PluginReferenceLineGetArgs.properties
|
|
49
|
+
* args.properties} are returned — unlisted properties will be `undefined`
|
|
50
|
+
* in the result.
|
|
51
|
+
*
|
|
52
|
+
* @param args - An object containing:
|
|
53
|
+
* - {@linkcode PluginReferenceLineGetArgs.referenceLineId args.referenceLineId} —
|
|
54
|
+
* The unique reference line ID
|
|
55
|
+
* - {@linkcode PluginReferenceLineGetArgs.properties args.properties} — Array of
|
|
56
|
+
* property names to retrieve. See {@linkcode PluginReferenceLineGetProperty}.
|
|
57
|
+
* @returns A partial {@linkcode PluginReferenceLineGetResult} containing only the
|
|
58
|
+
* requested properties
|
|
59
|
+
* @throws If the reference line does not exist
|
|
60
|
+
*
|
|
61
|
+
* # Example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const result = await snaptrude.entity.referenceLine.get({
|
|
64
|
+
* referenceLineId: "some-ref-line-id",
|
|
65
|
+
* properties: ["curve"],
|
|
66
|
+
* })
|
|
67
|
+
* console.log(result.curve) // PCurve
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
abstract get(args: PluginReferenceLineGetArgs): PluginApiReturn<PluginReferenceLineGetResult>;
|
|
71
|
+
/**
|
|
72
|
+
* Get the IDs of all reference lines in the current project.
|
|
73
|
+
*
|
|
74
|
+
* Returns every reference line across all stories.
|
|
75
|
+
* Use the returned IDs with {@linkcode PluginReferenceLineApi.get} to query
|
|
76
|
+
* individual reference line properties.
|
|
77
|
+
*
|
|
78
|
+
* @returns A {@linkcode PluginReferenceLineGetAllResult} with a
|
|
79
|
+
* `referenceLineIds` array
|
|
80
|
+
*
|
|
81
|
+
* # Example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const { referenceLineIds } = await snaptrude.entity.referenceLine.getAll()
|
|
84
|
+
* console.log(`Project has ${referenceLineIds.length} reference lines`)
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
abstract getAll(): PluginApiReturn<PluginReferenceLineGetAllResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Delete a reference line by its ID.
|
|
90
|
+
*
|
|
91
|
+
* Permanently removes the reference line and its associated mesh from
|
|
92
|
+
* the scene. This operation is undoable via Snaptrude's command system.
|
|
93
|
+
*
|
|
94
|
+
* @param args - An object containing:
|
|
95
|
+
* - {@linkcode PluginReferenceLineDeleteArgs.referenceLineId args.referenceLineId} —
|
|
96
|
+
* The unique reference line ID to delete
|
|
97
|
+
* @throws If the reference line does not exist
|
|
98
|
+
*
|
|
99
|
+
* # Example
|
|
100
|
+
* ```ts
|
|
101
|
+
* await snaptrude.entity.referenceLine.delete({
|
|
102
|
+
* referenceLineId: "some-ref-line-id",
|
|
103
|
+
* })
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
abstract delete(args: PluginReferenceLineDeleteArgs): PluginApiReturn<PluginReferenceLineDeleteResult>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Arguments for {@linkcode PluginReferenceLineApi.createMulti}.
|
|
110
|
+
*
|
|
111
|
+
* | Property | Type | Description |
|
|
112
|
+
* |---|---|---|
|
|
113
|
+
* | `profile` | {@linkcode PProfile} | Profile whose curves define reference lines |
|
|
114
|
+
*/
|
|
115
|
+
export declare const PluginReferenceLineCreateMultiArgs: z.ZodObject<{
|
|
116
|
+
profile: z.ZodObject<{
|
|
117
|
+
curves: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
118
|
+
curveType: z.ZodLiteral<"Line">;
|
|
119
|
+
startPoint: z.ZodObject<{
|
|
120
|
+
x: z.ZodNumber;
|
|
121
|
+
y: z.ZodNumber;
|
|
122
|
+
z: z.ZodNumber;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
endPoint: z.ZodObject<{
|
|
125
|
+
x: z.ZodNumber;
|
|
126
|
+
y: z.ZodNumber;
|
|
127
|
+
z: z.ZodNumber;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
curveType: z.ZodLiteral<"Arc">;
|
|
131
|
+
startPoint: z.ZodObject<{
|
|
132
|
+
x: z.ZodNumber;
|
|
133
|
+
y: z.ZodNumber;
|
|
134
|
+
z: z.ZodNumber;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
endPoint: z.ZodObject<{
|
|
137
|
+
x: z.ZodNumber;
|
|
138
|
+
y: z.ZodNumber;
|
|
139
|
+
z: z.ZodNumber;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
centrePoint: z.ZodObject<{
|
|
142
|
+
x: z.ZodNumber;
|
|
143
|
+
y: z.ZodNumber;
|
|
144
|
+
z: z.ZodNumber;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
axis: z.ZodObject<{
|
|
147
|
+
x: z.ZodNumber;
|
|
148
|
+
y: z.ZodNumber;
|
|
149
|
+
z: z.ZodNumber;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
}, z.core.$strip>], "curveType">>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
export type PluginReferenceLineCreateMultiArgs = z.infer<typeof PluginReferenceLineCreateMultiArgs>;
|
|
155
|
+
/**
|
|
156
|
+
* Result of {@linkcode PluginReferenceLineApi.createMulti}.
|
|
157
|
+
*
|
|
158
|
+
* | Property | Type | Description |
|
|
159
|
+
* |---|---|---|
|
|
160
|
+
* | `referenceLineIds` | `string[]` | IDs of the created reference lines |
|
|
161
|
+
*/
|
|
162
|
+
export declare const PluginReferenceLineCreateMultiResult: z.ZodObject<{
|
|
163
|
+
referenceLineIds: z.ZodArray<z.ZodString>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
export type PluginReferenceLineCreateMultiResult = z.infer<typeof PluginReferenceLineCreateMultiResult>;
|
|
166
|
+
/**
|
|
167
|
+
* Available properties that can be queried on a reference line.
|
|
168
|
+
*
|
|
169
|
+
* | Value | Return Type | Description |
|
|
170
|
+
* |---|---|---|
|
|
171
|
+
* | `"curve"` | {@linkcode PCurve} | The curve geometry of the reference line |
|
|
172
|
+
*/
|
|
173
|
+
export declare const PluginReferenceLineGetProperty: z.ZodEnum<{
|
|
174
|
+
curve: "curve";
|
|
175
|
+
}>;
|
|
176
|
+
/**
|
|
177
|
+
* Arguments for {@linkcode PluginReferenceLineApi.get}.
|
|
178
|
+
*
|
|
179
|
+
* | Property | Type | Description |
|
|
180
|
+
* |---|---|---|
|
|
181
|
+
* | `referenceLineId` | `string` | The reference line ID to query |
|
|
182
|
+
* | `properties` | {@linkcode PluginReferenceLineGetProperty}`[]` | Properties to retrieve |
|
|
183
|
+
*/
|
|
184
|
+
export declare const PluginReferenceLineGetArgs: z.ZodObject<{
|
|
185
|
+
referenceLineId: z.ZodString;
|
|
186
|
+
properties: z.ZodArray<z.ZodEnum<{
|
|
187
|
+
curve: "curve";
|
|
188
|
+
}>>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
export type PluginReferenceLineGetArgs = z.infer<typeof PluginReferenceLineGetArgs>;
|
|
191
|
+
/**
|
|
192
|
+
* Result of {@linkcode PluginReferenceLineApi.get}.
|
|
193
|
+
*
|
|
194
|
+
* A partial object — only the properties that were requested in
|
|
195
|
+
* {@linkcode PluginReferenceLineGetArgs.properties} will be present.
|
|
196
|
+
*/
|
|
197
|
+
export declare const PluginReferenceLineGetResult: z.ZodObject<{
|
|
198
|
+
curve: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
199
|
+
curveType: z.ZodLiteral<"Line">;
|
|
200
|
+
startPoint: z.ZodObject<{
|
|
201
|
+
x: z.ZodNumber;
|
|
202
|
+
y: z.ZodNumber;
|
|
203
|
+
z: z.ZodNumber;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
endPoint: z.ZodObject<{
|
|
206
|
+
x: z.ZodNumber;
|
|
207
|
+
y: z.ZodNumber;
|
|
208
|
+
z: z.ZodNumber;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
211
|
+
curveType: z.ZodLiteral<"Arc">;
|
|
212
|
+
startPoint: z.ZodObject<{
|
|
213
|
+
x: z.ZodNumber;
|
|
214
|
+
y: z.ZodNumber;
|
|
215
|
+
z: z.ZodNumber;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
endPoint: z.ZodObject<{
|
|
218
|
+
x: z.ZodNumber;
|
|
219
|
+
y: z.ZodNumber;
|
|
220
|
+
z: z.ZodNumber;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
centrePoint: z.ZodObject<{
|
|
223
|
+
x: z.ZodNumber;
|
|
224
|
+
y: z.ZodNumber;
|
|
225
|
+
z: z.ZodNumber;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
axis: z.ZodObject<{
|
|
228
|
+
x: z.ZodNumber;
|
|
229
|
+
y: z.ZodNumber;
|
|
230
|
+
z: z.ZodNumber;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
}, z.core.$strip>], "curveType">>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
export type PluginReferenceLineGetResult = z.infer<typeof PluginReferenceLineGetResult>;
|
|
235
|
+
/**
|
|
236
|
+
* Result of {@linkcode PluginReferenceLineApi.getAll}.
|
|
237
|
+
*
|
|
238
|
+
* | Property | Type | Description |
|
|
239
|
+
* |---|---|---|
|
|
240
|
+
* | `referenceLineIds` | `string[]` | IDs of all reference lines in the project |
|
|
241
|
+
*/
|
|
242
|
+
export declare const PluginReferenceLineGetAllResult: z.ZodObject<{
|
|
243
|
+
referenceLineIds: z.ZodArray<z.ZodString>;
|
|
244
|
+
}, z.core.$strip>;
|
|
245
|
+
export type PluginReferenceLineGetAllResult = z.infer<typeof PluginReferenceLineGetAllResult>;
|
|
246
|
+
/**
|
|
247
|
+
* Arguments for {@linkcode PluginReferenceLineApi.delete}.
|
|
248
|
+
*
|
|
249
|
+
* | Property | Type | Description |
|
|
250
|
+
* |---|---|---|
|
|
251
|
+
* | `referenceLineId` | `string` | The reference line ID to delete |
|
|
252
|
+
*/
|
|
253
|
+
export declare const PluginReferenceLineDeleteArgs: z.ZodObject<{
|
|
254
|
+
referenceLineId: z.ZodString;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
export type PluginReferenceLineDeleteArgs = z.infer<typeof PluginReferenceLineDeleteArgs>;
|
|
257
|
+
/** Result type for {@linkcode PluginReferenceLineApi.delete} — returns nothing on success. */
|
|
258
|
+
export type PluginReferenceLineDeleteResult = void;
|
|
259
|
+
//# sourceMappingURL=referenceLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceLine.d.ts","sourceRoot":"","sources":["../../../src/api/entity/referenceLine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAI7C;;;;;;;;;;;GAWG;AACH,8BAAsB,sBAAsB;;IAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;aACa,WAAW,CACzB,IAAI,EAAE,kCAAkC,GACvC,eAAe,CAAC,oCAAoC,CAAC;IAExD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,GAAG,CACjB,IAAI,EAAE,0BAA0B,GAC/B,eAAe,CAAC,4BAA4B,CAAC;IAEhD;;;;;;;;;;;;;;;OAeG;aACa,MAAM,IAAI,eAAe,CAAC,+BAA+B,CAAC;IAE1E;;;;;;;;;;;;;;;;;OAiBG;aACa,MAAM,CACpB,IAAI,EAAE,6BAA6B,GAClC,eAAe,CAAC,+BAA+B,CAAC;CACpD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE7C,CAAA;AAEF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEnG;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;iBAE/C,CAAA;AAEF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAA;AAEvG;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;EAEzC,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;iBAGrC,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI7B,CAAA;AAEZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;iBAE1C,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B;;iBAExC,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEzF,8FAA8F;AAC9F,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAA"}
|