@snaptrude/plugin-core 0.0.3 → 0.0.5
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 +32 -0
- package/dist/api/core/geom/arc.d.ts.map +1 -0
- package/dist/api/core/geom/curve.d.ts +45 -0
- package/dist/api/core/geom/curve.d.ts.map +1 -0
- package/dist/api/core/geom/index.d.ts +16 -0
- package/dist/api/core/geom/index.d.ts.map +1 -0
- package/dist/api/core/geom/line.d.ts +22 -0
- package/dist/api/core/geom/line.d.ts.map +1 -0
- package/dist/api/core/geom/profile.d.ts +57 -0
- package/dist/api/core/geom/profile.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +10 -0
- package/dist/api/core/index.d.ts.map +1 -0
- package/dist/api/core/math/index.d.ts +10 -0
- package/dist/api/core/math/index.d.ts.map +1 -0
- package/dist/api/core/math/quat.d.ts +46 -0
- package/dist/api/core/math/quat.d.ts.map +1 -0
- package/dist/api/core/math/vec3.d.ts +39 -0
- package/dist/api/core/math/vec3.d.ts.map +1 -0
- package/dist/api/entity/index.d.ts +3 -0
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +137 -21
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +73 -0
- package/dist/api/entity/story.d.ts.map +1 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/tools/selection.d.ts +6 -4
- package/dist/api/tools/selection.d.ts.map +1 -1
- package/dist/api/tools/transform.d.ts +25 -10
- package/dist/api/tools/transform.d.ts.map +1 -1
- package/dist/api/units/index.d.ts +95 -0
- package/dist/api/units/index.d.ts.map +1 -0
- package/dist/index.cjs +547 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +493 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -1
- package/src/api/core/geom/arc.ts +21 -0
- package/src/api/core/geom/curve.ts +16 -0
- package/src/api/core/geom/index.ts +18 -0
- package/src/api/core/geom/line.ts +19 -0
- package/src/api/core/geom/profile.ts +30 -0
- package/src/api/core/index.ts +12 -0
- package/src/api/core/math/index.ts +12 -0
- package/src/api/core/math/quat.ts +154 -0
- package/src/api/core/math/vec3.ts +97 -0
- package/src/api/entity/index.ts +3 -0
- package/src/api/entity/space.ts +88 -26
- package/src/api/entity/story.ts +96 -0
- package/src/api/index.ts +6 -0
- package/src/api/tools/selection.ts +7 -4
- package/src/api/tools/transform.ts +16 -10
- package/src/api/units/index.ts +95 -0
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,25 +17,480 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
21
31
|
var index_exports = {};
|
|
22
32
|
__export(index_exports, {
|
|
33
|
+
PArc: () => PArc,
|
|
34
|
+
PCurve: () => PCurve,
|
|
35
|
+
PLine: () => PLine,
|
|
36
|
+
PProfile: () => PProfile,
|
|
37
|
+
PQuat: () => PQuat,
|
|
38
|
+
PUnitType: () => PUnitType,
|
|
39
|
+
PVec3: () => PVec3,
|
|
23
40
|
PluginApi: () => PluginApi,
|
|
41
|
+
PluginArcApi: () => PluginArcApi,
|
|
42
|
+
PluginCoreApi: () => PluginCoreApi,
|
|
43
|
+
PluginCurveApi: () => PluginCurveApi,
|
|
24
44
|
PluginEntityApi: () => PluginEntityApi,
|
|
45
|
+
PluginGeomApi: () => PluginGeomApi,
|
|
46
|
+
PluginLineApi: () => PluginLineApi,
|
|
47
|
+
PluginMathApi: () => PluginMathApi,
|
|
48
|
+
PluginMoveArgs: () => PluginMoveArgs,
|
|
49
|
+
PluginProfileApi: () => PluginProfileApi,
|
|
50
|
+
PluginProfileFromLinePointsArgs: () => PluginProfileFromLinePointsArgs,
|
|
51
|
+
PluginQuatApi: () => PluginQuatApi,
|
|
52
|
+
PluginRotateArgs: () => PluginRotateArgs,
|
|
25
53
|
PluginSelectionApi: () => PluginSelectionApi,
|
|
54
|
+
PluginSelectionGetResult: () => PluginSelectionGetResult,
|
|
26
55
|
PluginSpaceApi: () => PluginSpaceApi,
|
|
56
|
+
PluginSpaceCreateFromProfileArgs: () => PluginSpaceCreateFromProfileArgs,
|
|
57
|
+
PluginSpaceCreateFromProfileResult: () => PluginSpaceCreateFromProfileResult,
|
|
58
|
+
PluginSpaceCreateRectangularArgs: () => PluginSpaceCreateRectangularArgs,
|
|
59
|
+
PluginSpaceCreateRectangularResult: () => PluginSpaceCreateRectangularResult,
|
|
60
|
+
PluginSpaceDeleteByIdArgs: () => PluginSpaceDeleteByIdArgs,
|
|
61
|
+
PluginSpaceGetAllResult: () => PluginSpaceGetAllResult,
|
|
62
|
+
PluginSpaceGetArgs: () => PluginSpaceGetArgs,
|
|
63
|
+
PluginSpaceGetProperty: () => PluginSpaceGetProperty,
|
|
64
|
+
PluginSpaceGetResult: () => PluginSpaceGetResult,
|
|
65
|
+
PluginStoryApi: () => PluginStoryApi,
|
|
66
|
+
PluginStoryCreateArgs: () => PluginStoryCreateArgs,
|
|
67
|
+
PluginStoryCreateResult: () => PluginStoryCreateResult,
|
|
68
|
+
PluginStoryGetAllResult: () => PluginStoryGetAllResult,
|
|
69
|
+
PluginStoryGetArgs: () => PluginStoryGetArgs,
|
|
70
|
+
PluginStoryGetProperty: () => PluginStoryGetProperty,
|
|
71
|
+
PluginStoryGetResult: () => PluginStoryGetResult,
|
|
72
|
+
PluginStoryUpdateArgs: () => PluginStoryUpdateArgs,
|
|
73
|
+
PluginStoryUpdateResult: () => PluginStoryUpdateResult,
|
|
27
74
|
PluginToolsApi: () => PluginToolsApi,
|
|
28
|
-
PluginTransformApi: () => PluginTransformApi
|
|
75
|
+
PluginTransformApi: () => PluginTransformApi,
|
|
76
|
+
PluginUnitsApi: () => PluginUnitsApi,
|
|
77
|
+
PluginUnitsConvertFromArgs: () => PluginUnitsConvertFromArgs,
|
|
78
|
+
PluginUnitsConvertFromResult: () => PluginUnitsConvertFromResult,
|
|
79
|
+
PluginUnitsConvertToArgs: () => PluginUnitsConvertToArgs,
|
|
80
|
+
PluginUnitsConvertToResult: () => PluginUnitsConvertToResult,
|
|
81
|
+
PluginVec3Api: () => PluginVec3Api
|
|
29
82
|
});
|
|
30
83
|
module.exports = __toCommonJS(index_exports);
|
|
31
84
|
|
|
85
|
+
// src/api/core/math/vec3.ts
|
|
86
|
+
var z = __toESM(require("zod"), 1);
|
|
87
|
+
var PluginVec3Api = class {
|
|
88
|
+
constructor() {
|
|
89
|
+
}
|
|
90
|
+
/** Create a new PVec3. */
|
|
91
|
+
new(x, y, z12) {
|
|
92
|
+
return { x, y, z: z12 };
|
|
93
|
+
}
|
|
94
|
+
/** Add two vectors. */
|
|
95
|
+
add(a, b) {
|
|
96
|
+
return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z };
|
|
97
|
+
}
|
|
98
|
+
/** Subtract b from a. */
|
|
99
|
+
subtract(a, b) {
|
|
100
|
+
return { x: a.x - b.x, y: a.y - b.y, z: a.z - b.z };
|
|
101
|
+
}
|
|
102
|
+
/** Scale a vector by a scalar. */
|
|
103
|
+
scale(v, scalar) {
|
|
104
|
+
return { x: v.x * scalar, y: v.y * scalar, z: v.z * scalar };
|
|
105
|
+
}
|
|
106
|
+
/** Dot product of two vectors. */
|
|
107
|
+
dot(a, b) {
|
|
108
|
+
return a.x * b.x + a.y * b.y + a.z * b.z;
|
|
109
|
+
}
|
|
110
|
+
/** Cross product of two vectors. */
|
|
111
|
+
cross(a, b) {
|
|
112
|
+
return {
|
|
113
|
+
x: a.y * b.z - a.z * b.y,
|
|
114
|
+
y: a.z * b.x - a.x * b.z,
|
|
115
|
+
z: a.x * b.y - a.y * b.x
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** Length (magnitude) of a vector. */
|
|
119
|
+
length(v) {
|
|
120
|
+
return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
|
|
121
|
+
}
|
|
122
|
+
/** Squared length of a vector (avoids sqrt). */
|
|
123
|
+
lengthSquared(v) {
|
|
124
|
+
return v.x * v.x + v.y * v.y + v.z * v.z;
|
|
125
|
+
}
|
|
126
|
+
/** Normalize a vector to unit length. Returns zero vector if length is 0. */
|
|
127
|
+
normalize(v) {
|
|
128
|
+
const len = this.length(v);
|
|
129
|
+
if (len === 0) return { x: 0, y: 0, z: 0 };
|
|
130
|
+
return { x: v.x / len, y: v.y / len, z: v.z / len };
|
|
131
|
+
}
|
|
132
|
+
/** Distance between two points. */
|
|
133
|
+
distance(a, b) {
|
|
134
|
+
return this.length(this.subtract(a, b));
|
|
135
|
+
}
|
|
136
|
+
/** Linearly interpolate between two vectors. */
|
|
137
|
+
lerp(a, b, t) {
|
|
138
|
+
return {
|
|
139
|
+
x: a.x + (b.x - a.x) * t,
|
|
140
|
+
y: a.y + (b.y - a.y) * t,
|
|
141
|
+
z: a.z + (b.z - a.z) * t
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/** Negate a vector. */
|
|
145
|
+
negate(v) {
|
|
146
|
+
return { x: -v.x, y: -v.y, z: -v.z };
|
|
147
|
+
}
|
|
148
|
+
/** Check if two vectors are equal (exact). */
|
|
149
|
+
equals(a, b) {
|
|
150
|
+
return a.x === b.x && a.y === b.y && a.z === b.z;
|
|
151
|
+
}
|
|
152
|
+
/** Check if two vectors are approximately equal within an epsilon. */
|
|
153
|
+
equalsApprox(a, b, epsilon = 1e-6) {
|
|
154
|
+
return Math.abs(a.x - b.x) < epsilon && Math.abs(a.y - b.y) < epsilon && Math.abs(a.z - b.z) < epsilon;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
var PVec3 = z.object({
|
|
158
|
+
x: z.number(),
|
|
159
|
+
y: z.number(),
|
|
160
|
+
z: z.number()
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// src/api/core/math/quat.ts
|
|
164
|
+
var z2 = __toESM(require("zod"), 1);
|
|
165
|
+
var PluginQuatApi = class {
|
|
166
|
+
constructor() {
|
|
167
|
+
}
|
|
168
|
+
/** Create a new PQuat. */
|
|
169
|
+
new(x, y, z12, w) {
|
|
170
|
+
return { x, y, z: z12, w };
|
|
171
|
+
}
|
|
172
|
+
/** Create an identity quaternion (no rotation). */
|
|
173
|
+
identity() {
|
|
174
|
+
return { x: 0, y: 0, z: 0, w: 1 };
|
|
175
|
+
}
|
|
176
|
+
/** Create a quaternion from an axis and angle (radians). */
|
|
177
|
+
fromAxisAngle(axis, angle) {
|
|
178
|
+
const halfAngle = angle / 2;
|
|
179
|
+
const s = Math.sin(halfAngle);
|
|
180
|
+
const len = Math.sqrt(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z);
|
|
181
|
+
if (len === 0) return { x: 0, y: 0, z: 0, w: 1 };
|
|
182
|
+
return {
|
|
183
|
+
x: axis.x / len * s,
|
|
184
|
+
y: axis.y / len * s,
|
|
185
|
+
z: axis.z / len * s,
|
|
186
|
+
w: Math.cos(halfAngle)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/** Create a quaternion from Euler angles (radians, XYZ order). */
|
|
190
|
+
fromEuler(x, y, z12) {
|
|
191
|
+
const cx = Math.cos(x / 2);
|
|
192
|
+
const sx = Math.sin(x / 2);
|
|
193
|
+
const cy = Math.cos(y / 2);
|
|
194
|
+
const sy = Math.sin(y / 2);
|
|
195
|
+
const cz = Math.cos(z12 / 2);
|
|
196
|
+
const sz = Math.sin(z12 / 2);
|
|
197
|
+
return {
|
|
198
|
+
x: sx * cy * cz + cx * sy * sz,
|
|
199
|
+
y: cx * sy * cz - sx * cy * sz,
|
|
200
|
+
z: cx * cy * sz + sx * sy * cz,
|
|
201
|
+
w: cx * cy * cz - sx * sy * sz
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/** Multiply two quaternions (a * b). */
|
|
205
|
+
multiply(a, b) {
|
|
206
|
+
return {
|
|
207
|
+
x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,
|
|
208
|
+
y: a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,
|
|
209
|
+
z: a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w,
|
|
210
|
+
w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
/** Conjugate of a quaternion. */
|
|
214
|
+
conjugate(q) {
|
|
215
|
+
return { x: -q.x, y: -q.y, z: -q.z, w: q.w };
|
|
216
|
+
}
|
|
217
|
+
/** Length (magnitude) of a quaternion. */
|
|
218
|
+
length(q) {
|
|
219
|
+
return Math.sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w);
|
|
220
|
+
}
|
|
221
|
+
/** Normalize a quaternion to unit length. Returns identity if length is 0. */
|
|
222
|
+
normalize(q) {
|
|
223
|
+
const len = this.length(q);
|
|
224
|
+
if (len === 0) return { x: 0, y: 0, z: 0, w: 1 };
|
|
225
|
+
return { x: q.x / len, y: q.y / len, z: q.z / len, w: q.w / len };
|
|
226
|
+
}
|
|
227
|
+
/** Inverse of a quaternion (conjugate / lengthSquared). */
|
|
228
|
+
inverse(q) {
|
|
229
|
+
const lenSq = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w;
|
|
230
|
+
if (lenSq === 0) return { x: 0, y: 0, z: 0, w: 1 };
|
|
231
|
+
return { x: -q.x / lenSq, y: -q.y / lenSq, z: -q.z / lenSq, w: q.w / lenSq };
|
|
232
|
+
}
|
|
233
|
+
/** Rotate a vector by a quaternion. */
|
|
234
|
+
rotateVec3(q, v) {
|
|
235
|
+
const vq = { x: v.x, y: v.y, z: v.z, w: 0 };
|
|
236
|
+
const conj = this.conjugate(q);
|
|
237
|
+
const result = this.multiply(this.multiply(q, vq), conj);
|
|
238
|
+
return { x: result.x, y: result.y, z: result.z };
|
|
239
|
+
}
|
|
240
|
+
/** Convert a quaternion to axis-angle representation. */
|
|
241
|
+
toAxisAngle(q) {
|
|
242
|
+
const nq = this.normalize(q);
|
|
243
|
+
const angle = 2 * Math.acos(Math.min(1, Math.max(-1, nq.w)));
|
|
244
|
+
const s = Math.sin(angle / 2);
|
|
245
|
+
if (s < 1e-6) {
|
|
246
|
+
return { axis: { x: 1, y: 0, z: 0 }, angle: 0 };
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
axis: { x: nq.x / s, y: nq.y / s, z: nq.z / s },
|
|
250
|
+
angle
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/** Spherical linear interpolation between two quaternions. */
|
|
254
|
+
slerp(a, b, t) {
|
|
255
|
+
let cosHalf = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
|
|
256
|
+
let bx = b.x, by = b.y, bz = b.z, bw = b.w;
|
|
257
|
+
if (cosHalf < 0) {
|
|
258
|
+
cosHalf = -cosHalf;
|
|
259
|
+
bx = -bx;
|
|
260
|
+
by = -by;
|
|
261
|
+
bz = -bz;
|
|
262
|
+
bw = -bw;
|
|
263
|
+
}
|
|
264
|
+
if (cosHalf >= 1) {
|
|
265
|
+
return { x: a.x, y: a.y, z: a.z, w: a.w };
|
|
266
|
+
}
|
|
267
|
+
const halfAngle = Math.acos(cosHalf);
|
|
268
|
+
const sinHalf = Math.sin(halfAngle);
|
|
269
|
+
const ratioA = Math.sin((1 - t) * halfAngle) / sinHalf;
|
|
270
|
+
const ratioB = Math.sin(t * halfAngle) / sinHalf;
|
|
271
|
+
return {
|
|
272
|
+
x: a.x * ratioA + bx * ratioB,
|
|
273
|
+
y: a.y * ratioA + by * ratioB,
|
|
274
|
+
z: a.z * ratioA + bz * ratioB,
|
|
275
|
+
w: a.w * ratioA + bw * ratioB
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
/** Dot product of two quaternions. */
|
|
279
|
+
dot(a, b) {
|
|
280
|
+
return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
|
|
281
|
+
}
|
|
282
|
+
/** Check if two quaternions are equal (exact). */
|
|
283
|
+
equals(a, b) {
|
|
284
|
+
return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w;
|
|
285
|
+
}
|
|
286
|
+
/** Check if two quaternions are approximately equal within an epsilon. */
|
|
287
|
+
equalsApprox(a, b, epsilon = 1e-6) {
|
|
288
|
+
return Math.abs(a.x - b.x) < epsilon && Math.abs(a.y - b.y) < epsilon && Math.abs(a.z - b.z) < epsilon && Math.abs(a.w - b.w) < epsilon;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
var PQuat = z2.object({
|
|
292
|
+
x: z2.number(),
|
|
293
|
+
y: z2.number(),
|
|
294
|
+
z: z2.number(),
|
|
295
|
+
w: z2.number()
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// src/api/core/math/index.ts
|
|
299
|
+
var PluginMathApi = class {
|
|
300
|
+
constructor() {
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// src/api/core/geom/line.ts
|
|
305
|
+
var z3 = __toESM(require("zod"), 1);
|
|
306
|
+
var PluginLineApi = class {
|
|
307
|
+
constructor() {
|
|
308
|
+
}
|
|
309
|
+
/** Create a new PLine from start and end points. */
|
|
310
|
+
new(startPoint, endPoint) {
|
|
311
|
+
return { curveType: "Line", startPoint, endPoint };
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
var PLine = z3.object({
|
|
315
|
+
curveType: z3.literal("Line"),
|
|
316
|
+
startPoint: PVec3,
|
|
317
|
+
endPoint: PVec3
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
// src/api/core/geom/arc.ts
|
|
321
|
+
var z4 = __toESM(require("zod"), 1);
|
|
322
|
+
var PluginArcApi = class {
|
|
323
|
+
constructor() {
|
|
324
|
+
}
|
|
325
|
+
/** Create a new PArc from start, end, centre and axis. */
|
|
326
|
+
new(startPoint, endPoint, centrePoint, axis) {
|
|
327
|
+
return { curveType: "Arc", startPoint, endPoint, centrePoint, axis };
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
var PArc = z4.object({
|
|
331
|
+
curveType: z4.literal("Arc"),
|
|
332
|
+
startPoint: PVec3,
|
|
333
|
+
endPoint: PVec3,
|
|
334
|
+
centrePoint: PVec3,
|
|
335
|
+
axis: PVec3
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
// src/api/core/geom/curve.ts
|
|
339
|
+
var z5 = __toESM(require("zod"), 1);
|
|
340
|
+
var PluginCurveApi = class {
|
|
341
|
+
constructor() {
|
|
342
|
+
}
|
|
343
|
+
/** Create a PCurve from a PLine or PArc. */
|
|
344
|
+
new(curve) {
|
|
345
|
+
return curve;
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
var PCurve = z5.discriminatedUnion("curveType", [PLine, PArc]);
|
|
349
|
+
|
|
350
|
+
// src/api/core/geom/profile.ts
|
|
351
|
+
var z6 = __toESM(require("zod"), 1);
|
|
352
|
+
var PluginProfileApi = class {
|
|
353
|
+
constructor() {
|
|
354
|
+
}
|
|
355
|
+
/** Create a new PProfile from an array of PCurves. */
|
|
356
|
+
new(curves) {
|
|
357
|
+
return { curves };
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
var PluginProfileFromLinePointsArgs = z6.object({
|
|
361
|
+
points: z6.array(PVec3)
|
|
362
|
+
});
|
|
363
|
+
var PProfile = z6.object({
|
|
364
|
+
curves: z6.array(PCurve)
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
// src/api/core/geom/index.ts
|
|
368
|
+
var PluginGeomApi = class {
|
|
369
|
+
constructor() {
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
// src/api/core/index.ts
|
|
374
|
+
var PluginCoreApi = class {
|
|
375
|
+
constructor() {
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
|
|
32
379
|
// src/api/entity/space.ts
|
|
380
|
+
var z7 = __toESM(require("zod"), 1);
|
|
33
381
|
var PluginSpaceApi = class {
|
|
34
382
|
constructor() {
|
|
35
383
|
}
|
|
36
384
|
};
|
|
385
|
+
var PluginSpaceCreateRectangularArgs = z7.object({
|
|
386
|
+
position: PVec3,
|
|
387
|
+
dimensions: z7.object({
|
|
388
|
+
width: z7.number(),
|
|
389
|
+
height: z7.number(),
|
|
390
|
+
depth: z7.number()
|
|
391
|
+
})
|
|
392
|
+
});
|
|
393
|
+
var PluginSpaceCreateRectangularResult = z7.object({
|
|
394
|
+
spaceId: z7.string()
|
|
395
|
+
});
|
|
396
|
+
var PluginSpaceCreateFromProfileArgs = z7.object({
|
|
397
|
+
profile: PProfile,
|
|
398
|
+
extrudeHeight: z7.number(),
|
|
399
|
+
position: PVec3
|
|
400
|
+
});
|
|
401
|
+
var PluginSpaceCreateFromProfileResult = z7.object({
|
|
402
|
+
spaceId: z7.string()
|
|
403
|
+
});
|
|
404
|
+
var PluginSpaceGetProperty = z7.enum([
|
|
405
|
+
"id",
|
|
406
|
+
"type",
|
|
407
|
+
"room_type",
|
|
408
|
+
"name",
|
|
409
|
+
"area",
|
|
410
|
+
"department",
|
|
411
|
+
"position",
|
|
412
|
+
"absolutePosition",
|
|
413
|
+
"rotation",
|
|
414
|
+
"rotationQuaternion"
|
|
415
|
+
]);
|
|
416
|
+
var PluginSpaceGetArgs = z7.object({
|
|
417
|
+
spaceId: z7.string(),
|
|
418
|
+
properties: z7.array(PluginSpaceGetProperty)
|
|
419
|
+
});
|
|
420
|
+
var PluginSpaceGetResult = z7.object({
|
|
421
|
+
id: z7.string(),
|
|
422
|
+
type: z7.string(),
|
|
423
|
+
room_type: z7.string(),
|
|
424
|
+
name: z7.string(),
|
|
425
|
+
area: z7.number(),
|
|
426
|
+
department: z7.string(),
|
|
427
|
+
position: PVec3,
|
|
428
|
+
absolutePosition: PVec3,
|
|
429
|
+
rotation: PVec3,
|
|
430
|
+
rotationQuaternion: PQuat.nullable()
|
|
431
|
+
}).partial();
|
|
432
|
+
var PluginSpaceGetAllResult = z7.object({
|
|
433
|
+
spacesIds: z7.array(z7.string())
|
|
434
|
+
});
|
|
435
|
+
var PluginSpaceDeleteByIdArgs = z7.object({
|
|
436
|
+
spaceId: z7.string()
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
// src/api/entity/story.ts
|
|
440
|
+
var z8 = __toESM(require("zod"), 1);
|
|
441
|
+
var PluginStoryApi = class {
|
|
442
|
+
constructor() {
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
var PluginStoryGetProperty = z8.enum([
|
|
446
|
+
"value",
|
|
447
|
+
"id",
|
|
448
|
+
"name",
|
|
449
|
+
"height",
|
|
450
|
+
"base",
|
|
451
|
+
"hidden",
|
|
452
|
+
"spacesCount",
|
|
453
|
+
"totalArea"
|
|
454
|
+
]);
|
|
455
|
+
var PluginStoryGetArgs = z8.object({
|
|
456
|
+
storyValue: z8.number().int(),
|
|
457
|
+
properties: z8.array(PluginStoryGetProperty)
|
|
458
|
+
});
|
|
459
|
+
var PluginStoryGetResult = z8.object({
|
|
460
|
+
value: z8.number(),
|
|
461
|
+
id: z8.string(),
|
|
462
|
+
name: z8.string(),
|
|
463
|
+
height: z8.number(),
|
|
464
|
+
base: z8.number(),
|
|
465
|
+
hidden: z8.boolean(),
|
|
466
|
+
spacesCount: z8.number(),
|
|
467
|
+
totalArea: z8.number()
|
|
468
|
+
}).partial();
|
|
469
|
+
var PluginStoryGetAllResult = z8.object({
|
|
470
|
+
stories: z8.array(
|
|
471
|
+
z8.object({
|
|
472
|
+
value: z8.number(),
|
|
473
|
+
id: z8.string(),
|
|
474
|
+
name: z8.string()
|
|
475
|
+
})
|
|
476
|
+
)
|
|
477
|
+
});
|
|
478
|
+
var PluginStoryCreateArgs = z8.object({
|
|
479
|
+
storyValue: z8.number().int(),
|
|
480
|
+
height: z8.number().optional()
|
|
481
|
+
});
|
|
482
|
+
var PluginStoryCreateResult = z8.object({
|
|
483
|
+
storyId: z8.string(),
|
|
484
|
+
storyValue: z8.number()
|
|
485
|
+
});
|
|
486
|
+
var PluginStoryUpdateArgs = z8.object({
|
|
487
|
+
storyValue: z8.number().int(),
|
|
488
|
+
height: z8.number()
|
|
489
|
+
});
|
|
490
|
+
var PluginStoryUpdateResult = z8.object({
|
|
491
|
+
storyValue: z8.number(),
|
|
492
|
+
height: z8.number()
|
|
493
|
+
});
|
|
37
494
|
|
|
38
495
|
// src/api/entity/index.ts
|
|
39
496
|
var PluginEntityApi = class {
|
|
@@ -42,16 +499,31 @@ var PluginEntityApi = class {
|
|
|
42
499
|
};
|
|
43
500
|
|
|
44
501
|
// src/api/tools/selection.ts
|
|
502
|
+
var z9 = __toESM(require("zod"), 1);
|
|
45
503
|
var PluginSelectionApi = class {
|
|
46
504
|
constructor() {
|
|
47
505
|
}
|
|
48
506
|
};
|
|
507
|
+
var PluginSelectionGetResult = z9.object({
|
|
508
|
+
selected: z9.array(z9.string())
|
|
509
|
+
});
|
|
49
510
|
|
|
50
511
|
// src/api/tools/transform.ts
|
|
512
|
+
var z10 = __toESM(require("zod"), 1);
|
|
51
513
|
var PluginTransformApi = class {
|
|
52
514
|
constructor() {
|
|
53
515
|
}
|
|
54
516
|
};
|
|
517
|
+
var PluginMoveArgs = z10.object({
|
|
518
|
+
componentIds: z10.array(z10.string()),
|
|
519
|
+
displacement: PVec3
|
|
520
|
+
});
|
|
521
|
+
var PluginRotateArgs = z10.object({
|
|
522
|
+
componentIds: z10.array(z10.string()),
|
|
523
|
+
angle: z10.number(),
|
|
524
|
+
axis: PVec3,
|
|
525
|
+
pivot: PVec3
|
|
526
|
+
});
|
|
55
527
|
|
|
56
528
|
// src/api/tools/index.ts
|
|
57
529
|
var PluginToolsApi = class {
|
|
@@ -59,6 +531,36 @@ var PluginToolsApi = class {
|
|
|
59
531
|
}
|
|
60
532
|
};
|
|
61
533
|
|
|
534
|
+
// src/api/units/index.ts
|
|
535
|
+
var z11 = __toESM(require("zod"), 1);
|
|
536
|
+
var PluginUnitsApi = class {
|
|
537
|
+
constructor() {
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
var PUnitType = z11.enum([
|
|
541
|
+
"meters",
|
|
542
|
+
"feet-inches",
|
|
543
|
+
"inches",
|
|
544
|
+
"centimeters",
|
|
545
|
+
"millimeters",
|
|
546
|
+
"kilometers",
|
|
547
|
+
"miles"
|
|
548
|
+
]);
|
|
549
|
+
var PluginUnitsConvertFromArgs = z11.object({
|
|
550
|
+
unit: PUnitType,
|
|
551
|
+
value: z11.number()
|
|
552
|
+
});
|
|
553
|
+
var PluginUnitsConvertFromResult = z11.object({
|
|
554
|
+
value: z11.number()
|
|
555
|
+
});
|
|
556
|
+
var PluginUnitsConvertToArgs = z11.object({
|
|
557
|
+
unit: PUnitType,
|
|
558
|
+
value: z11.number()
|
|
559
|
+
});
|
|
560
|
+
var PluginUnitsConvertToResult = z11.object({
|
|
561
|
+
value: z11.number()
|
|
562
|
+
});
|
|
563
|
+
|
|
62
564
|
// src/api/index.ts
|
|
63
565
|
var PluginApi = class {
|
|
64
566
|
constructor() {
|
|
@@ -66,11 +568,54 @@ var PluginApi = class {
|
|
|
66
568
|
};
|
|
67
569
|
// Annotate the CommonJS export names for ESM import in node:
|
|
68
570
|
0 && (module.exports = {
|
|
571
|
+
PArc,
|
|
572
|
+
PCurve,
|
|
573
|
+
PLine,
|
|
574
|
+
PProfile,
|
|
575
|
+
PQuat,
|
|
576
|
+
PUnitType,
|
|
577
|
+
PVec3,
|
|
69
578
|
PluginApi,
|
|
579
|
+
PluginArcApi,
|
|
580
|
+
PluginCoreApi,
|
|
581
|
+
PluginCurveApi,
|
|
70
582
|
PluginEntityApi,
|
|
583
|
+
PluginGeomApi,
|
|
584
|
+
PluginLineApi,
|
|
585
|
+
PluginMathApi,
|
|
586
|
+
PluginMoveArgs,
|
|
587
|
+
PluginProfileApi,
|
|
588
|
+
PluginProfileFromLinePointsArgs,
|
|
589
|
+
PluginQuatApi,
|
|
590
|
+
PluginRotateArgs,
|
|
71
591
|
PluginSelectionApi,
|
|
592
|
+
PluginSelectionGetResult,
|
|
72
593
|
PluginSpaceApi,
|
|
594
|
+
PluginSpaceCreateFromProfileArgs,
|
|
595
|
+
PluginSpaceCreateFromProfileResult,
|
|
596
|
+
PluginSpaceCreateRectangularArgs,
|
|
597
|
+
PluginSpaceCreateRectangularResult,
|
|
598
|
+
PluginSpaceDeleteByIdArgs,
|
|
599
|
+
PluginSpaceGetAllResult,
|
|
600
|
+
PluginSpaceGetArgs,
|
|
601
|
+
PluginSpaceGetProperty,
|
|
602
|
+
PluginSpaceGetResult,
|
|
603
|
+
PluginStoryApi,
|
|
604
|
+
PluginStoryCreateArgs,
|
|
605
|
+
PluginStoryCreateResult,
|
|
606
|
+
PluginStoryGetAllResult,
|
|
607
|
+
PluginStoryGetArgs,
|
|
608
|
+
PluginStoryGetProperty,
|
|
609
|
+
PluginStoryGetResult,
|
|
610
|
+
PluginStoryUpdateArgs,
|
|
611
|
+
PluginStoryUpdateResult,
|
|
73
612
|
PluginToolsApi,
|
|
74
|
-
PluginTransformApi
|
|
613
|
+
PluginTransformApi,
|
|
614
|
+
PluginUnitsApi,
|
|
615
|
+
PluginUnitsConvertFromArgs,
|
|
616
|
+
PluginUnitsConvertFromResult,
|
|
617
|
+
PluginUnitsConvertToArgs,
|
|
618
|
+
PluginUnitsConvertToResult,
|
|
619
|
+
PluginVec3Api
|
|
75
620
|
});
|
|
76
621
|
//# sourceMappingURL=index.cjs.map
|