@snaptrude/plugin-core 0.2.3 → 0.2.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/CHANGELOG.md +12 -0
- package/dist/api/entity/space.d.ts +61 -10
- package/dist/api/entity/space.d.ts.map +1 -1
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @snaptrude/plugin-core
|
|
2
2
|
|
|
3
|
+
## 0.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Restore declaration files in published plugin packages.
|
|
8
|
+
|
|
9
|
+
## 0.2.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Add inner profile hole support to space creation from profiles.
|
|
14
|
+
|
|
3
15
|
## 0.2.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -44,18 +44,22 @@ export declare abstract class PluginSpaceApi {
|
|
|
44
44
|
/**
|
|
45
45
|
* Create a space by extruding a 2D profile.
|
|
46
46
|
*
|
|
47
|
-
* The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is
|
|
48
|
-
* upward (along the Y axis) by
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
47
|
+
* The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is used as
|
|
48
|
+
* the outer boundary and extruded upward (along the Y axis) by
|
|
49
|
+
* {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight extrudeHeight},
|
|
50
|
+
* then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position
|
|
51
|
+
* position}. Optional {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles
|
|
52
|
+
* innerProfiles} are used as holes inside the outer boundary. The created
|
|
53
|
+
* space is automatically assigned to the active story and a default department.
|
|
52
54
|
*
|
|
53
55
|
* Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile
|
|
54
56
|
* from a list of points.
|
|
55
57
|
*
|
|
56
58
|
* @param args - An object containing:
|
|
57
59
|
* - {@linkcode PluginSpaceCreateFromProfileArgs.profile args.profile} — A closed
|
|
58
|
-
* {@linkcode PProfile} defining the floor shape
|
|
60
|
+
* {@linkcode PProfile} defining the outer floor shape
|
|
61
|
+
* - {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles args.innerProfiles} —
|
|
62
|
+
* Optional closed {@linkcode PProfile}`[]` loops to subtract as holes
|
|
59
63
|
* - {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight args.extrudeHeight} —
|
|
60
64
|
* Extrusion height in Babylon units
|
|
61
65
|
* - {@linkcode PluginSpaceCreateFromProfileArgs.position args.position} — Offset
|
|
@@ -68,7 +72,7 @@ export declare abstract class PluginSpaceApi {
|
|
|
68
72
|
* ```ts
|
|
69
73
|
* const { vec3 } = snaptrude.core.math
|
|
70
74
|
*
|
|
71
|
-
* const
|
|
75
|
+
* const outerProfile = await snaptrude.core.geom.profile.fromLinePoints({
|
|
72
76
|
* points: [
|
|
73
77
|
* vec3.new(0, 0, 0),
|
|
74
78
|
* vec3.new(10, 0, 0),
|
|
@@ -76,15 +80,24 @@ export declare abstract class PluginSpaceApi {
|
|
|
76
80
|
* vec3.new(0, 0, 8),
|
|
77
81
|
* ],
|
|
78
82
|
* })
|
|
83
|
+
* const holeProfile = await snaptrude.core.geom.profile.fromLinePoints({
|
|
84
|
+
* points: [
|
|
85
|
+
* vec3.new(3, 0, 3),
|
|
86
|
+
* vec3.new(7, 0, 3),
|
|
87
|
+
* vec3.new(7, 0, 5),
|
|
88
|
+
* vec3.new(3, 0, 5),
|
|
89
|
+
* ],
|
|
90
|
+
* })
|
|
79
91
|
*
|
|
80
92
|
* const { spaceId } = await snaptrude.entity.space.createFromProfile({
|
|
81
|
-
* profile,
|
|
93
|
+
* profile: outerProfile,
|
|
94
|
+
* innerProfiles: [holeProfile],
|
|
82
95
|
* extrudeHeight: 3,
|
|
83
96
|
* position: vec3.new(0, 0, 0),
|
|
84
97
|
* })
|
|
85
98
|
* ```
|
|
86
99
|
*/
|
|
87
|
-
abstract createFromProfile({ profile, extrudeHeight, position, }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>;
|
|
100
|
+
abstract createFromProfile({ profile, innerProfiles, extrudeHeight, position, }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>;
|
|
88
101
|
/**
|
|
89
102
|
* Update a space's BRep and mesh geometry by extruding a 2D profile.
|
|
90
103
|
*
|
|
@@ -261,7 +274,8 @@ export type PluginSpaceCreateRectangularResult = z.infer<typeof PluginSpaceCreat
|
|
|
261
274
|
*
|
|
262
275
|
* | Property | Type | Description |
|
|
263
276
|
* |---|---|---|
|
|
264
|
-
* | `profile` | {@linkcode PProfile} | Closed 2D profile defining the floor shape |
|
|
277
|
+
* | `profile` | {@linkcode PProfile} | Closed 2D profile defining the outer floor shape |
|
|
278
|
+
* | `innerProfiles` | {@linkcode PProfile}`[]` | Optional closed profiles to subtract as holes |
|
|
265
279
|
* | `extrudeHeight` | `number` | Extrusion height in Babylon units |
|
|
266
280
|
* | `position` | {@linkcode PVec3} | Offset position in Babylon units |
|
|
267
281
|
*/
|
|
@@ -303,6 +317,43 @@ export declare const PluginSpaceCreateFromProfileArgs: z.ZodObject<{
|
|
|
303
317
|
}, z.core.$strip>;
|
|
304
318
|
}, z.core.$strip>], "curveType">>;
|
|
305
319
|
}, z.core.$strip>;
|
|
320
|
+
innerProfiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
321
|
+
curves: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
322
|
+
curveType: z.ZodLiteral<"Line">;
|
|
323
|
+
startPoint: z.ZodObject<{
|
|
324
|
+
x: z.ZodNumber;
|
|
325
|
+
y: z.ZodNumber;
|
|
326
|
+
z: z.ZodNumber;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
endPoint: z.ZodObject<{
|
|
329
|
+
x: z.ZodNumber;
|
|
330
|
+
y: z.ZodNumber;
|
|
331
|
+
z: z.ZodNumber;
|
|
332
|
+
}, z.core.$strip>;
|
|
333
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
334
|
+
curveType: z.ZodLiteral<"Arc">;
|
|
335
|
+
startPoint: z.ZodObject<{
|
|
336
|
+
x: z.ZodNumber;
|
|
337
|
+
y: z.ZodNumber;
|
|
338
|
+
z: z.ZodNumber;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
endPoint: z.ZodObject<{
|
|
341
|
+
x: z.ZodNumber;
|
|
342
|
+
y: z.ZodNumber;
|
|
343
|
+
z: z.ZodNumber;
|
|
344
|
+
}, z.core.$strip>;
|
|
345
|
+
centrePoint: z.ZodObject<{
|
|
346
|
+
x: z.ZodNumber;
|
|
347
|
+
y: z.ZodNumber;
|
|
348
|
+
z: z.ZodNumber;
|
|
349
|
+
}, z.core.$strip>;
|
|
350
|
+
axis: z.ZodObject<{
|
|
351
|
+
x: z.ZodNumber;
|
|
352
|
+
y: z.ZodNumber;
|
|
353
|
+
z: z.ZodNumber;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
}, z.core.$strip>], "curveType">>;
|
|
356
|
+
}, z.core.$strip>>>;
|
|
306
357
|
extrudeHeight: z.ZodNumber;
|
|
307
358
|
position: z.ZodObject<{
|
|
308
359
|
x: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAK7C;;;;;;;;;;;GAWG;AACH,8BAAsB,cAA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