@snaptrude/plugin-core 0.2.9 → 0.5.0
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/AGENTS.md +128 -50
- package/CHANGELOG.md +52 -6
- package/api-manifest.full.json +3999 -0
- package/api-manifest.json +3845 -0
- package/dist/api/core/buildings.d.ts +427 -0
- package/dist/api/core/buildings.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +230 -0
- package/dist/api/core/comment/index.d.ts.map +1 -0
- package/dist/api/core/geom/create/index.d.ts +247 -0
- package/dist/api/core/geom/create/index.d.ts.map +1 -0
- package/dist/api/core/geom/delete/index.d.ts +72 -0
- package/dist/api/core/geom/delete/index.d.ts.map +1 -0
- package/dist/api/core/geom/index.d.ts +24 -23
- package/dist/api/core/geom/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +169 -0
- package/dist/api/core/geom/query/arc.d.ts.map +1 -0
- package/dist/api/core/geom/query/brep.d.ts +402 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -0
- package/dist/api/core/geom/query/circle.d.ts +378 -0
- package/dist/api/core/geom/query/circle.d.ts.map +1 -0
- package/dist/api/core/geom/query/contour.d.ts +450 -0
- package/dist/api/core/geom/query/contour.d.ts.map +1 -0
- package/dist/api/core/geom/query/curve.d.ts +918 -0
- package/dist/api/core/geom/query/curve.d.ts.map +1 -0
- package/dist/api/core/geom/query/edge.d.ts +128 -0
- package/dist/api/core/geom/query/edge.d.ts.map +1 -0
- package/dist/api/core/geom/query/face.d.ts +363 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -0
- package/dist/api/core/geom/query/halfedge.d.ts +206 -0
- package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
- package/dist/api/core/geom/query/index.d.ts +61 -0
- package/dist/api/core/geom/query/index.d.ts.map +1 -0
- package/dist/api/core/geom/query/profile.d.ts +410 -0
- package/dist/api/core/geom/query/profile.d.ts.map +1 -0
- package/dist/api/core/geom/query/vertex.d.ts +187 -0
- package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
- package/dist/api/core/geom/update/contour.d.ts +272 -0
- package/dist/api/core/geom/update/contour.d.ts.map +1 -0
- package/dist/api/core/geom/update/curve.d.ts +180 -0
- package/dist/api/core/geom/update/curve.d.ts.map +1 -0
- package/dist/api/core/geom/update/index.d.ts +27 -0
- package/dist/api/core/geom/update/index.d.ts.map +1 -0
- package/dist/api/core/geom/update/profile.d.ts +329 -0
- package/dist/api/core/geom/update/profile.d.ts.map +1 -0
- package/dist/api/core/groups.d.ts +485 -0
- package/dist/api/core/groups.d.ts.map +1 -0
- package/dist/api/core/history/index.d.ts +78 -0
- package/dist/api/core/history/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +46 -1
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +402 -0
- package/dist/api/core/layers.d.ts.map +1 -0
- package/dist/api/core/math/quat.d.ts +111 -128
- package/dist/api/core/math/quat.d.ts.map +1 -1
- package/dist/api/core/math/vec3.d.ts +120 -102
- package/dist/api/core/math/vec3.d.ts.map +1 -1
- package/dist/api/core/project/index.d.ts +399 -0
- package/dist/api/core/project/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +755 -0
- package/dist/api/core/tags.d.ts.map +1 -0
- package/dist/api/core/units/index.d.ts +175 -0
- package/dist/api/core/units/index.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +45 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +168 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +828 -0
- package/dist/api/design/create/index.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +63 -0
- package/dist/api/design/delete/index.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +268 -0
- package/dist/api/design/doors/index.d.ts.map +1 -0
- package/dist/api/design/edit/index.d.ts +49 -0
- package/dist/api/design/edit/index.d.ts.map +1 -0
- package/dist/api/design/erase/index.d.ts +160 -0
- package/dist/api/design/erase/index.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +123 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +153 -0
- package/dist/api/design/index.d.ts.map +1 -0
- package/dist/api/design/lock.d.ts +41 -0
- package/dist/api/design/lock.d.ts.map +1 -0
- package/dist/api/design/materials/index.d.ts +297 -0
- package/dist/api/design/materials/index.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +140 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +1011 -0
- package/dist/api/design/query/index.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +221 -0
- package/dist/api/design/query/spaces.d.ts.map +1 -0
- package/dist/api/design/selection/index.d.ts +138 -0
- package/dist/api/design/selection/index.d.ts.map +1 -0
- package/dist/api/design/shared.d.ts +38 -0
- package/dist/api/design/shared.d.ts.map +1 -0
- package/dist/api/design/transform/index.d.ts +87 -0
- package/dist/api/design/transform/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +178 -0
- package/dist/api/design/update/index.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +189 -0
- package/dist/api/design/windows/index.d.ts.map +1 -0
- package/dist/api/entity/buildableEnvelope.d.ts +51 -23
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/department.d.ts +0 -98
- package/dist/api/entity/department.d.ts.map +1 -1
- package/dist/api/entity/index.d.ts +4 -9
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +49 -106
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +76 -828
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +47 -37
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +17 -17
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +440 -0
- package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +81 -0
- package/dist/api/presentation/diagrams.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +113 -0
- package/dist/api/presentation/import.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +46 -0
- package/dist/api/presentation/index.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +176 -0
- package/dist/api/presentation/sheets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +296 -0
- package/dist/api/presentation/views.d.ts.map +1 -0
- package/dist/api/program/adjacency.d.ts +155 -0
- package/dist/api/program/adjacency.d.ts.map +1 -0
- package/dist/api/program/areas.d.ts +360 -0
- package/dist/api/program/areas.d.ts.map +1 -0
- package/dist/api/program/classification.d.ts +135 -0
- package/dist/api/program/classification.d.ts.map +1 -0
- package/dist/api/program/cores.d.ts +174 -0
- package/dist/api/program/cores.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +431 -0
- package/dist/api/program/departments.d.ts.map +1 -0
- package/dist/api/program/index.d.ts +69 -0
- package/dist/api/program/index.d.ts.map +1 -0
- package/dist/api/program/layout.d.ts +63 -0
- package/dist/api/program/layout.d.ts.map +1 -0
- package/dist/api/program/metrics.d.ts +108 -0
- package/dist/api/program/metrics.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +367 -0
- package/dist/api/program/site.d.ts.map +1 -0
- package/dist/api/program/spreadsheet.d.ts +2041 -0
- package/dist/api/program/spreadsheet.d.ts.map +1 -0
- package/dist/handles.d.ts +138 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/host-utils.d.ts +7 -5
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +3897 -1542
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3326 -1462
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/scripts/generate-manifest.mjs +193 -0
- package/scripts/generate-manifest.test.mjs +193 -0
- package/src/api/core/buildings.ts +485 -0
- package/src/api/core/comment/index.ts +258 -0
- package/src/api/core/geom/create/index.ts +293 -0
- package/src/api/core/geom/delete/index.ts +78 -0
- package/src/api/core/geom/index.ts +24 -23
- package/src/api/core/geom/query/arc.ts +169 -0
- package/src/api/core/geom/query/brep.ts +444 -0
- package/src/api/core/geom/query/circle.ts +404 -0
- package/src/api/core/geom/query/contour.ts +540 -0
- package/src/api/core/geom/query/curve.ts +1078 -0
- package/src/api/core/geom/query/edge.ts +130 -0
- package/src/api/core/geom/query/face.ts +403 -0
- package/src/api/core/geom/query/halfedge.ts +210 -0
- package/src/api/core/geom/query/index.ts +63 -0
- package/src/api/core/geom/query/profile.ts +473 -0
- package/src/api/core/geom/query/vertex.ts +205 -0
- package/src/api/core/geom/update/contour.ts +315 -0
- package/src/api/core/geom/update/curve.ts +209 -0
- package/src/api/core/geom/update/index.ts +29 -0
- package/src/api/core/geom/update/profile.ts +377 -0
- package/src/api/core/groups.ts +521 -0
- package/src/api/core/history/index.ts +84 -0
- package/src/api/core/index.ts +46 -1
- package/src/api/core/layers.ts +333 -0
- package/src/api/core/math/quat.ts +112 -235
- package/src/api/core/math/vec3.ts +124 -159
- package/src/api/core/project/index.ts +418 -0
- package/src/api/core/tags.ts +808 -0
- package/src/api/core/units/index.ts +164 -0
- package/src/api/core/zoom/index.ts +47 -0
- package/src/api/design/boolean/index.ts +179 -0
- package/src/api/design/create/index.ts +886 -0
- package/src/api/design/delete/index.ts +67 -0
- package/src/api/design/doors/index.ts +285 -0
- package/src/api/design/edit/index.ts +54 -0
- package/src/api/design/erase/index.ts +151 -0
- package/src/api/design/furniture/index.ts +130 -0
- package/src/api/design/index.ts +162 -0
- package/src/api/design/lock.ts +42 -0
- package/src/api/design/materials/index.ts +301 -0
- package/src/api/design/query/geometry/index.ts +166 -0
- package/src/api/design/query/index.ts +937 -0
- package/src/api/design/query/spaces.ts +132 -0
- package/src/api/design/selection/index.ts +144 -0
- package/src/api/design/shared.ts +40 -0
- package/src/api/design/transform/index.ts +93 -0
- package/src/api/design/update/index.ts +117 -0
- package/src/api/design/windows/index.ts +207 -0
- package/src/api/entity/buildableEnvelope.ts +64 -23
- package/src/api/entity/department.ts +0 -113
- package/src/api/entity/index.ts +4 -9
- package/src/api/entity/referenceLine.ts +50 -38
- package/src/api/entity/space.ts +84 -440
- package/src/api/entity/story.ts +53 -42
- package/src/api/index.ts +17 -17
- package/src/api/presentation/aiInspiration.ts +362 -0
- package/src/api/presentation/diagrams.ts +84 -0
- package/src/api/presentation/import.ts +112 -0
- package/src/api/presentation/index.ts +48 -0
- package/src/api/presentation/sheets.ts +198 -0
- package/src/api/presentation/views.ts +303 -0
- package/src/api/program/adjacency.ts +164 -0
- package/src/api/program/areas.ts +335 -0
- package/src/api/program/classification.ts +138 -0
- package/src/api/program/cores.ts +171 -0
- package/src/api/program/departments.ts +465 -0
- package/src/api/program/index.ts +71 -0
- package/src/api/program/layout.ts +68 -0
- package/src/api/program/metrics.ts +120 -0
- package/src/api/program/site.ts +326 -0
- package/src/api/program/spreadsheet.ts +2075 -0
- package/src/handles.ts +148 -0
- package/src/host-utils.ts +10 -6
- package/src/index.ts +1 -0
- 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/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/documentation/aiInspiration.d.ts +0 -2155
- package/dist/api/documentation/aiInspiration.d.ts.map +0 -1
- package/dist/api/documentation/index.d.ts +0 -13
- package/dist/api/documentation/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/src/api/core/geom/arc.ts +0 -70
- package/src/api/core/geom/curve.ts +0 -41
- package/src/api/core/geom/line.ts +0 -53
- package/src/api/core/geom/profile.ts +0 -94
- package/src/api/documentation/aiInspiration.ts +0 -871
- package/src/api/documentation/index.ts +0 -15
- package/src/api/tools/copy.ts +0 -55
- package/src/api/tools/index.ts +0 -35
- package/src/api/tools/offset.ts +0 -43
- package/src/api/tools/selection.ts +0 -51
- package/src/api/tools/transform.ts +0 -117
- package/src/api/units/index.ts +0 -163
package/src/api/entity/space.ts
CHANGED
|
@@ -1,390 +1,27 @@
|
|
|
1
|
+
// Space value types + schemas. The `entity.space.*` API was removed and its
|
|
2
|
+
// operations migrated to `design.create.spaces` / `design.update.*` /
|
|
3
|
+
// `design.query.*` / `design.delete.entities`. These shared space types survive
|
|
4
|
+
// here because `design.create` / `design.query` / `design.update` import them.
|
|
1
5
|
import * as z from "zod"
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
import {
|
|
7
|
+
ProfileHandle,
|
|
8
|
+
Vec3Handle,
|
|
9
|
+
Vec3Components,
|
|
10
|
+
QuatComponents,
|
|
11
|
+
CurveHandle,
|
|
12
|
+
} from "../../handles"
|
|
6
13
|
|
|
7
|
-
/**
|
|
8
|
-
* Space (room/mass) management — create, query, update, and delete spaces.
|
|
9
|
-
*
|
|
10
|
-
* A **space** is a 3D volume representing a room or mass in the
|
|
11
|
-
* Snaptrude scene. Spaces live on a particular story and carry
|
|
12
|
-
* properties such as name, area, department, and room type.
|
|
13
|
-
*
|
|
14
|
-
* All methods are **host API calls** that return Promises and support
|
|
15
|
-
* undo/redo via Snaptrude's command system.
|
|
16
|
-
*
|
|
17
|
-
* Accessed via `snaptrude.entity.space`.
|
|
18
|
-
*/
|
|
19
|
-
export abstract class PluginSpaceApi {
|
|
20
|
-
constructor() {}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Create a rectangular (box) space.
|
|
24
|
-
*
|
|
25
|
-
* Generates an axis-aligned box with the given dimensions at the
|
|
26
|
-
* specified position. The created space is automatically assigned
|
|
27
|
-
* to the active story and a default department.
|
|
28
|
-
*
|
|
29
|
-
* @param args - An object containing:
|
|
30
|
-
* - {@linkcode PluginSpaceCreateRectangularArgs.position args.position} — Origin
|
|
31
|
-
* position as a {@linkcode PVec3} in Babylon units
|
|
32
|
-
* - {@linkcode PluginSpaceCreateRectangularArgs.dimensions args.dimensions} — Box
|
|
33
|
-
* dimensions `{ width, height, depth }` in Babylon units
|
|
34
|
-
* @returns A {@linkcode PluginSpaceCreateRectangularResult} with the `spaceId`
|
|
35
|
-
* of the created space
|
|
36
|
-
* @throws If space creation fails
|
|
37
|
-
*
|
|
38
|
-
* # Example
|
|
39
|
-
* ```ts
|
|
40
|
-
* const { vec3 } = snaptrude.core.math
|
|
41
|
-
*
|
|
42
|
-
* const { spaceId } = await snaptrude.entity.space.createRectangular({
|
|
43
|
-
* position: vec3.new(0, 0, 0),
|
|
44
|
-
* dimensions: { width: 5, height: 3, depth: 4 },
|
|
45
|
-
* })
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
public abstract createRectangular({
|
|
49
|
-
position,
|
|
50
|
-
dimensions,
|
|
51
|
-
}: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Create a space by extruding a 2D profile.
|
|
55
|
-
*
|
|
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.
|
|
63
|
-
*
|
|
64
|
-
* Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile
|
|
65
|
-
* from a list of points.
|
|
66
|
-
*
|
|
67
|
-
* @param args - An object containing:
|
|
68
|
-
* - {@linkcode PluginSpaceCreateFromProfileArgs.profile args.profile} — A closed
|
|
69
|
-
* {@linkcode PProfile} defining the outer floor shape
|
|
70
|
-
* - {@linkcode PluginSpaceCreateFromProfileArgs.innerProfiles args.innerProfiles} —
|
|
71
|
-
* Optional closed {@linkcode PProfile}`[]` loops to subtract as holes
|
|
72
|
-
* - {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight args.extrudeHeight} —
|
|
73
|
-
* Extrusion height in Babylon units
|
|
74
|
-
* - {@linkcode PluginSpaceCreateFromProfileArgs.position args.position} — Offset
|
|
75
|
-
* position as a {@linkcode PVec3} in Babylon units
|
|
76
|
-
* @returns A {@linkcode PluginSpaceCreateFromProfileResult} with the `spaceId`
|
|
77
|
-
* of the created space
|
|
78
|
-
* @throws If the profile is invalid or mesh creation fails
|
|
79
|
-
*
|
|
80
|
-
* # Example
|
|
81
|
-
* ```ts
|
|
82
|
-
* const { vec3 } = snaptrude.core.math
|
|
83
|
-
*
|
|
84
|
-
* const outerProfile = await snaptrude.core.geom.profile.fromLinePoints({
|
|
85
|
-
* points: [
|
|
86
|
-
* vec3.new(0, 0, 0),
|
|
87
|
-
* vec3.new(10, 0, 0),
|
|
88
|
-
* vec3.new(10, 0, 8),
|
|
89
|
-
* vec3.new(0, 0, 8),
|
|
90
|
-
* ],
|
|
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
|
-
* })
|
|
100
|
-
*
|
|
101
|
-
* const { spaceId } = await snaptrude.entity.space.createFromProfile({
|
|
102
|
-
* profile: outerProfile,
|
|
103
|
-
* innerProfiles: [holeProfile],
|
|
104
|
-
* extrudeHeight: 3,
|
|
105
|
-
* position: vec3.new(0, 0, 0),
|
|
106
|
-
* })
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
public abstract createFromProfile({
|
|
110
|
-
profile,
|
|
111
|
-
innerProfiles,
|
|
112
|
-
extrudeHeight,
|
|
113
|
-
position,
|
|
114
|
-
}: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Update a space's BRep and mesh geometry by extruding a 2D profile.
|
|
118
|
-
*
|
|
119
|
-
* The {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.profile profile} is
|
|
120
|
-
* extruded upward (along the Y axis) by
|
|
121
|
-
* {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.extrudeHeight extrudeHeight}
|
|
122
|
-
* and applied to the existing space. The space keeps the same `spaceId`,
|
|
123
|
-
* metadata, department, and transform; only its geometry is replaced.
|
|
124
|
-
*
|
|
125
|
-
* Profile points are interpreted in scene coordinates. Profiles returned by
|
|
126
|
-
* {@linkcode PluginSpaceApi.get} with `"profile"` can be passed back directly;
|
|
127
|
-
* `"planPoints"` can be used to construct line-only profiles in the same X/Z
|
|
128
|
-
* plan coordinate space.
|
|
129
|
-
*
|
|
130
|
-
* Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile
|
|
131
|
-
* from a list of points.
|
|
132
|
-
*
|
|
133
|
-
* @param args - An object containing:
|
|
134
|
-
* - {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.spaceId args.spaceId} —
|
|
135
|
-
* The unique space ID to update
|
|
136
|
-
* - {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.profile args.profile} —
|
|
137
|
-
* A closed {@linkcode PProfile} defining the new floor shape
|
|
138
|
-
* - {@linkcode PluginSpaceUpdateGeometryFromProfileArgs.extrudeHeight
|
|
139
|
-
* args.extrudeHeight} — New extrusion height in Babylon units
|
|
140
|
-
* @returns A {@linkcode PluginSpaceUpdateGeometryFromProfileResult} with the
|
|
141
|
-
* `spaceId` of the updated space
|
|
142
|
-
* @throws If the space does not exist, the component is not a space/mass, the
|
|
143
|
-
* height is not positive, or the profile cannot create valid geometry
|
|
144
|
-
*
|
|
145
|
-
* # Example
|
|
146
|
-
* ```ts
|
|
147
|
-
* const { vec3 } = snaptrude.core.math
|
|
148
|
-
*
|
|
149
|
-
* const profile = await snaptrude.core.geom.profile.fromLinePoints({
|
|
150
|
-
* points: [
|
|
151
|
-
* vec3.new(0, 0, 0),
|
|
152
|
-
* vec3.new(12, 0, 0),
|
|
153
|
-
* vec3.new(12, 0, 6),
|
|
154
|
-
* vec3.new(0, 0, 6),
|
|
155
|
-
* ],
|
|
156
|
-
* })
|
|
157
|
-
*
|
|
158
|
-
* const { spaceId } = await snaptrude.entity.space.updateGeometryFromProfile({
|
|
159
|
-
* spaceId: "some-space-id",
|
|
160
|
-
* profile,
|
|
161
|
-
* extrudeHeight: 4,
|
|
162
|
-
* })
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
public abstract updateGeometryFromProfile({
|
|
166
|
-
spaceId,
|
|
167
|
-
profile,
|
|
168
|
-
extrudeHeight,
|
|
169
|
-
}: PluginSpaceUpdateGeometryFromProfileArgs): PluginApiReturn<PluginSpaceUpdateGeometryFromProfileResult>
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Get the IDs of all spaces in the current project.
|
|
173
|
-
*
|
|
174
|
-
* Returns every space (mass that is not a building) across all stories.
|
|
175
|
-
* Use the returned IDs with {@linkcode PluginSpaceApi.get} to query
|
|
176
|
-
* individual space properties.
|
|
177
|
-
*
|
|
178
|
-
* @returns A {@linkcode PluginSpaceGetAllResult} with a `spacesIds` array
|
|
179
|
-
*
|
|
180
|
-
* # Example
|
|
181
|
-
* ```ts
|
|
182
|
-
* const { spacesIds } = await snaptrude.entity.space.getAll()
|
|
183
|
-
* console.log(`Project has ${spacesIds.length} spaces`)
|
|
184
|
-
* ```
|
|
185
|
-
*/
|
|
186
|
-
public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Get properties of a space by its ID.
|
|
190
|
-
*
|
|
191
|
-
* Only the properties listed in {@linkcode PluginSpaceGetArgs.properties
|
|
192
|
-
* args.properties} are returned — unlisted properties will be `undefined`
|
|
193
|
-
* in the result.
|
|
194
|
-
*
|
|
195
|
-
* @param args - An object containing:
|
|
196
|
-
* - {@linkcode PluginSpaceGetArgs.spaceId args.spaceId} — The unique space ID
|
|
197
|
-
* (as returned by creation methods or {@linkcode PluginSpaceApi.getAll})
|
|
198
|
-
* - {@linkcode PluginSpaceGetArgs.properties args.properties} — Array of property
|
|
199
|
-
* names to retrieve. See {@linkcode PluginSpaceGetProperty} for available values.
|
|
200
|
-
* @returns A partial {@linkcode PluginSpaceGetResult} containing only the requested
|
|
201
|
-
* properties
|
|
202
|
-
* @throws If the space does not exist or the component is not a space/mass
|
|
203
|
-
*
|
|
204
|
-
* # Example
|
|
205
|
-
* ```ts
|
|
206
|
-
* const info = await snaptrude.entity.space.get({
|
|
207
|
-
* spaceId: "some-space-id",
|
|
208
|
-
* properties: ["name", "area", "position"],
|
|
209
|
-
* })
|
|
210
|
-
* console.log(info.name, info.area, info.position)
|
|
211
|
-
* ```
|
|
212
|
-
*/
|
|
213
|
-
public abstract get({
|
|
214
|
-
spaceId,
|
|
215
|
-
properties,
|
|
216
|
-
}: PluginSpaceGetArgs): PluginApiReturn<PluginSpaceGetResult>
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Delete a space by its ID.
|
|
220
|
-
*
|
|
221
|
-
* Permanently removes the space and its associated mesh from the scene.
|
|
222
|
-
* This operation is undoable via Snaptrude's command system.
|
|
223
|
-
*
|
|
224
|
-
* @param args - An object containing:
|
|
225
|
-
* - {@linkcode PluginSpaceDeleteArgs.spaceId args.spaceId} — The unique space ID
|
|
226
|
-
* to delete
|
|
227
|
-
* @throws If the space does not exist or the component is not a space/mass
|
|
228
|
-
*
|
|
229
|
-
* # Example
|
|
230
|
-
* ```ts
|
|
231
|
-
* await snaptrude.entity.space.delete({ spaceId: "some-space-id" })
|
|
232
|
-
* ```
|
|
233
|
-
*/
|
|
234
|
-
public abstract delete({
|
|
235
|
-
spaceId,
|
|
236
|
-
}: PluginSpaceDeleteArgs): PluginApiReturn<PluginSpaceDeleteResult>
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Update properties of a space by its ID.
|
|
240
|
-
*
|
|
241
|
-
* Only the properties provided in {@linkcode PluginSpaceUpdateArgs.properties
|
|
242
|
-
* args.properties} will be updated — omitted properties remain unchanged.
|
|
243
|
-
* This operation is undoable via Snaptrude's command system.
|
|
244
|
-
*
|
|
245
|
-
* @param args - An object containing:
|
|
246
|
-
* - {@linkcode PluginSpaceUpdateArgs.spaceId args.spaceId} — The unique space ID
|
|
247
|
-
* to update
|
|
248
|
-
* - {@linkcode PluginSpaceUpdateArgs.properties args.properties} — Key/value pairs
|
|
249
|
-
* of properties to update. See {@linkcode PluginSpaceUpdateArgs} for supported fields.
|
|
250
|
-
* @returns A {@linkcode PluginSpaceUpdateResult} echoing back the `spaceId` and
|
|
251
|
-
* the updated property values
|
|
252
|
-
* @throws If the space does not exist or the component is not a space/mass
|
|
253
|
-
*
|
|
254
|
-
* # Example
|
|
255
|
-
* ```ts
|
|
256
|
-
* const result = await snaptrude.entity.space.update({
|
|
257
|
-
* spaceId: "some-space-id",
|
|
258
|
-
* properties: {
|
|
259
|
-
* room_type: "Kitchen",
|
|
260
|
-
* massType: "Room",
|
|
261
|
-
* departmentId: "CORE",
|
|
262
|
-
* },
|
|
263
|
-
* })
|
|
264
|
-
* ```
|
|
265
|
-
*/
|
|
266
|
-
public abstract update(
|
|
267
|
-
args: PluginSpaceUpdateArgs,
|
|
268
|
-
): PluginApiReturn<PluginSpaceUpdateResult>
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Create many spaces in a single undoable operation.
|
|
272
|
-
*
|
|
273
|
-
* Each item is either a rectangular box (`kind: "rectangular"`) or an
|
|
274
|
-
* extruded profile (`kind: "profile"`), and may optionally set `room_type`,
|
|
275
|
-
* `spaceType`, `massType`, and `departmentId`. All creations — and the
|
|
276
|
-
* optional property assignments — are batched into **one** command, so the
|
|
277
|
-
* entire batch is undone/redone in a single step.
|
|
278
|
-
*
|
|
279
|
-
* All items are validated first; if any item is invalid the call **throws**
|
|
280
|
-
* and no spaces are created (nothing is applied) — consistent with the
|
|
281
|
-
* single-item create methods.
|
|
282
|
-
*
|
|
283
|
-
* @param args - {@linkcode PluginSpaceBulkCreateArgs} with an `items` array
|
|
284
|
-
* @returns A {@linkcode PluginSpaceBulkCreateResult} with the `spaceIds` of
|
|
285
|
-
* the created spaces, in input order
|
|
286
|
-
* @throws If any item has invalid dimensions, height, or profile
|
|
287
|
-
*
|
|
288
|
-
* # Example
|
|
289
|
-
* ```ts
|
|
290
|
-
* const { vec3 } = snaptrude.core.math
|
|
291
|
-
*
|
|
292
|
-
* const { spaceIds } = await snaptrude.entity.space.bulkCreate({
|
|
293
|
-
* items: [
|
|
294
|
-
* {
|
|
295
|
-
* kind: "rectangular",
|
|
296
|
-
* position: vec3.new(0, 0, 0),
|
|
297
|
-
* dimensions: { width: 5, height: 3, depth: 4 },
|
|
298
|
-
* spaceType: "Room",
|
|
299
|
-
* departmentId: "CORE",
|
|
300
|
-
* },
|
|
301
|
-
* {
|
|
302
|
-
* kind: "profile",
|
|
303
|
-
* profile: await snaptrude.core.geom.profile.fromLinePoints({
|
|
304
|
-
* points: [vec3.new(0, 0, 0), vec3.new(8, 0, 0), vec3.new(8, 0, 6), vec3.new(0, 0, 6)],
|
|
305
|
-
* }),
|
|
306
|
-
* extrudeHeight: 3,
|
|
307
|
-
* position: vec3.new(10, 0, 0),
|
|
308
|
-
* massType: "Room",
|
|
309
|
-
* },
|
|
310
|
-
* ],
|
|
311
|
-
* })
|
|
312
|
-
* ```
|
|
313
|
-
*/
|
|
314
|
-
public abstract bulkCreate(
|
|
315
|
-
args: PluginSpaceBulkCreateArgs,
|
|
316
|
-
): PluginApiReturn<PluginSpaceBulkCreateResult>
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Update many existing spaces in a single undoable operation.
|
|
320
|
-
*
|
|
321
|
-
* Each item targets an existing space by `spaceId` and may change its
|
|
322
|
-
* geometry (`profile` + `extrudeHeight`, which must be supplied together) and/or
|
|
323
|
-
* its `properties` (`room_type`, `massType`, `spaceType`, `areaClass`,
|
|
324
|
-
* `departmentId` —
|
|
325
|
-
* nested under `properties`, mirroring {@linkcode PluginSpaceApi.update}). All
|
|
326
|
-
* changes are batched into **one** command, so the entire batch is
|
|
327
|
-
* undone/redone in a single step.
|
|
328
|
-
*
|
|
329
|
-
* All items are validated first; if any item is invalid — an unknown
|
|
330
|
-
* `spaceId`, a non-positive height, or supplying only one of
|
|
331
|
-
* `profile`/`extrudeHeight` — the call **throws** and no changes are applied.
|
|
332
|
-
*
|
|
333
|
-
* @param args - {@linkcode PluginSpaceBulkUpdateArgs} with an `items` array
|
|
334
|
-
* @returns A {@linkcode PluginSpaceBulkUpdateResult} echoing one
|
|
335
|
-
* {@linkcode PluginSpaceUpdateResult} per item in `spaces`, in input order
|
|
336
|
-
* @throws If any item targets an unknown space, has a non-positive height, or
|
|
337
|
-
* supplies only one of `profile`/`extrudeHeight`
|
|
338
|
-
*
|
|
339
|
-
* # Example
|
|
340
|
-
* ```ts
|
|
341
|
-
* const { spaces } = await snaptrude.entity.space.bulkUpdate({
|
|
342
|
-
* items: [
|
|
343
|
-
* { spaceId: "space-a", properties: { room_type: "Kitchen", spaceType: "Room" } },
|
|
344
|
-
* { spaceId: "space-b", profile, extrudeHeight: 4 },
|
|
345
|
-
* ],
|
|
346
|
-
* })
|
|
347
|
-
* ```
|
|
348
|
-
*/
|
|
349
|
-
public abstract bulkUpdate(
|
|
350
|
-
args: PluginSpaceBulkUpdateArgs,
|
|
351
|
-
): PluginApiReturn<PluginSpaceBulkUpdateResult>
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Delete many spaces in a single undoable operation.
|
|
355
|
-
*
|
|
356
|
-
* All deletions are batched into **one** command, so the entire batch is
|
|
357
|
-
* undone/redone in a single step.
|
|
358
|
-
*
|
|
359
|
-
* All IDs are validated first; if any ID is unknown or is not a space the
|
|
360
|
-
* call **throws** and no spaces are deleted — consistent with the single-item
|
|
361
|
-
* {@linkcode PluginSpaceApi.delete}.
|
|
362
|
-
*
|
|
363
|
-
* @param args - {@linkcode PluginSpaceBulkDeleteArgs} with a `spaceIds` array
|
|
364
|
-
* @returns A {@linkcode PluginSpaceBulkDeleteResult} with `deletedSpaceIds`
|
|
365
|
-
* (the removed IDs, in input order)
|
|
366
|
-
* @throws If any ID does not resolve to an existing space
|
|
367
|
-
*
|
|
368
|
-
* # Example
|
|
369
|
-
* ```ts
|
|
370
|
-
* await snaptrude.entity.space.bulkDelete({ spaceIds: ["space-a", "space-b"] })
|
|
371
|
-
* ```
|
|
372
|
-
*/
|
|
373
|
-
public abstract bulkDelete(
|
|
374
|
-
args: PluginSpaceBulkDeleteArgs,
|
|
375
|
-
): PluginApiReturn<PluginSpaceBulkDeleteResult>
|
|
376
|
-
}
|
|
377
14
|
|
|
378
15
|
/**
|
|
379
|
-
* Arguments for
|
|
16
|
+
* Arguments for `createRectangular`.
|
|
380
17
|
*
|
|
381
18
|
* | Property | Type | Description |
|
|
382
19
|
* |---|---|---|
|
|
383
|
-
* | `position` | {@linkcode
|
|
20
|
+
* | `position` | {@linkcode Vec3Handle} | Origin position in Babylon units |
|
|
384
21
|
* | `dimensions` | `{ width, height, depth }` | Box dimensions in Babylon units |
|
|
385
22
|
*/
|
|
386
23
|
export const PluginSpaceCreateRectangularArgs = z.object({
|
|
387
|
-
position:
|
|
24
|
+
position: Vec3Handle,
|
|
388
25
|
dimensions: z.object({
|
|
389
26
|
width: z.number(),
|
|
390
27
|
height: z.number(),
|
|
@@ -397,7 +34,7 @@ export type PluginSpaceCreateRectangularArgs = z.infer<
|
|
|
397
34
|
>
|
|
398
35
|
|
|
399
36
|
/**
|
|
400
|
-
* Result of
|
|
37
|
+
* Result of `createRectangular`.
|
|
401
38
|
*
|
|
402
39
|
* | Property | Type | Description |
|
|
403
40
|
* |---|---|---|
|
|
@@ -412,20 +49,20 @@ export type PluginSpaceCreateRectangularResult = z.infer<
|
|
|
412
49
|
>
|
|
413
50
|
|
|
414
51
|
/**
|
|
415
|
-
* Arguments for
|
|
52
|
+
* Arguments for `createFromProfile`.
|
|
416
53
|
*
|
|
417
54
|
* | Property | Type | Description |
|
|
418
55
|
* |---|---|---|
|
|
419
|
-
* | `profile` | {@linkcode
|
|
420
|
-
* | `innerProfiles` | {@linkcode
|
|
56
|
+
* | `profile` | {@linkcode ProfileHandle} | Handle to a closed 2D profile (the outer floor shape) |
|
|
57
|
+
* | `innerProfiles` | {@linkcode ProfileHandle}`[]` | Optional profile handles to subtract as holes |
|
|
421
58
|
* | `extrudeHeight` | `number` | Extrusion height in Babylon units |
|
|
422
|
-
* | `position` | {@linkcode
|
|
59
|
+
* | `position` | {@linkcode Vec3Handle} | Offset position in Babylon units |
|
|
423
60
|
*/
|
|
424
61
|
export const PluginSpaceCreateFromProfileArgs = z.object({
|
|
425
|
-
profile:
|
|
426
|
-
innerProfiles: z.array(
|
|
62
|
+
profile: ProfileHandle,
|
|
63
|
+
innerProfiles: z.array(ProfileHandle).optional(),
|
|
427
64
|
extrudeHeight: z.number(),
|
|
428
|
-
position:
|
|
65
|
+
position: Vec3Handle,
|
|
429
66
|
})
|
|
430
67
|
|
|
431
68
|
export type PluginSpaceCreateFromProfileArgs = z.infer<
|
|
@@ -433,7 +70,7 @@ export type PluginSpaceCreateFromProfileArgs = z.infer<
|
|
|
433
70
|
>
|
|
434
71
|
|
|
435
72
|
/**
|
|
436
|
-
* Result of
|
|
73
|
+
* Result of `createFromProfile`.
|
|
437
74
|
*
|
|
438
75
|
* | Property | Type | Description |
|
|
439
76
|
* |---|---|---|
|
|
@@ -448,17 +85,17 @@ export type PluginSpaceCreateFromProfileResult = z.infer<
|
|
|
448
85
|
>
|
|
449
86
|
|
|
450
87
|
/**
|
|
451
|
-
* Arguments for
|
|
88
|
+
* Arguments for `updateGeometryFromProfile`.
|
|
452
89
|
*
|
|
453
90
|
* | Property | Type | Description |
|
|
454
91
|
* |---|---|---|
|
|
455
92
|
* | `spaceId` | `string` | Space to update |
|
|
456
|
-
* | `profile` | {@linkcode
|
|
93
|
+
* | `profile` | {@linkcode ProfileHandle} | Handle to the closed 2D profile defining the new floor shape |
|
|
457
94
|
* | `extrudeHeight` | `number` | New extrusion height in Babylon units |
|
|
458
95
|
*/
|
|
459
96
|
export const PluginSpaceUpdateGeometryFromProfileArgs = z.object({
|
|
460
97
|
spaceId: z.string(),
|
|
461
|
-
profile:
|
|
98
|
+
profile: ProfileHandle,
|
|
462
99
|
extrudeHeight: z.number(),
|
|
463
100
|
})
|
|
464
101
|
|
|
@@ -467,7 +104,7 @@ export type PluginSpaceUpdateGeometryFromProfileArgs = z.infer<
|
|
|
467
104
|
>
|
|
468
105
|
|
|
469
106
|
/**
|
|
470
|
-
* Result of
|
|
107
|
+
* Result of `updateGeometryFromProfile`.
|
|
471
108
|
*
|
|
472
109
|
* | Property | Type | Description |
|
|
473
110
|
* |---|---|---|
|
|
@@ -501,7 +138,6 @@ export type PluginSpaceUpdateGeometryFromProfileResult = z.infer<
|
|
|
501
138
|
* | `"height"` | `number` | Height dimension |
|
|
502
139
|
* | `"massType"` | `string \| null` | Mass type classification |
|
|
503
140
|
* | `"spaceType"` | `string \| null` | Space type classification (Room, Balcony, etc.) |
|
|
504
|
-
* | `"areaClass"` | {@linkcode PluginAreaClass} | Effective area classification (`"NET"`, `"GROSS"`, or `"EXCLUDED"`), resolving any per-space override then the space-type default. Never null. |
|
|
505
141
|
* | `"storey"` | `number \| null` | Story the space belongs to |
|
|
506
142
|
* | `"departmentId"` | `string \| null` | Assigned department ID |
|
|
507
143
|
* | `"departmentName"` | `string` | Assigned department name |
|
|
@@ -510,18 +146,23 @@ export type PluginSpaceUpdateGeometryFromProfileResult = z.infer<
|
|
|
510
146
|
* **Derived from mesh:**
|
|
511
147
|
* | Value | Return Type | Description |
|
|
512
148
|
* |---|---|---|
|
|
513
|
-
* | `"position"` | {@linkcode
|
|
514
|
-
* | `"absolutePosition"` | {@linkcode
|
|
515
|
-
* | `"rotation"` | {@linkcode
|
|
516
|
-
* | `"rotationQuaternion"` | {@linkcode
|
|
149
|
+
* | `"position"` | {@linkcode Vec3Components} | Local position relative to parent |
|
|
150
|
+
* | `"absolutePosition"` | {@linkcode Vec3Components} | Absolute position in the scene |
|
|
151
|
+
* | `"rotation"` | {@linkcode Vec3Components} | Euler rotation angles (radians) |
|
|
152
|
+
* | `"rotationQuaternion"` | {@linkcode QuatComponents} \| `null` | Quaternion rotation, or `null` if unset |
|
|
517
153
|
*
|
|
518
154
|
* **Derived from brep:**
|
|
519
155
|
* | Value | Return Type | Description |
|
|
520
156
|
* |---|---|---|
|
|
521
|
-
* | `"planPoints"` | {@linkcode
|
|
522
|
-
* | `"profile"` | {@linkcode
|
|
523
|
-
* | `"innerProfiles"` | {@linkcode
|
|
524
|
-
* | `"innerPlanPoints"` | {@linkcode
|
|
157
|
+
* | `"planPoints"` | {@linkcode Vec3Components}`[]` | Bottom outer profile points in world space with `y = 0` (2D plan). No closing duplicate point. |
|
|
158
|
+
* | `"profile"` | {@linkcode CurveHandle}`[]` | Bottom outer profile curves in world space, as opaque curve handles. Read coordinates via the `core.geom.curve` read API. |
|
|
159
|
+
* | `"innerProfiles"` | {@linkcode CurveHandle}`[][]` | Inner (hole) profile curve loops in world space — one loop per hole, `[]` when the space has none. Each curve is an opaque handle. |
|
|
160
|
+
* | `"innerPlanPoints"` | {@linkcode Vec3Components}`[][]` | Inner (hole) profile points in world space with `y = 0` — one loop per hole, no closing duplicate, `[]` when none. |
|
|
161
|
+
*
|
|
162
|
+
* **Derived from adjacency manager:**
|
|
163
|
+
* | Value | Return Type | Description |
|
|
164
|
+
* |---|---|---|
|
|
165
|
+
* | `"adjacency"` | `{ spaceId: string; value: number }[]` | Adjacency relationships to other spaces. `value`: `2` = Direct (required), `1` = Indirect or physical contact, `-1` = Restricted; `0` (no relationship) entries are filtered out. Empty when adjacency has never been computed — see `program.adjacency.compute`. |
|
|
525
166
|
*/
|
|
526
167
|
export const PluginSpaceGetProperty = z.enum([
|
|
527
168
|
// Basic
|
|
@@ -556,7 +197,7 @@ export const PluginSpaceGetProperty = z.enum([
|
|
|
556
197
|
])
|
|
557
198
|
|
|
558
199
|
/**
|
|
559
|
-
* Arguments for
|
|
200
|
+
* Arguments for `get`.
|
|
560
201
|
*
|
|
561
202
|
* | Property | Type | Description |
|
|
562
203
|
* |---|---|---|
|
|
@@ -600,24 +241,22 @@ export const PluginSpaceType = z.enum([
|
|
|
600
241
|
"Envelope",
|
|
601
242
|
"Parking",
|
|
602
243
|
])
|
|
244
|
+
/** The space-type value union (same-name type alias for positional signatures). */
|
|
245
|
+
export type PluginSpaceType = z.infer<typeof PluginSpaceType>
|
|
603
246
|
|
|
604
247
|
/**
|
|
605
|
-
* Area classification
|
|
606
|
-
* footprint contributes to.
|
|
248
|
+
* Area-class classification of a space (mirrors the internal `AreaClass` enum).
|
|
607
249
|
*
|
|
608
250
|
* | Value | Description |
|
|
609
251
|
* |---|---|
|
|
610
|
-
* | `"NET"` |
|
|
611
|
-
* | `"GROSS"` |
|
|
612
|
-
* | `"EXCLUDED"` |
|
|
613
|
-
*
|
|
614
|
-
* The classification does **not** change a space's own footprint area — it
|
|
615
|
-
* only decides which project-level total that footprint is summed into.
|
|
252
|
+
* | `"NET"` | Net (usable) area |
|
|
253
|
+
* | `"GROSS"` | Gross area |
|
|
254
|
+
* | `"EXCLUDED"` | Excluded from area totals |
|
|
616
255
|
*/
|
|
617
256
|
export const PluginAreaClass = z.enum(["NET", "GROSS", "EXCLUDED"])
|
|
618
257
|
|
|
619
258
|
/**
|
|
620
|
-
* Result of
|
|
259
|
+
* Result of `get`.
|
|
621
260
|
*
|
|
622
261
|
* A partial object — only the properties that were requested in
|
|
623
262
|
* {@linkcode PluginSpaceGetArgs.properties} will be present.
|
|
@@ -642,16 +281,19 @@ export const PluginSpaceGetResult = z
|
|
|
642
281
|
departmentName: z.string(),
|
|
643
282
|
departmentColor: z.string(),
|
|
644
283
|
// Derived from mesh
|
|
645
|
-
position:
|
|
646
|
-
absolutePosition:
|
|
647
|
-
rotation:
|
|
648
|
-
rotationQuaternion:
|
|
284
|
+
position: Vec3Components,
|
|
285
|
+
absolutePosition: Vec3Components,
|
|
286
|
+
rotation: Vec3Components,
|
|
287
|
+
rotationQuaternion: QuatComponents.nullable(),
|
|
649
288
|
// Derived from brep
|
|
650
|
-
planPoints: z.array(
|
|
651
|
-
profile:
|
|
652
|
-
innerProfiles: z.array(
|
|
653
|
-
innerPlanPoints: z.array(z.array(
|
|
654
|
-
// Derived from adjacency manager
|
|
289
|
+
planPoints: z.array(Vec3Components),
|
|
290
|
+
profile: z.array(CurveHandle),
|
|
291
|
+
innerProfiles: z.array(z.array(CurveHandle)),
|
|
292
|
+
innerPlanPoints: z.array(z.array(Vec3Components)),
|
|
293
|
+
// Derived from adjacency manager.
|
|
294
|
+
// value: 2 = Direct (required), 1 = Indirect or physical contact, -1 = Restricted;
|
|
295
|
+
// 0 (no relationship) entries are filtered out. Empty array when adjacency has
|
|
296
|
+
// never been computed — run program.adjacency.compute() first for fresh data.
|
|
655
297
|
adjacency: z.array(z.object({
|
|
656
298
|
spaceId: z.string(),
|
|
657
299
|
value: z.number(),
|
|
@@ -662,7 +304,7 @@ export const PluginSpaceGetResult = z
|
|
|
662
304
|
export type PluginSpaceGetResult = z.infer<typeof PluginSpaceGetResult>
|
|
663
305
|
|
|
664
306
|
/**
|
|
665
|
-
* Result of
|
|
307
|
+
* Result of `getAll`.
|
|
666
308
|
*
|
|
667
309
|
* | Property | Type | Description |
|
|
668
310
|
* |---|---|---|
|
|
@@ -675,7 +317,7 @@ export const PluginSpaceGetAllResult = z.object({
|
|
|
675
317
|
export type PluginSpaceGetAllResult = z.infer<typeof PluginSpaceGetAllResult>
|
|
676
318
|
|
|
677
319
|
/**
|
|
678
|
-
* Arguments for
|
|
320
|
+
* Arguments for `delete`.
|
|
679
321
|
*
|
|
680
322
|
* | Property | Type | Description |
|
|
681
323
|
* |---|---|---|
|
|
@@ -687,7 +329,7 @@ export const PluginSpaceDeleteArgs = z.object({
|
|
|
687
329
|
|
|
688
330
|
export type PluginSpaceDeleteArgs = z.infer<typeof PluginSpaceDeleteArgs>
|
|
689
331
|
|
|
690
|
-
/** Result type for
|
|
332
|
+
/** Result type for `delete` — returns nothing on success. */
|
|
691
333
|
export type PluginSpaceDeleteResult = void
|
|
692
334
|
|
|
693
335
|
/**
|
|
@@ -724,6 +366,8 @@ export const PluginMassType = z.enum([
|
|
|
724
366
|
"Mass",
|
|
725
367
|
"Site",
|
|
726
368
|
])
|
|
369
|
+
/** The mass-type value union (same-name type alias for positional signatures). */
|
|
370
|
+
export type PluginMassType = z.infer<typeof PluginMassType>
|
|
727
371
|
|
|
728
372
|
/**
|
|
729
373
|
* Well-known (built-in) department IDs.
|
|
@@ -750,9 +394,11 @@ export const PluginDepartmentId = z.union([
|
|
|
750
394
|
PluginWellKnownDepartmentId,
|
|
751
395
|
z.uuid(),
|
|
752
396
|
])
|
|
397
|
+
/** The department-id value union (same-name type alias for positional signatures). */
|
|
398
|
+
export type PluginDepartmentId = z.infer<typeof PluginDepartmentId>
|
|
753
399
|
|
|
754
400
|
/**
|
|
755
|
-
* Arguments for
|
|
401
|
+
* Arguments for `update`.
|
|
756
402
|
*
|
|
757
403
|
* | Property | Type | Description |
|
|
758
404
|
* |---|---|---|
|
|
@@ -760,7 +406,6 @@ export const PluginDepartmentId = z.union([
|
|
|
760
406
|
* | `properties` | `object` | Key/value pairs of properties to update (all optional) |
|
|
761
407
|
* | `properties.room_type` | `string?` | New room type label |
|
|
762
408
|
* | `properties.massType` | {@linkcode PluginMassType}`?` | New mass type |
|
|
763
|
-
* | `properties.areaClass` | {@linkcode PluginAreaClass}`?` | New area classification. Sets an explicit per-space override (`"NET"`, `"GROSS"`, or `"EXCLUDED"`) that wins over the space-type default. |
|
|
764
409
|
* | `properties.departmentId` | {@linkcode PluginDepartmentId}`?` | New department ID |
|
|
765
410
|
*/
|
|
766
411
|
export const PluginSpaceUpdateArgs = z.object({
|
|
@@ -777,7 +422,7 @@ export const PluginSpaceUpdateArgs = z.object({
|
|
|
777
422
|
export type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>
|
|
778
423
|
|
|
779
424
|
/**
|
|
780
|
-
* Result of
|
|
425
|
+
* Result of `update`.
|
|
781
426
|
*
|
|
782
427
|
* Echoes back the `spaceId` and the values of properties that were updated.
|
|
783
428
|
* Properties that were not included in the update request will be `undefined`.
|
|
@@ -788,7 +433,6 @@ export type PluginSpaceUpdateArgs = z.infer<typeof PluginSpaceUpdateArgs>
|
|
|
788
433
|
* | `room_type` | `string?` | Updated room type (if changed) |
|
|
789
434
|
* | `massType` | `string?` | Updated mass type (if changed) |
|
|
790
435
|
* | `spaceType` | `string?` | Updated space type (if changed) |
|
|
791
|
-
* | `areaClass` | {@linkcode PluginAreaClass}`?` | Updated area classification (if changed) |
|
|
792
436
|
* | `departmentId` | `string \| null?` | Updated department ID (if changed) |
|
|
793
437
|
*/
|
|
794
438
|
export const PluginSpaceUpdateResult = z.object({
|
|
@@ -807,7 +451,7 @@ export type PluginSpaceUpdateResult = z.infer<typeof PluginSpaceUpdateResult>
|
|
|
807
451
|
// ---------------------------------------------------------------------------
|
|
808
452
|
|
|
809
453
|
/**
|
|
810
|
-
* A single item for
|
|
454
|
+
* A single item for `bulkCreate`.
|
|
811
455
|
*
|
|
812
456
|
* Discriminated on `kind`:
|
|
813
457
|
* - `"rectangular"` — a box defined by `position` + `dimensions` (mirrors
|
|
@@ -822,7 +466,7 @@ export type PluginSpaceUpdateResult = z.infer<typeof PluginSpaceUpdateResult>
|
|
|
822
466
|
export const PluginSpaceBulkCreateItem = z.discriminatedUnion("kind", [
|
|
823
467
|
z.object({
|
|
824
468
|
kind: z.literal("rectangular"),
|
|
825
|
-
position:
|
|
469
|
+
position: Vec3Handle,
|
|
826
470
|
dimensions: z.object({
|
|
827
471
|
width: z.number(),
|
|
828
472
|
height: z.number(),
|
|
@@ -835,10 +479,10 @@ export const PluginSpaceBulkCreateItem = z.discriminatedUnion("kind", [
|
|
|
835
479
|
}),
|
|
836
480
|
z.object({
|
|
837
481
|
kind: z.literal("profile"),
|
|
838
|
-
profile:
|
|
839
|
-
innerProfiles: z.array(
|
|
482
|
+
profile: ProfileHandle,
|
|
483
|
+
innerProfiles: z.array(ProfileHandle).optional(),
|
|
840
484
|
extrudeHeight: z.number(),
|
|
841
|
-
position:
|
|
485
|
+
position: Vec3Handle,
|
|
842
486
|
room_type: z.string().optional(),
|
|
843
487
|
spaceType: PluginSpaceType.optional(),
|
|
844
488
|
massType: PluginMassType.optional(),
|
|
@@ -849,7 +493,7 @@ export const PluginSpaceBulkCreateItem = z.discriminatedUnion("kind", [
|
|
|
849
493
|
export type PluginSpaceBulkCreateItem = z.infer<typeof PluginSpaceBulkCreateItem>
|
|
850
494
|
|
|
851
495
|
/**
|
|
852
|
-
* Arguments for
|
|
496
|
+
* Arguments for `bulkCreate`.
|
|
853
497
|
*
|
|
854
498
|
* | Property | Type | Description |
|
|
855
499
|
* |---|---|---|
|
|
@@ -862,7 +506,7 @@ export const PluginSpaceBulkCreateArgs = z.object({
|
|
|
862
506
|
export type PluginSpaceBulkCreateArgs = z.infer<typeof PluginSpaceBulkCreateArgs>
|
|
863
507
|
|
|
864
508
|
/**
|
|
865
|
-
* Result of
|
|
509
|
+
* Result of `bulkCreate`.
|
|
866
510
|
*
|
|
867
511
|
* | Property | Type | Description |
|
|
868
512
|
* |---|---|---|
|
|
@@ -877,7 +521,7 @@ export type PluginSpaceBulkCreateResult = z.infer<
|
|
|
877
521
|
>
|
|
878
522
|
|
|
879
523
|
/**
|
|
880
|
-
* A single item for
|
|
524
|
+
* A single item for `bulkUpdate`.
|
|
881
525
|
*
|
|
882
526
|
* Targets an existing space by `spaceId`. Geometry fields `profile` and
|
|
883
527
|
* `extrudeHeight` must be supplied **together** (mirrors
|
|
@@ -887,13 +531,13 @@ export type PluginSpaceBulkCreateResult = z.infer<
|
|
|
887
531
|
* | Property | Type | Description |
|
|
888
532
|
* |---|---|---|
|
|
889
533
|
* | `spaceId` | `string` | The space to update |
|
|
890
|
-
* | `profile` | {@linkcode
|
|
534
|
+
* | `profile` | {@linkcode ProfileHandle}`?` | New floor shape handle (requires `extrudeHeight`) |
|
|
891
535
|
* | `extrudeHeight` | `number?` | New extrusion height (requires `profile`) |
|
|
892
536
|
* | `properties` | `object?` | Property changes (same shape as {@linkcode PluginSpaceUpdateArgs.properties}) |
|
|
893
537
|
*/
|
|
894
538
|
export const PluginSpaceBulkUpdateItem = z.object({
|
|
895
539
|
spaceId: z.string(),
|
|
896
|
-
profile:
|
|
540
|
+
profile: ProfileHandle.optional(),
|
|
897
541
|
extrudeHeight: z.number().optional(),
|
|
898
542
|
properties: z
|
|
899
543
|
.object({
|
|
@@ -909,7 +553,7 @@ export const PluginSpaceBulkUpdateItem = z.object({
|
|
|
909
553
|
export type PluginSpaceBulkUpdateItem = z.infer<typeof PluginSpaceBulkUpdateItem>
|
|
910
554
|
|
|
911
555
|
/**
|
|
912
|
-
* Arguments for
|
|
556
|
+
* Arguments for `bulkUpdate`.
|
|
913
557
|
*
|
|
914
558
|
* | Property | Type | Description |
|
|
915
559
|
* |---|---|---|
|
|
@@ -922,10 +566,10 @@ export const PluginSpaceBulkUpdateArgs = z.object({
|
|
|
922
566
|
export type PluginSpaceBulkUpdateArgs = z.infer<typeof PluginSpaceBulkUpdateArgs>
|
|
923
567
|
|
|
924
568
|
/**
|
|
925
|
-
* Result of
|
|
569
|
+
* Result of `bulkUpdate`.
|
|
926
570
|
*
|
|
927
571
|
* Echoes one {@linkcode PluginSpaceUpdateResult} per item, in input order —
|
|
928
|
-
* the same per-space shape returned by
|
|
572
|
+
* the same per-space shape returned by `update`.
|
|
929
573
|
*
|
|
930
574
|
* | Property | Type | Description |
|
|
931
575
|
* |---|---|---|
|
|
@@ -940,7 +584,7 @@ export type PluginSpaceBulkUpdateResult = z.infer<
|
|
|
940
584
|
>
|
|
941
585
|
|
|
942
586
|
/**
|
|
943
|
-
* Arguments for
|
|
587
|
+
* Arguments for `bulkDelete`.
|
|
944
588
|
*
|
|
945
589
|
* | Property | Type | Description |
|
|
946
590
|
* |---|---|---|
|
|
@@ -953,7 +597,7 @@ export const PluginSpaceBulkDeleteArgs = z.object({
|
|
|
953
597
|
export type PluginSpaceBulkDeleteArgs = z.infer<typeof PluginSpaceBulkDeleteArgs>
|
|
954
598
|
|
|
955
599
|
/**
|
|
956
|
-
* Result of
|
|
600
|
+
* Result of `bulkDelete`.
|
|
957
601
|
*
|
|
958
602
|
* | Property | Type | Description |
|
|
959
603
|
* |---|---|---|
|