@snaptrude/plugin-core 0.2.3 → 0.2.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/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/entity/space.ts +28 -14
- package/dist/api/core/geom/arc.d.ts +0 -81
- package/dist/api/core/geom/arc.d.ts.map +0 -1
- package/dist/api/core/geom/curve.d.ts +0 -70
- package/dist/api/core/geom/curve.d.ts.map +0 -1
- package/dist/api/core/geom/index.d.ts +0 -32
- package/dist/api/core/geom/index.d.ts.map +0 -1
- package/dist/api/core/geom/line.d.ts +0 -56
- package/dist/api/core/geom/line.d.ts.map +0 -1
- package/dist/api/core/geom/profile.d.ts +0 -121
- package/dist/api/core/geom/profile.d.ts.map +0 -1
- package/dist/api/core/index.d.ts +0 -18
- package/dist/api/core/index.d.ts.map +0 -1
- package/dist/api/core/math/index.d.ts +0 -18
- package/dist/api/core/math/index.d.ts.map +0 -1
- package/dist/api/core/math/quat.d.ts +0 -187
- package/dist/api/core/math/quat.d.ts.map +0 -1
- package/dist/api/core/math/vec3.d.ts +0 -156
- package/dist/api/core/math/vec3.d.ts.map +0 -1
- package/dist/api/entity/buildableEnvelope.d.ts +0 -233
- package/dist/api/entity/buildableEnvelope.d.ts.map +0 -1
- package/dist/api/entity/department.d.ts +0 -99
- package/dist/api/entity/department.d.ts.map +0 -1
- package/dist/api/entity/index.d.ts +0 -33
- package/dist/api/entity/index.d.ts.map +0 -1
- package/dist/api/entity/referenceLine.d.ts +0 -259
- package/dist/api/entity/referenceLine.d.ts.map +0 -1
- package/dist/api/entity/space.d.ts +0 -765
- package/dist/api/entity/space.d.ts.map +0 -1
- package/dist/api/entity/story.d.ts +0 -239
- package/dist/api/entity/story.d.ts.map +0 -1
- package/dist/api/index.d.ts +0 -30
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/tools/copy.d.ts +0 -59
- package/dist/api/tools/copy.d.ts.map +0 -1
- package/dist/api/tools/index.d.ts +0 -29
- package/dist/api/tools/index.d.ts.map +0 -1
- package/dist/api/tools/offset.d.ts +0 -43
- package/dist/api/tools/offset.d.ts.map +0 -1
- package/dist/api/tools/selection.d.ts +0 -48
- package/dist/api/tools/selection.d.ts.map +0 -1
- package/dist/api/tools/transform.d.ts +0 -114
- package/dist/api/tools/transform.d.ts.map +0 -1
- package/dist/api/units/index.d.ts +0 -163
- package/dist/api/units/index.d.ts.map +0 -1
- package/dist/host-utils.d.ts +0 -41
- package/dist/host-utils.d.ts.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -16
- package/dist/types.d.ts.map +0 -1
package/src/api/entity/space.ts
CHANGED
|
@@ -53,18 +53,22 @@ export abstract class PluginSpaceApi {
|
|
|
53
53
|
/**
|
|
54
54
|
* Create a space by extruding a 2D profile.
|
|
55
55
|
*
|
|
56
|
-
* The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is
|
|
57
|
-
* upward (along the Y axis) by
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
56
|
+
* The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is used as
|
|
57
|
+
* the outer boundary and extruded upward (along the Y axis) by
|
|
58
|
+
* {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight extrudeHeight},
|
|
59
|
+
* then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position
|
|
60
|
+
* position}. Optional {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles
|
|
61
|
+
* innerProfiles} are used as holes inside the outer boundary. The created
|
|
62
|
+
* space is automatically assigned to the active story and a default department.
|
|
61
63
|
*
|
|
62
64
|
* Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile
|
|
63
65
|
* from a list of points.
|
|
64
66
|
*
|
|
65
67
|
* @param args - An object containing:
|
|
66
68
|
* - {@linkcode PluginSpaceCreateFromProfileArgs.profile args.profile} — A closed
|
|
67
|
-
* {@linkcode PProfile} defining the floor shape
|
|
69
|
+
* {@linkcode PProfile} defining the outer floor shape
|
|
70
|
+
* - {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles args.innerProfiles} —
|
|
71
|
+
* Optional closed {@linkcode PProfile}`[]` loops to subtract as holes
|
|
68
72
|
* - {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight args.extrudeHeight} —
|
|
69
73
|
* Extrusion height in Babylon units
|
|
70
74
|
* - {@linkcode PluginSpaceCreateFromProfileArgs.position args.position} — Offset
|
|
@@ -77,7 +81,7 @@ export abstract class PluginSpaceApi {
|
|
|
77
81
|
* ```ts
|
|
78
82
|
* const { vec3 } = snaptrude.core.math
|
|
79
83
|
*
|
|
80
|
-
* const
|
|
84
|
+
* const outerProfile = await snaptrude.core.geom.profile.fromLinePoints({
|
|
81
85
|
* points: [
|
|
82
86
|
* vec3.new(0, 0, 0),
|
|
83
87
|
* vec3.new(10, 0, 0),
|
|
@@ -85,9 +89,18 @@ export abstract class PluginSpaceApi {
|
|
|
85
89
|
* vec3.new(0, 0, 8),
|
|
86
90
|
* ],
|
|
87
91
|
* })
|
|
92
|
+
* const holeProfile = await snaptrude.core.geom.profile.fromLinePoints({
|
|
93
|
+
* points: [
|
|
94
|
+
* vec3.new(3, 0, 3),
|
|
95
|
+
* vec3.new(7, 0, 3),
|
|
96
|
+
* vec3.new(7, 0, 5),
|
|
97
|
+
* vec3.new(3, 0, 5),
|
|
98
|
+
* ],
|
|
99
|
+
* })
|
|
88
100
|
*
|
|
89
101
|
* const { spaceId } = await snaptrude.entity.space.createFromProfile({
|
|
90
|
-
* profile,
|
|
102
|
+
* profile: outerProfile,
|
|
103
|
+
* innerProfiles: [holeProfile],
|
|
91
104
|
* extrudeHeight: 3,
|
|
92
105
|
* position: vec3.new(0, 0, 0),
|
|
93
106
|
* })
|
|
@@ -95,6 +108,7 @@ export abstract class PluginSpaceApi {
|
|
|
95
108
|
*/
|
|
96
109
|
public abstract createFromProfile({
|
|
97
110
|
profile,
|
|
111
|
+
innerProfiles,
|
|
98
112
|
extrudeHeight,
|
|
99
113
|
position,
|
|
100
114
|
}: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>
|
|
@@ -152,9 +166,7 @@ export abstract class PluginSpaceApi {
|
|
|
152
166
|
spaceId,
|
|
153
167
|
profile,
|
|
154
168
|
extrudeHeight,
|
|
155
|
-
}: PluginSpaceUpdateGeometryFromProfileArgs): PluginApiReturn<
|
|
156
|
-
PluginSpaceUpdateGeometryFromProfileResult
|
|
157
|
-
>
|
|
169
|
+
}: PluginSpaceUpdateGeometryFromProfileArgs): PluginApiReturn<PluginSpaceUpdateGeometryFromProfileResult>
|
|
158
170
|
|
|
159
171
|
/**
|
|
160
172
|
* Get the IDs of all spaces in the current project.
|
|
@@ -252,7 +264,7 @@ export abstract class PluginSpaceApi {
|
|
|
252
264
|
* ```
|
|
253
265
|
*/
|
|
254
266
|
public abstract update(
|
|
255
|
-
args: PluginSpaceUpdateArgs
|
|
267
|
+
args: PluginSpaceUpdateArgs,
|
|
256
268
|
): PluginApiReturn<PluginSpaceUpdateResult>
|
|
257
269
|
}
|
|
258
270
|
|
|
@@ -297,12 +309,14 @@ export type PluginSpaceCreateRectangularResult = z.infer<
|
|
|
297
309
|
*
|
|
298
310
|
* | Property | Type | Description |
|
|
299
311
|
* |---|---|---|
|
|
300
|
-
* | `profile` | {@linkcode PProfile} | Closed 2D profile defining the floor shape |
|
|
312
|
+
* | `profile` | {@linkcode PProfile} | Closed 2D profile defining the outer floor shape |
|
|
313
|
+
* | `innerProfiles` | {@linkcode PProfile}`[]` | Optional closed profiles to subtract as holes |
|
|
301
314
|
* | `extrudeHeight` | `number` | Extrusion height in Babylon units |
|
|
302
315
|
* | `position` | {@linkcode PVec3} | Offset position in Babylon units |
|
|
303
316
|
*/
|
|
304
317
|
export const PluginSpaceCreateFromProfileArgs = z.object({
|
|
305
318
|
profile: PProfile,
|
|
319
|
+
innerProfiles: z.array(PProfile).optional(),
|
|
306
320
|
extrudeHeight: z.number(),
|
|
307
321
|
position: PVec3,
|
|
308
322
|
})
|
|
@@ -469,7 +483,7 @@ export const PluginSpaceType = z.enum([
|
|
|
469
483
|
"Pool",
|
|
470
484
|
"Walkway",
|
|
471
485
|
"Envelope",
|
|
472
|
-
"Parking"
|
|
486
|
+
"Parking",
|
|
473
487
|
])
|
|
474
488
|
|
|
475
489
|
/**
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { PVec3 } from "../math/vec3";
|
|
3
|
-
/**
|
|
4
|
-
* Arc construction.
|
|
5
|
-
*
|
|
6
|
-
* A {@linkcode PArc} represents a circular arc in 3D space, defined by
|
|
7
|
-
* start/end points, a centre, and a rotation axis. Arcs can be wrapped
|
|
8
|
-
* as a {@linkcode PCurve} and combined into a {@linkcode PProfile}.
|
|
9
|
-
*
|
|
10
|
-
* Accessed via `snaptrude.core.geom.arc`.
|
|
11
|
-
*/
|
|
12
|
-
export declare abstract class PluginArcApi {
|
|
13
|
-
constructor();
|
|
14
|
-
/**
|
|
15
|
-
* Create a new arc from start, end, centre, and axis.
|
|
16
|
-
*
|
|
17
|
-
* The arc sweeps from {@linkcode startPoint} to {@linkcode endPoint}
|
|
18
|
-
* along the circle centred at {@linkcode centrePoint}, in the
|
|
19
|
-
* direction determined by the right-hand rule around {@linkcode axis}.
|
|
20
|
-
*
|
|
21
|
-
* @param startPoint - The start point as a {@linkcode PVec3}
|
|
22
|
-
* @param endPoint - The end point as a {@linkcode PVec3}
|
|
23
|
-
* @param centrePoint - The centre of the arc's circle as a {@linkcode PVec3}
|
|
24
|
-
* @param axis - The arc's rotation axis as a {@linkcode PVec3}
|
|
25
|
-
* (perpendicular to the arc's plane)
|
|
26
|
-
* @returns A new {@linkcode PArc}
|
|
27
|
-
*
|
|
28
|
-
* # Example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const { vec3 } = snaptrude.core.math
|
|
31
|
-
* const { arc } = snaptrude.core.geom
|
|
32
|
-
*
|
|
33
|
-
* // Quarter-circle arc on the XZ plane
|
|
34
|
-
* const a = arc.new(
|
|
35
|
-
* vec3.new(1, 0, 0), // start
|
|
36
|
-
* vec3.new(0, 0, 1), // end
|
|
37
|
-
* vec3.new(0, 0, 0), // centre
|
|
38
|
-
* vec3.new(0, 1, 0), // Y-up axis
|
|
39
|
-
* )
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
new(startPoint: PVec3, endPoint: PVec3, centrePoint: PVec3, axis: PVec3): PArc;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A circular arc defined by start, end, centre, and axis.
|
|
46
|
-
*
|
|
47
|
-
* Discriminated by `curveType: "Arc"` within the {@linkcode PCurve} union.
|
|
48
|
-
*
|
|
49
|
-
* | Property | Type | Description |
|
|
50
|
-
* |---|---|---|
|
|
51
|
-
* | `curveType` | `"Arc"` | Discriminator tag |
|
|
52
|
-
* | `startPoint` | {@linkcode PVec3} | Start point of the arc |
|
|
53
|
-
* | `endPoint` | {@linkcode PVec3} | End point of the arc |
|
|
54
|
-
* | `centrePoint` | {@linkcode PVec3} | Centre of the arc's circle |
|
|
55
|
-
* | `axis` | {@linkcode PVec3} | Rotation axis (normal to the arc's plane) |
|
|
56
|
-
*/
|
|
57
|
-
export declare const PArc: z.ZodObject<{
|
|
58
|
-
curveType: z.ZodLiteral<"Arc">;
|
|
59
|
-
startPoint: z.ZodObject<{
|
|
60
|
-
x: z.ZodNumber;
|
|
61
|
-
y: z.ZodNumber;
|
|
62
|
-
z: z.ZodNumber;
|
|
63
|
-
}, z.core.$strip>;
|
|
64
|
-
endPoint: z.ZodObject<{
|
|
65
|
-
x: z.ZodNumber;
|
|
66
|
-
y: z.ZodNumber;
|
|
67
|
-
z: z.ZodNumber;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
centrePoint: z.ZodObject<{
|
|
70
|
-
x: z.ZodNumber;
|
|
71
|
-
y: z.ZodNumber;
|
|
72
|
-
z: z.ZodNumber;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
axis: z.ZodObject<{
|
|
75
|
-
x: z.ZodNumber;
|
|
76
|
-
y: z.ZodNumber;
|
|
77
|
-
z: z.ZodNumber;
|
|
78
|
-
}, z.core.$strip>;
|
|
79
|
-
}, z.core.$strip>;
|
|
80
|
-
export type PArc = z.infer<typeof PArc>;
|
|
81
|
-
//# sourceMappingURL=arc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arc.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/arc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEpC;;;;;;;;GAQG;AACH,8BAAsB,YAAY;;IAGhC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI;CAG/E;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;iBAMf,CAAA;AAEF,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAA"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { PLine } from "./line";
|
|
3
|
-
import { PArc } from "./arc";
|
|
4
|
-
/**
|
|
5
|
-
* Unified curve wrapper — either a {@linkcode PLine} or a {@linkcode PArc}.
|
|
6
|
-
*
|
|
7
|
-
* Use this to build heterogeneous curve lists (mixing lines and arcs)
|
|
8
|
-
* when constructing a {@linkcode PProfile}.
|
|
9
|
-
*
|
|
10
|
-
* Accessed via `snaptrude.core.geom.curve`.
|
|
11
|
-
*/
|
|
12
|
-
export declare abstract class PluginCurveApi {
|
|
13
|
-
constructor();
|
|
14
|
-
/**
|
|
15
|
-
* Wrap a {@linkcode PLine} or {@linkcode PArc} as a {@linkcode PCurve}.
|
|
16
|
-
*
|
|
17
|
-
* This is an identity operation — it simply returns the input unchanged.
|
|
18
|
-
* It exists for type-level clarity when building mixed curve lists.
|
|
19
|
-
*
|
|
20
|
-
* @param curve - A {@linkcode PLine} or {@linkcode PArc} to wrap
|
|
21
|
-
* @returns The same value typed as {@linkcode PCurve}
|
|
22
|
-
*/
|
|
23
|
-
new(curve: PLine | PArc): PCurve;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* A discriminated union of {@linkcode PLine} and {@linkcode PArc}.
|
|
27
|
-
*
|
|
28
|
-
* Discriminated on the `curveType` field:
|
|
29
|
-
* - `"Line"` → {@linkcode PLine}
|
|
30
|
-
* - `"Arc"` → {@linkcode PArc}
|
|
31
|
-
*
|
|
32
|
-
* Use `curve.curveType` to narrow the type in a switch or if-statement.
|
|
33
|
-
*/
|
|
34
|
-
export declare const PCurve: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
35
|
-
curveType: z.ZodLiteral<"Line">;
|
|
36
|
-
startPoint: z.ZodObject<{
|
|
37
|
-
x: z.ZodNumber;
|
|
38
|
-
y: z.ZodNumber;
|
|
39
|
-
z: z.ZodNumber;
|
|
40
|
-
}, z.core.$strip>;
|
|
41
|
-
endPoint: z.ZodObject<{
|
|
42
|
-
x: z.ZodNumber;
|
|
43
|
-
y: z.ZodNumber;
|
|
44
|
-
z: z.ZodNumber;
|
|
45
|
-
}, z.core.$strip>;
|
|
46
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
-
curveType: z.ZodLiteral<"Arc">;
|
|
48
|
-
startPoint: z.ZodObject<{
|
|
49
|
-
x: z.ZodNumber;
|
|
50
|
-
y: z.ZodNumber;
|
|
51
|
-
z: z.ZodNumber;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
endPoint: z.ZodObject<{
|
|
54
|
-
x: z.ZodNumber;
|
|
55
|
-
y: z.ZodNumber;
|
|
56
|
-
z: z.ZodNumber;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
centrePoint: z.ZodObject<{
|
|
59
|
-
x: z.ZodNumber;
|
|
60
|
-
y: z.ZodNumber;
|
|
61
|
-
z: z.ZodNumber;
|
|
62
|
-
}, z.core.$strip>;
|
|
63
|
-
axis: z.ZodObject<{
|
|
64
|
-
x: z.ZodNumber;
|
|
65
|
-
y: z.ZodNumber;
|
|
66
|
-
z: z.ZodNumber;
|
|
67
|
-
}, z.core.$strip>;
|
|
68
|
-
}, z.core.$strip>], "curveType">;
|
|
69
|
-
export type PCurve = z.infer<typeof PCurve>;
|
|
70
|
-
//# sourceMappingURL=curve.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/curve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAE5B;;;;;;;GAOG;AACH,8BAAsB,cAAc;;IAGlC;;;;;;;;OAQG;IACH,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,MAAM;CAGjC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAmD,CAAA;AAEtE,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { PluginLineApi } from "./line";
|
|
2
|
-
import { PluginArcApi } from "./arc";
|
|
3
|
-
import { PluginCurveApi } from "./curve";
|
|
4
|
-
import { PluginProfileApi } from "./profile";
|
|
5
|
-
/**
|
|
6
|
-
* Geometry primitives for constructing 2D/3D shapes.
|
|
7
|
-
*
|
|
8
|
-
* Build geometry bottom-up: points ({@linkcode PVec3}) → lines/arcs → curves → profiles.
|
|
9
|
-
* Profiles can then be used with entity creation methods like
|
|
10
|
-
* {@linkcode PluginSpaceApi.createFromProfile}.
|
|
11
|
-
*
|
|
12
|
-
* - {@linkcode PluginGeomApi.line} — Line segment construction
|
|
13
|
-
* - {@linkcode PluginGeomApi.arc} — Arc construction
|
|
14
|
-
* - {@linkcode PluginGeomApi.curve} — Unified curve wrapper (line or arc)
|
|
15
|
-
* - {@linkcode PluginGeomApi.profile} — Closed loop of curves
|
|
16
|
-
*/
|
|
17
|
-
export declare abstract class PluginGeomApi {
|
|
18
|
-
/** Line segment construction. See {@linkcode PluginLineApi}. */
|
|
19
|
-
abstract line: PluginLineApi;
|
|
20
|
-
/** Arc construction. See {@linkcode PluginArcApi}. */
|
|
21
|
-
abstract arc: PluginArcApi;
|
|
22
|
-
/** Unified curve wrapper. See {@linkcode PluginCurveApi}. */
|
|
23
|
-
abstract curve: PluginCurveApi;
|
|
24
|
-
/** Closed profile (loop of curves). See {@linkcode PluginProfileApi}. */
|
|
25
|
-
abstract profile: PluginProfileApi;
|
|
26
|
-
constructor();
|
|
27
|
-
}
|
|
28
|
-
export * from "./line";
|
|
29
|
-
export * from "./arc";
|
|
30
|
-
export * from "./curve";
|
|
31
|
-
export * from "./profile";
|
|
32
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C;;;;;;;;;;;GAWG;AACH,8BAAsB,aAAa;IACjC,gEAAgE;IAChE,SAAgB,IAAI,EAAE,aAAa,CAAA;IACnC,sDAAsD;IACtD,SAAgB,GAAG,EAAE,YAAY,CAAA;IACjC,6DAA6D;IAC7D,SAAgB,KAAK,EAAE,cAAc,CAAA;IACrC,yEAAyE;IACzE,SAAgB,OAAO,EAAE,gBAAgB,CAAA;;CAG1C;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { PVec3 } from "../math/vec3";
|
|
3
|
-
/**
|
|
4
|
-
* Line segment construction.
|
|
5
|
-
*
|
|
6
|
-
* A {@linkcode PLine} is the simplest curve primitive — a straight
|
|
7
|
-
* segment between two 3D points. Lines can be wrapped as a
|
|
8
|
-
* {@linkcode PCurve} and combined into a {@linkcode PProfile}.
|
|
9
|
-
*
|
|
10
|
-
* Accessed via `snaptrude.core.geom.line`.
|
|
11
|
-
*/
|
|
12
|
-
export declare abstract class PluginLineApi {
|
|
13
|
-
constructor();
|
|
14
|
-
/**
|
|
15
|
-
* Create a new line segment between two points.
|
|
16
|
-
*
|
|
17
|
-
* @param startPoint - The start point as a {@linkcode PVec3}
|
|
18
|
-
* @param endPoint - The end point as a {@linkcode PVec3}
|
|
19
|
-
* @returns A new {@linkcode PLine}
|
|
20
|
-
*
|
|
21
|
-
* # Example
|
|
22
|
-
* ```ts
|
|
23
|
-
* const { vec3 } = snaptrude.core.math
|
|
24
|
-
* const { line } = snaptrude.core.geom
|
|
25
|
-
*
|
|
26
|
-
* const edge = line.new(vec3.new(0, 0, 0), vec3.new(5, 0, 0))
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
new(startPoint: PVec3, endPoint: PVec3): PLine;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* A line segment defined by a start and end point.
|
|
33
|
-
*
|
|
34
|
-
* Discriminated by `curveType: "Line"` within the {@linkcode PCurve} union.
|
|
35
|
-
*
|
|
36
|
-
* | Property | Type | Description |
|
|
37
|
-
* |---|---|---|
|
|
38
|
-
* | `curveType` | `"Line"` | Discriminator tag |
|
|
39
|
-
* | `startPoint` | {@linkcode PVec3} | Start point of the segment |
|
|
40
|
-
* | `endPoint` | {@linkcode PVec3} | End point of the segment |
|
|
41
|
-
*/
|
|
42
|
-
export declare const PLine: z.ZodObject<{
|
|
43
|
-
curveType: z.ZodLiteral<"Line">;
|
|
44
|
-
startPoint: z.ZodObject<{
|
|
45
|
-
x: z.ZodNumber;
|
|
46
|
-
y: z.ZodNumber;
|
|
47
|
-
z: z.ZodNumber;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
endPoint: z.ZodObject<{
|
|
50
|
-
x: z.ZodNumber;
|
|
51
|
-
y: z.ZodNumber;
|
|
52
|
-
z: z.ZodNumber;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
export type PLine = z.infer<typeof PLine>;
|
|
56
|
-
//# sourceMappingURL=line.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEpC;;;;;;;;GAQG;AACH,8BAAsB,aAAa;;IAGjC;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,GAAG,KAAK;CAG/C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;iBAIhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAA"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { PluginApiReturn } from "../../../types";
|
|
3
|
-
import { PCurve } from "./curve";
|
|
4
|
-
/**
|
|
5
|
-
* Profile construction — a closed loop of {@linkcode PCurve}s.
|
|
6
|
-
*
|
|
7
|
-
* Profiles are the primary 2D shape primitive used for creating
|
|
8
|
-
* extruded entities like spaces. Build profiles either from an
|
|
9
|
-
* explicit list of curves or from a list of points (auto-connected
|
|
10
|
-
* with line segments).
|
|
11
|
-
*
|
|
12
|
-
* Accessed via `snaptrude.core.geom.profile`.
|
|
13
|
-
*/
|
|
14
|
-
export declare abstract class PluginProfileApi {
|
|
15
|
-
constructor();
|
|
16
|
-
/**
|
|
17
|
-
* Create a profile from an ordered list of curves.
|
|
18
|
-
*
|
|
19
|
-
* The curves should form a closed loop — the end point of each curve
|
|
20
|
-
* should coincide with the start point of the next.
|
|
21
|
-
*
|
|
22
|
-
* @param curves - An ordered array of {@linkcode PCurve}s forming a closed loop
|
|
23
|
-
* @returns A new {@linkcode PProfile}
|
|
24
|
-
*/
|
|
25
|
-
new(curves: PCurve[]): PProfile;
|
|
26
|
-
/**
|
|
27
|
-
* Create a profile by connecting a list of points with line segments.
|
|
28
|
-
*
|
|
29
|
-
* The points are connected in order, with the last point automatically
|
|
30
|
-
* connected back to the first to close the loop.
|
|
31
|
-
*
|
|
32
|
-
* This is a **host API call** — it returns a `Promise`.
|
|
33
|
-
*
|
|
34
|
-
* @param args - An object containing:
|
|
35
|
-
* - {@linkcode PluginProfileFromLinePointsArgs.points args.points} — An ordered
|
|
36
|
-
* array of {@linkcode PVec3} forming the profile vertices
|
|
37
|
-
* @returns A {@linkcode PProfile} with line-segment curves connecting the points
|
|
38
|
-
*
|
|
39
|
-
* # Example
|
|
40
|
-
* ```ts
|
|
41
|
-
* const { vec3 } = snaptrude.core.math
|
|
42
|
-
*
|
|
43
|
-
* // Create an L-shaped profile
|
|
44
|
-
* const profile = await snaptrude.core.geom.profile.fromLinePoints({
|
|
45
|
-
* points: [
|
|
46
|
-
* vec3.new(0, 0, 0),
|
|
47
|
-
* vec3.new(10, 0, 0),
|
|
48
|
-
* vec3.new(10, 0, 5),
|
|
49
|
-
* vec3.new(5, 0, 5),
|
|
50
|
-
* vec3.new(5, 0, 10),
|
|
51
|
-
* vec3.new(0, 0, 10),
|
|
52
|
-
* ],
|
|
53
|
-
* })
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
abstract fromLinePoints(args: PluginProfileFromLinePointsArgs): PluginApiReturn<PProfile>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Arguments for {@linkcode PluginProfileApi.fromLinePoints}.
|
|
60
|
-
*
|
|
61
|
-
* | Property | Type | Description |
|
|
62
|
-
* |---|---|---|
|
|
63
|
-
* | `points` | {@linkcode PVec3}`[]` | Ordered vertices of the profile |
|
|
64
|
-
*/
|
|
65
|
-
export declare const PluginProfileFromLinePointsArgs: z.ZodObject<{
|
|
66
|
-
points: z.ZodArray<z.ZodObject<{
|
|
67
|
-
x: z.ZodNumber;
|
|
68
|
-
y: z.ZodNumber;
|
|
69
|
-
z: z.ZodNumber;
|
|
70
|
-
}, z.core.$strip>>;
|
|
71
|
-
}, z.core.$strip>;
|
|
72
|
-
export type PluginProfileFromLinePointsArgs = z.infer<typeof PluginProfileFromLinePointsArgs>;
|
|
73
|
-
/**
|
|
74
|
-
* A closed profile composed of an ordered list of curves.
|
|
75
|
-
*
|
|
76
|
-
* Profiles are used as input to entity creation methods like
|
|
77
|
-
* {@linkcode PluginSpaceApi.createFromProfile}.
|
|
78
|
-
*
|
|
79
|
-
* | Property | Type | Description |
|
|
80
|
-
* |---|---|---|
|
|
81
|
-
* | `curves` | {@linkcode PCurve}`[]` | Ordered curves forming a closed loop |
|
|
82
|
-
*/
|
|
83
|
-
export declare const PProfile: z.ZodObject<{
|
|
84
|
-
curves: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
85
|
-
curveType: z.ZodLiteral<"Line">;
|
|
86
|
-
startPoint: z.ZodObject<{
|
|
87
|
-
x: z.ZodNumber;
|
|
88
|
-
y: z.ZodNumber;
|
|
89
|
-
z: z.ZodNumber;
|
|
90
|
-
}, z.core.$strip>;
|
|
91
|
-
endPoint: z.ZodObject<{
|
|
92
|
-
x: z.ZodNumber;
|
|
93
|
-
y: z.ZodNumber;
|
|
94
|
-
z: z.ZodNumber;
|
|
95
|
-
}, z.core.$strip>;
|
|
96
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
-
curveType: z.ZodLiteral<"Arc">;
|
|
98
|
-
startPoint: z.ZodObject<{
|
|
99
|
-
x: z.ZodNumber;
|
|
100
|
-
y: z.ZodNumber;
|
|
101
|
-
z: z.ZodNumber;
|
|
102
|
-
}, z.core.$strip>;
|
|
103
|
-
endPoint: z.ZodObject<{
|
|
104
|
-
x: z.ZodNumber;
|
|
105
|
-
y: z.ZodNumber;
|
|
106
|
-
z: z.ZodNumber;
|
|
107
|
-
}, z.core.$strip>;
|
|
108
|
-
centrePoint: z.ZodObject<{
|
|
109
|
-
x: z.ZodNumber;
|
|
110
|
-
y: z.ZodNumber;
|
|
111
|
-
z: z.ZodNumber;
|
|
112
|
-
}, z.core.$strip>;
|
|
113
|
-
axis: z.ZodObject<{
|
|
114
|
-
x: z.ZodNumber;
|
|
115
|
-
y: z.ZodNumber;
|
|
116
|
-
z: z.ZodNumber;
|
|
117
|
-
}, z.core.$strip>;
|
|
118
|
-
}, z.core.$strip>], "curveType">>;
|
|
119
|
-
}, z.core.$strip>;
|
|
120
|
-
export type PProfile = z.infer<typeof PProfile>;
|
|
121
|
-
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC;;;;;;;;;GASG;AACH,8BAAsB,gBAAgB;;IAGpC;;;;;;;;OAQG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ;IAI/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;aACa,cAAc,CAC5B,IAAI,EAAE,+BAA+B,GACpC,eAAe,CAAC,QAAQ,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;;;;;iBAE1C,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEnB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA"}
|
package/dist/api/core/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { PluginMathApi } from "./math";
|
|
2
|
-
import { PluginGeomApi } from "./geom";
|
|
3
|
-
/**
|
|
4
|
-
* Core primitives used across the plugin API.
|
|
5
|
-
*
|
|
6
|
-
* - {@linkcode PluginCoreApi.math} — Vector and quaternion operations
|
|
7
|
-
* - {@linkcode PluginCoreApi.geom} — Geometry primitives (lines, arcs, curves, profiles)
|
|
8
|
-
*/
|
|
9
|
-
export declare abstract class PluginCoreApi {
|
|
10
|
-
/** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */
|
|
11
|
-
abstract math: PluginMathApi;
|
|
12
|
-
/** Geometry primitives and constructors. See {@linkcode PluginGeomApi}. */
|
|
13
|
-
abstract geom: PluginGeomApi;
|
|
14
|
-
constructor();
|
|
15
|
-
}
|
|
16
|
-
export * from "./math";
|
|
17
|
-
export * from "./geom";
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC;;;;;GAKG;AACH,8BAAsB,aAAa;IACjC,2EAA2E;IAC3E,SAAgB,IAAI,EAAE,aAAa,CAAA;IACnC,2EAA2E;IAC3E,SAAgB,IAAI,EAAE,aAAa,CAAA;;CAGpC;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { PluginVec3Api } from "./vec3";
|
|
2
|
-
import { PluginQuatApi } from "./quat";
|
|
3
|
-
/**
|
|
4
|
-
* Math primitives for 3D vector and quaternion operations.
|
|
5
|
-
*
|
|
6
|
-
* - {@linkcode PluginMathApi.vec3} — 3D vector creation and arithmetic
|
|
7
|
-
* - {@linkcode PluginMathApi.quat} — Quaternion creation and rotation operations
|
|
8
|
-
*/
|
|
9
|
-
export declare abstract class PluginMathApi {
|
|
10
|
-
/** 3D vector operations. See {@linkcode PluginVec3Api}. */
|
|
11
|
-
abstract vec3: PluginVec3Api;
|
|
12
|
-
/** Quaternion operations. See {@linkcode PluginQuatApi}. */
|
|
13
|
-
abstract quat: PluginQuatApi;
|
|
14
|
-
constructor();
|
|
15
|
-
}
|
|
16
|
-
export * from "./vec3";
|
|
17
|
-
export * from "./quat";
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/math/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC;;;;;GAKG;AACH,8BAAsB,aAAa;IACjC,2DAA2D;IAC3D,SAAgB,IAAI,EAAE,aAAa,CAAA;IACnC,4DAA4D;IAC5D,SAAgB,IAAI,EAAE,aAAa,CAAA;;CAGpC;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
|