@snaptrude/plugin-core 0.0.0-dev-20260708130115 → 0.0.0-dev-20260827135706
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 +152 -1
- package/api-manifest.json +3620 -276
- package/dist/api/analysis/daylight.d.ts +603 -0
- package/dist/api/analysis/daylight.d.ts.map +1 -0
- package/dist/api/analysis/heatmaps.d.ts +658 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +59 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/solar.d.ts +249 -0
- package/dist/api/analysis/solar.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/analysis/weather.d.ts +193 -0
- package/dist/api/analysis/weather.d.ts.map +1 -0
- package/dist/api/core/camera/index.d.ts +261 -0
- package/dist/api/core/camera/index.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +105 -2
- package/dist/api/core/comment/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +840 -14
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/delete/index.d.ts +8 -2
- package/dist/api/core/geom/delete/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +5 -5
- package/dist/api/core/geom/query/brep.d.ts +130 -18
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/circle.d.ts +18 -18
- package/dist/api/core/geom/query/contour.d.ts +20 -20
- package/dist/api/core/geom/query/curve.d.ts +49 -49
- package/dist/api/core/geom/query/edge.d.ts +5 -5
- package/dist/api/core/geom/query/face.d.ts +16 -16
- package/dist/api/core/geom/query/halfedge.d.ts +8 -8
- package/dist/api/core/geom/query/profile.d.ts +19 -19
- package/dist/api/core/geom/query/vertex.d.ts +8 -8
- package/dist/api/core/geom/update/contour.d.ts +14 -14
- package/dist/api/core/geom/update/curve.d.ts +7 -7
- package/dist/api/core/geom/update/profile.d.ts +16 -16
- package/dist/api/core/handles/index.d.ts +210 -0
- package/dist/api/core/handles/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +34 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/export/index.d.ts +134 -0
- package/dist/api/core/io/export/index.d.ts.map +1 -0
- package/dist/api/core/io/import/index.d.ts +453 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +40 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +341 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +805 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +7 -7
- package/dist/api/core/mode/index.d.ts +99 -0
- package/dist/api/core/mode/index.d.ts.map +1 -0
- package/dist/api/core/project/index.d.ts +68 -1
- package/dist/api/core/project/index.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +531 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/core/storeys/index.d.ts +265 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +24 -0
- package/dist/api/core/tags.d.ts.map +1 -1
- package/dist/api/core/user.d.ts +44 -0
- package/dist/api/core/user.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +4 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/boolean/index.d.ts +4 -4
- package/dist/api/design/create/index.d.ts +568 -45
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +3 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +195 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/edit/index.d.ts +1 -1
- package/dist/api/design/erase/index.d.ts +2 -2
- package/dist/api/design/family.d.ts +349 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +181 -8
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +98 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/lock.d.ts +26 -0
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/materials/index.d.ts +270 -16
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/geometry/index.d.ts +112 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +282 -11
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/referenceLines.d.ts +45 -0
- package/dist/api/design/query/referenceLines.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +181 -8
- package/dist/api/design/query/spaces.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +144 -0
- package/dist/api/design/selection/index.d.ts.map +1 -1
- package/dist/api/design/transform/index.d.ts +172 -10
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/design/types/index.d.ts +181 -0
- package/dist/api/design/types/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +553 -2
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +126 -0
- package/dist/api/design/visibility.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +113 -2
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +4 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +10 -2
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +21 -21
- package/dist/api/entity/story.d.ts +242 -15
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +25 -25
- package/dist/api/presentation/annotate.d.ts +467 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +111 -8
- package/dist/api/presentation/diagrams.d.ts.map +1 -1
- package/dist/api/presentation/export.d.ts +108 -0
- package/dist/api/presentation/export.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +55 -4
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +58 -1
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +1139 -0
- package/dist/api/presentation/placedViews.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +481 -0
- package/dist/api/presentation/shapes.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +452 -13
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/slideshow.d.ts +125 -0
- package/dist/api/presentation/slideshow.d.ts.map +1 -0
- package/dist/api/presentation/tables.d.ts +81 -0
- package/dist/api/presentation/tables.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +367 -7
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +102 -12
- package/dist/api/program/areas.d.ts.map +1 -1
- package/dist/api/program/cores.d.ts +3 -99
- package/dist/api/program/cores.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +7 -15
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +346 -11
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +469 -13
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/api/program/spreadsheet.d.ts +365 -41
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +505 -0
- package/dist/api/workspace/index.d.ts.map +1 -0
- package/dist/errors/codes.d.ts +34 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/envelope.d.ts +56 -0
- package/dist/errors/envelope.d.ts.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/plugin-error.d.ts +69 -0
- package/dist/errors/plugin-error.d.ts.map +1 -0
- package/dist/handles.d.ts +97 -25
- package/dist/handles.d.ts.map +1 -1
- package/dist/host-utils.d.ts +4 -0
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +4582 -1422
- 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 +4171 -1411
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/scripts/generate-manifest.mjs +45 -0
- package/scripts/generate-manifest.test.mjs +103 -4
- package/src/api/analysis/daylight.ts +470 -0
- package/src/api/analysis/heatmaps.ts +683 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +61 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/solar.ts +237 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/analysis/weather.ts +179 -0
- package/src/api/core/camera/index.ts +268 -0
- package/src/api/core/comment/index.ts +120 -2
- package/src/api/core/geom/create/index.ts +912 -1
- package/src/api/core/geom/delete/index.ts +6 -0
- package/src/api/core/geom/query/brep.ts +119 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/index.ts +34 -0
- package/src/api/core/io/export/index.ts +126 -0
- package/src/api/core/io/import/index.ts +496 -0
- package/src/api/core/io/index.ts +42 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +360 -0
- package/src/api/core/io/underlay/index.ts +705 -0
- package/src/api/core/mode/index.ts +96 -0
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/proposals/index.ts +569 -0
- package/src/api/core/storeys/index.ts +294 -0
- package/src/api/core/tags.ts +27 -0
- package/src/api/core/user.ts +46 -0
- package/src/api/core/zoom/index.ts +4 -0
- package/src/api/design/create/index.ts +670 -30
- package/src/api/design/delete/index.ts +3 -0
- package/src/api/design/doors/index.ts +208 -0
- package/src/api/design/erase/index.ts +1 -1
- package/src/api/design/family.ts +388 -0
- package/src/api/design/furniture/index.ts +197 -8
- package/src/api/design/index.ts +102 -0
- package/src/api/design/lock.ts +27 -0
- package/src/api/design/materials/index.ts +334 -27
- package/src/api/design/query/geometry/index.ts +125 -3
- package/src/api/design/query/index.ts +217 -7
- package/src/api/design/query/referenceLines.ts +52 -0
- package/src/api/design/query/spaces.ts +143 -0
- package/src/api/design/selection/index.ts +129 -0
- package/src/api/design/transform/index.ts +170 -9
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +631 -3
- package/src/api/design/visibility.ts +143 -0
- package/src/api/design/windows/index.ts +128 -2
- package/src/api/entity/buildableEnvelope.ts +4 -0
- package/src/api/entity/referenceLine.ts +8 -0
- package/src/api/entity/story.ts +259 -15
- package/src/api/index.ts +10 -0
- package/src/api/presentation/annotate.ts +385 -0
- package/src/api/presentation/diagrams.ts +118 -8
- package/src/api/presentation/export.ts +108 -0
- package/src/api/presentation/import.ts +51 -4
- package/src/api/presentation/index.ts +66 -1
- package/src/api/presentation/placedViews.ts +1120 -0
- package/src/api/presentation/shapes.ts +274 -0
- package/src/api/presentation/sheets.ts +400 -13
- package/src/api/presentation/slideshow.ts +134 -0
- package/src/api/presentation/tables.ts +84 -0
- package/src/api/presentation/views.ts +376 -8
- package/src/api/program/areas.ts +88 -15
- package/src/api/program/cores.ts +3 -91
- package/src/api/program/index.ts +7 -15
- package/src/api/program/layout.ts +365 -11
- package/src/api/program/site.ts +435 -13
- package/src/api/program/spreadsheet.ts +376 -35
- package/src/api/workspace/index.ts +563 -0
- package/src/errors/codes.ts +136 -0
- package/src/errors/envelope.ts +75 -0
- package/src/errors/index.ts +21 -0
- package/src/errors/plugin-error.ts +134 -0
- package/src/handles.ts +123 -13
- package/src/host-utils.ts +4 -0
- package/src/index.ts +1 -0
- package/test/errors.test.mjs +184 -0
- package/tsconfig.json +7 -2
|
@@ -66,6 +66,52 @@ export declare abstract class PluginDesignQuerySpacesApi {
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
abstract getFootprint(space: ComponentHandle): PluginApiReturn<ContourHandle | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Get the **enclosure** of a space — the floor and ceiling that cap it, the
|
|
71
|
+
* bounding walls around it (with each wall's door/window openings), and the
|
|
72
|
+
* neighbouring spaces it shares a boundary with.
|
|
73
|
+
*
|
|
74
|
+
* **Geometric v1 — best effort.** The engine has no persisted space→surface
|
|
75
|
+
* topology, so this read is derived purely from *plan geometry*: the space
|
|
76
|
+
* footprint is matched against the plan footprints/baselines of the slabs and
|
|
77
|
+
* walls on the same storey. Consequences a caller must account for:
|
|
78
|
+
*
|
|
79
|
+
* - `faceIndices` is **always `[]`**. The triangle→B-rep-face provenance that
|
|
80
|
+
* would populate it is a separate engine capability that does not exist yet;
|
|
81
|
+
* read a surface's full geometry via
|
|
82
|
+
* {@linkcode PluginDesignQueryGeometryApi.getBrep} on its `component` instead.
|
|
83
|
+
* - After heavy edits (move / stretch / boolean) or on imported models the plan
|
|
84
|
+
* match can miss or mis-attribute a surface — treat the result as advisory,
|
|
85
|
+
* not authoritative.
|
|
86
|
+
* - `adjacentSpaces` comes from the same adjacency data as
|
|
87
|
+
* {@linkcode PluginProgramAdjacencyApi.getMatrix} (so the two agree on which
|
|
88
|
+
* spaces neighbour). `sharedEdgeLength` is `0` because that data exposes no
|
|
89
|
+
* edge length, and `sharedSurface` is the common boundary wall only when one
|
|
90
|
+
* is found geometrically (else `null`).
|
|
91
|
+
*
|
|
92
|
+
* Read-only; never mutates the model.
|
|
93
|
+
*
|
|
94
|
+
* @param space - The space (room mass) to read
|
|
95
|
+
* @returns the {@linkcode PluginSpaceEnclosure}, or `null` when `space` is not a
|
|
96
|
+
* space (room mass) or has no extractable plan footprint
|
|
97
|
+
*
|
|
98
|
+
* @examplePrompt What walls, floor and ceiling enclose this room?
|
|
99
|
+
* @examplePrompt Which of this room's walls are external?
|
|
100
|
+
* @examplePrompt List the doors and windows around the selected space
|
|
101
|
+
* @examplePrompt Which spaces are adjacent to this room, and through which wall?
|
|
102
|
+
*
|
|
103
|
+
* # Example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const [space] = await snaptrude.design.query.listSpaces()
|
|
106
|
+
* const enclosure = await snaptrude.design.query.spaces.getEnclosure(space)
|
|
107
|
+
* if (enclosure) {
|
|
108
|
+
* const walls = enclosure.surfaces.filter((s) => s.role === "wall")
|
|
109
|
+
* const external = walls.filter((s) => s.isExternal)
|
|
110
|
+
* console.log(`${walls.length} walls, ${external.length} external`)
|
|
111
|
+
* }
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
abstract getEnclosure(space: ComponentHandle): PluginApiReturn<PluginSpaceEnclosure | null>;
|
|
69
115
|
}
|
|
70
116
|
/**
|
|
71
117
|
* Arguments for {@linkcode PluginDesignQuerySpacesApi.getFootprint}.
|
|
@@ -87,9 +133,10 @@ export type PluginDesignQueryGetFootprintArgs = z.infer<typeof PluginDesignQuery
|
|
|
87
133
|
export declare const PluginDesignQuerySpacesGetProperty: z.ZodEnum<{
|
|
88
134
|
profile: "profile";
|
|
89
135
|
type: "type";
|
|
90
|
-
position: "position";
|
|
91
136
|
id: "id";
|
|
137
|
+
position: "position";
|
|
92
138
|
name: "name";
|
|
139
|
+
storey: "storey";
|
|
93
140
|
height: "height";
|
|
94
141
|
depth: "depth";
|
|
95
142
|
innerProfiles: "innerProfiles";
|
|
@@ -99,7 +146,6 @@ export declare const PluginDesignQuerySpacesGetProperty: z.ZodEnum<{
|
|
|
99
146
|
massType: "massType";
|
|
100
147
|
spaceType: "spaceType";
|
|
101
148
|
areaClass: "areaClass";
|
|
102
|
-
storey: "storey";
|
|
103
149
|
departmentId: "departmentId";
|
|
104
150
|
departmentName: "departmentName";
|
|
105
151
|
departmentColor: "departmentColor";
|
|
@@ -123,9 +169,10 @@ export declare const PluginDesignQuerySpacesGetArgs: z.ZodObject<{
|
|
|
123
169
|
properties: z.ZodArray<z.ZodEnum<{
|
|
124
170
|
profile: "profile";
|
|
125
171
|
type: "type";
|
|
126
|
-
position: "position";
|
|
127
172
|
id: "id";
|
|
173
|
+
position: "position";
|
|
128
174
|
name: "name";
|
|
175
|
+
storey: "storey";
|
|
129
176
|
height: "height";
|
|
130
177
|
depth: "depth";
|
|
131
178
|
innerProfiles: "innerProfiles";
|
|
@@ -135,7 +182,6 @@ export declare const PluginDesignQuerySpacesGetArgs: z.ZodObject<{
|
|
|
135
182
|
massType: "massType";
|
|
136
183
|
spaceType: "spaceType";
|
|
137
184
|
areaClass: "areaClass";
|
|
138
|
-
storey: "storey";
|
|
139
185
|
departmentId: "departmentId";
|
|
140
186
|
departmentName: "departmentName";
|
|
141
187
|
departmentColor: "departmentColor";
|
|
@@ -153,18 +199,19 @@ export type PluginDesignQuerySpacesGetArgs = z.infer<typeof PluginDesignQuerySpa
|
|
|
153
199
|
* requested properties are present.
|
|
154
200
|
*/
|
|
155
201
|
export declare const PluginDesignQuerySpacesGetResult: z.ZodObject<{
|
|
156
|
-
profile: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.
|
|
202
|
+
profile: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"arc">, string>>]>>>;
|
|
157
203
|
type: z.ZodOptional<z.ZodString>;
|
|
204
|
+
id: z.ZodOptional<z.ZodString>;
|
|
158
205
|
position: z.ZodOptional<z.ZodObject<{
|
|
159
206
|
x: z.ZodNumber;
|
|
160
207
|
y: z.ZodNumber;
|
|
161
208
|
z: z.ZodNumber;
|
|
162
209
|
}, z.core.$strip>>;
|
|
163
|
-
id: z.ZodOptional<z.ZodString>;
|
|
164
210
|
name: z.ZodOptional<z.ZodString>;
|
|
211
|
+
storey: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
165
212
|
height: z.ZodOptional<z.ZodNumber>;
|
|
166
213
|
depth: z.ZodOptional<z.ZodNumber>;
|
|
167
|
-
innerProfiles: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.
|
|
214
|
+
innerProfiles: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"arc">, string>>]>>>>;
|
|
168
215
|
room_type: z.ZodOptional<z.ZodString>;
|
|
169
216
|
area: z.ZodOptional<z.ZodNumber>;
|
|
170
217
|
breadth: z.ZodOptional<z.ZodNumber>;
|
|
@@ -186,7 +233,6 @@ export declare const PluginDesignQuerySpacesGetResult: z.ZodObject<{
|
|
|
186
233
|
GROSS: "GROSS";
|
|
187
234
|
EXCLUDED: "EXCLUDED";
|
|
188
235
|
}>>;
|
|
189
|
-
storey: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
190
236
|
departmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
237
|
departmentName: z.ZodOptional<z.ZodString>;
|
|
192
238
|
departmentColor: z.ZodOptional<z.ZodString>;
|
|
@@ -218,4 +264,131 @@ export declare const PluginDesignQuerySpacesGetResult: z.ZodObject<{
|
|
|
218
264
|
}, z.core.$strip>>>>;
|
|
219
265
|
}, z.core.$strip>;
|
|
220
266
|
export type PluginDesignQuerySpacesGetResult = z.infer<typeof PluginDesignQuerySpacesGetResult>;
|
|
267
|
+
/**
|
|
268
|
+
* Arguments for {@linkcode PluginDesignQuerySpacesApi.getEnclosure}.
|
|
269
|
+
*
|
|
270
|
+
* | Property | Type | Description |
|
|
271
|
+
* |---|---|---|
|
|
272
|
+
* | `space` | {@linkcode ComponentHandle} | The space (room mass) to read |
|
|
273
|
+
*/
|
|
274
|
+
export declare const PluginDesignQuerySpacesGetEnclosureArgs: z.ZodObject<{
|
|
275
|
+
space: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
276
|
+
}, z.core.$strip>;
|
|
277
|
+
export type PluginDesignQuerySpacesGetEnclosureArgs = z.infer<typeof PluginDesignQuerySpacesGetEnclosureArgs>;
|
|
278
|
+
/**
|
|
279
|
+
* The role a bounding surface plays in a {@linkcode PluginSpaceEnclosure}:
|
|
280
|
+
* `"floor"` (slab below), `"ceiling"` (slab/roof above), or `"wall"`.
|
|
281
|
+
*/
|
|
282
|
+
export declare const PluginEnclosureRole: z.ZodEnum<{
|
|
283
|
+
floor: "floor";
|
|
284
|
+
wall: "wall";
|
|
285
|
+
ceiling: "ceiling";
|
|
286
|
+
}>;
|
|
287
|
+
export type PluginEnclosureRole = z.infer<typeof PluginEnclosureRole>;
|
|
288
|
+
/** The kind of opening hosted in a bounding wall. */
|
|
289
|
+
export declare const PluginEnclosureOpeningKind: z.ZodEnum<{
|
|
290
|
+
void: "void";
|
|
291
|
+
door: "door";
|
|
292
|
+
window: "window";
|
|
293
|
+
}>;
|
|
294
|
+
export type PluginEnclosureOpeningKind = z.infer<typeof PluginEnclosureOpeningKind>;
|
|
295
|
+
/**
|
|
296
|
+
* One opening (door / window / void) in a bounding wall.
|
|
297
|
+
*
|
|
298
|
+
* | Property | Type | Description |
|
|
299
|
+
* |---|---|---|
|
|
300
|
+
* | `kind` | {@linkcode PluginEnclosureOpeningKind} | `"door"`, `"window"`, or `"void"` |
|
|
301
|
+
* | `component` | {@linkcode ComponentHandle} | The opening entity |
|
|
302
|
+
*/
|
|
303
|
+
export declare const PluginEnclosureOpening: z.ZodObject<{
|
|
304
|
+
kind: z.ZodEnum<{
|
|
305
|
+
void: "void";
|
|
306
|
+
door: "door";
|
|
307
|
+
window: "window";
|
|
308
|
+
}>;
|
|
309
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
310
|
+
}, z.core.$strip>;
|
|
311
|
+
export type PluginEnclosureOpening = z.infer<typeof PluginEnclosureOpening>;
|
|
312
|
+
/**
|
|
313
|
+
* One bounding surface of a space's enclosure.
|
|
314
|
+
*
|
|
315
|
+
* | Property | Type | Description |
|
|
316
|
+
* |---|---|---|
|
|
317
|
+
* | `role` | {@linkcode PluginEnclosureRole} | `"floor"`, `"ceiling"`, or `"wall"` |
|
|
318
|
+
* | `component` | {@linkcode ComponentHandle} | The wall / slab / roof entity |
|
|
319
|
+
* | `faceIndices` | `number[]` | B-rep face indices facing the space. **Always `[]` in geometric v1** (no triangle→face provenance yet) |
|
|
320
|
+
* | `isExternal` | `boolean` | No space on the other side — for a wall, no other room bounds it; for a floor/ceiling, no room caps the storey below/above |
|
|
321
|
+
* | `openings` | {@linkcode PluginEnclosureOpening}`[]` | Doors/windows/voids in the surface (walls only; `[]` for floor/ceiling in v1) |
|
|
322
|
+
*/
|
|
323
|
+
export declare const PluginEnclosureSurface: z.ZodObject<{
|
|
324
|
+
role: z.ZodEnum<{
|
|
325
|
+
floor: "floor";
|
|
326
|
+
wall: "wall";
|
|
327
|
+
ceiling: "ceiling";
|
|
328
|
+
}>;
|
|
329
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
330
|
+
faceIndices: z.ZodArray<z.ZodNumber>;
|
|
331
|
+
isExternal: z.ZodBoolean;
|
|
332
|
+
openings: z.ZodArray<z.ZodObject<{
|
|
333
|
+
kind: z.ZodEnum<{
|
|
334
|
+
void: "void";
|
|
335
|
+
door: "door";
|
|
336
|
+
window: "window";
|
|
337
|
+
}>;
|
|
338
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
339
|
+
}, z.core.$strip>>;
|
|
340
|
+
}, z.core.$strip>;
|
|
341
|
+
export type PluginEnclosureSurface = z.infer<typeof PluginEnclosureSurface>;
|
|
342
|
+
/**
|
|
343
|
+
* A space that neighbours the queried space.
|
|
344
|
+
*
|
|
345
|
+
* | Property | Type | Description |
|
|
346
|
+
* |---|---|---|
|
|
347
|
+
* | `space` | {@linkcode ComponentHandle} | The neighbouring space |
|
|
348
|
+
* | `sharedSurface` | {@linkcode ComponentHandle}` \| null` | The common boundary wall when one is found geometrically, else `null` (e.g. an open-plan or non-physical adjacency) |
|
|
349
|
+
* | `sharedEdgeLength` | `number` | Plan-unit length of the shared boundary — **always `0` in geometric v1** (the adjacency data exposes no edge length) |
|
|
350
|
+
*/
|
|
351
|
+
export declare const PluginAdjacentSpace: z.ZodObject<{
|
|
352
|
+
space: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
353
|
+
sharedSurface: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
354
|
+
sharedEdgeLength: z.ZodNumber;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
export type PluginAdjacentSpace = z.infer<typeof PluginAdjacentSpace>;
|
|
357
|
+
/**
|
|
358
|
+
* Result of {@linkcode PluginDesignQuerySpacesApi.getEnclosure} — the geometric
|
|
359
|
+
* v1 enclosure of a space.
|
|
360
|
+
*
|
|
361
|
+
* | Property | Type | Description |
|
|
362
|
+
* |---|---|---|
|
|
363
|
+
* | `space` | {@linkcode ComponentHandle} | The queried space |
|
|
364
|
+
* | `surfaces` | {@linkcode PluginEnclosureSurface}`[]` | Floor + ceiling + bounding walls, as a flat list (any of the three may be absent when no plan match is found) |
|
|
365
|
+
* | `adjacentSpaces` | {@linkcode PluginAdjacentSpace}`[]` | Neighbouring spaces from the adjacency data (`[]` when adjacency was never computed) |
|
|
366
|
+
*/
|
|
367
|
+
export declare const PluginSpaceEnclosure: z.ZodObject<{
|
|
368
|
+
space: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
369
|
+
surfaces: z.ZodArray<z.ZodObject<{
|
|
370
|
+
role: z.ZodEnum<{
|
|
371
|
+
floor: "floor";
|
|
372
|
+
wall: "wall";
|
|
373
|
+
ceiling: "ceiling";
|
|
374
|
+
}>;
|
|
375
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
376
|
+
faceIndices: z.ZodArray<z.ZodNumber>;
|
|
377
|
+
isExternal: z.ZodBoolean;
|
|
378
|
+
openings: z.ZodArray<z.ZodObject<{
|
|
379
|
+
kind: z.ZodEnum<{
|
|
380
|
+
void: "void";
|
|
381
|
+
door: "door";
|
|
382
|
+
window: "window";
|
|
383
|
+
}>;
|
|
384
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
385
|
+
}, z.core.$strip>>;
|
|
386
|
+
}, z.core.$strip>>;
|
|
387
|
+
adjacentSpaces: z.ZodArray<z.ZodObject<{
|
|
388
|
+
space: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
389
|
+
sharedSurface: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
390
|
+
sharedEdgeLength: z.ZodNumber;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
export type PluginSpaceEnclosure = z.infer<typeof PluginSpaceEnclosure>;
|
|
221
394
|
//# sourceMappingURL=spaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../../../src/api/design/query/spaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAGjE;;;;;;;;;;;GAWG;AACH,8BAAsB,0BAA0B;;IAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;aACa,GAAG,CACjB,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,8BAA8B,CAAC,YAAY,CAAC,GACvD,eAAe,CAAC,gCAAgC,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,YAAY,CAC1B,KAAK,EAAE,eAAe,GACrB,eAAe,CAAC,aAAa,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../../../src/api/design/query/spaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAGjE;;;;;;;;;;;GAWG;AACH,8BAAsB,0BAA0B;;IAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;aACa,GAAG,CACjB,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,8BAA8B,CAAC,YAAY,CAAC,GACvD,eAAe,CAAC,gCAAgC,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,YAAY,CAC1B,KAAK,EAAE,eAAe,GACrB,eAAe,CAAC,aAAa,GAAG,IAAI,CAAC;IAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;aACa,YAAY,CAC1B,KAAK,EAAE,eAAe,GACrB,eAAe,CAAC,oBAAoB,GAAG,IAAI,CAAC;CAChD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC;;iBAE5C,CAAA;AACF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,iCAAiC,CACzC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;EACA,CAAA;AAC/C,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE3C,CAAA;AACF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,gCAAgC,CACxC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uCAAuC;;iBAElD,CAAA;AACF,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,uCAAuC,CAC/C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;EAAuC,CAAA;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE,qDAAqD;AACrD,eAAO,MAAM,0BAA0B;;;;EAAqC,CAAA;AAC5E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB;;;;;;;iBAGjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;iBAMjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;iBAI/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -2,6 +2,109 @@ import * as z from "zod";
|
|
|
2
2
|
import { PluginApiReturn } from "../../../types";
|
|
3
3
|
import { ComponentHandle } from "../../../handles";
|
|
4
4
|
import { PluginDesignChangeResult } from "../lock";
|
|
5
|
+
/**
|
|
6
|
+
* The entity kinds {@linkcode PluginDesignSelectionApi.setByFilter} can select —
|
|
7
|
+
* the union of the editor's "Filter selection" menus (Design tab + BIM tab).
|
|
8
|
+
* Tokens mirror {@linkcode PluginEntityType} where a kind exists on the query
|
|
9
|
+
* surface; the rest are selection-only kinds the query surface cannot reach
|
|
10
|
+
* (layer-backed and annotation objects).
|
|
11
|
+
*
|
|
12
|
+
* | Value | Entity (menu label) |
|
|
13
|
+
* |---|---|
|
|
14
|
+
* | `"wall"` | Wall |
|
|
15
|
+
* | `"slab"` | Floor slab |
|
|
16
|
+
* | `"floor"` | Flooring |
|
|
17
|
+
* | `"door"` | Door |
|
|
18
|
+
* | `"window"` | Window |
|
|
19
|
+
* | `"beam"` | Beam |
|
|
20
|
+
* | `"column"` | Column |
|
|
21
|
+
* | `"ceiling"` | Ceiling |
|
|
22
|
+
* | `"roof"` | Roof |
|
|
23
|
+
* | `"staircase"` | Staircase |
|
|
24
|
+
* | `"furniture"` | Furniture |
|
|
25
|
+
* | `"pergola"` | Pergola |
|
|
26
|
+
* | `"sunshade"` | Sunshade |
|
|
27
|
+
* | `"referenceLine"` | Reference line |
|
|
28
|
+
* | `"space"` | Space (room mass) |
|
|
29
|
+
* | `"site"` | Site |
|
|
30
|
+
* | `"terrain"` | Terrain |
|
|
31
|
+
* | `"cad"` | CAD import |
|
|
32
|
+
* | `"pdf"` | PDF import |
|
|
33
|
+
* | `"image"` | Image import |
|
|
34
|
+
* | `"dimensionLine"` | Dimension line |
|
|
35
|
+
* | `"model3d"` | Imported 3D model |
|
|
36
|
+
* | `"neighborhoodBuilding"` | Neighborhood building |
|
|
37
|
+
* | `"programBlock"` | Program block (department mass) |
|
|
38
|
+
*/
|
|
39
|
+
export declare const PluginSelectionEntityType: z.ZodEnum<{
|
|
40
|
+
terrain: "terrain";
|
|
41
|
+
floor: "floor";
|
|
42
|
+
wall: "wall";
|
|
43
|
+
ceiling: "ceiling";
|
|
44
|
+
image: "image";
|
|
45
|
+
cad: "cad";
|
|
46
|
+
pdf: "pdf";
|
|
47
|
+
door: "door";
|
|
48
|
+
window: "window";
|
|
49
|
+
furniture: "furniture";
|
|
50
|
+
space: "space";
|
|
51
|
+
slab: "slab";
|
|
52
|
+
roof: "roof";
|
|
53
|
+
column: "column";
|
|
54
|
+
beam: "beam";
|
|
55
|
+
staircase: "staircase";
|
|
56
|
+
referenceLine: "referenceLine";
|
|
57
|
+
pergola: "pergola";
|
|
58
|
+
sunshade: "sunshade";
|
|
59
|
+
site: "site";
|
|
60
|
+
dimensionLine: "dimensionLine";
|
|
61
|
+
model3d: "model3d";
|
|
62
|
+
neighborhoodBuilding: "neighborhoodBuilding";
|
|
63
|
+
programBlock: "programBlock";
|
|
64
|
+
}>;
|
|
65
|
+
export type PluginSelectionEntityType = z.infer<typeof PluginSelectionEntityType>;
|
|
66
|
+
/**
|
|
67
|
+
* The filter for {@linkcode PluginDesignSelectionApi.setByFilter}. At least one
|
|
68
|
+
* field must be non-empty (to empty the selection use
|
|
69
|
+
* {@linkcode PluginDesignSelectionApi.clear}). Fields **AND**-combine; values
|
|
70
|
+
* within a field **OR**-combine — `{ storeys: [2], types: ["furniture"] }`
|
|
71
|
+
* selects only the furniture on storey 2.
|
|
72
|
+
*
|
|
73
|
+
* | Field | Type | Selects entities where |
|
|
74
|
+
* |---|---|---|
|
|
75
|
+
* | `storeys` | `number[]` | storey/floor level ∈ `storeys` (negative = basement) |
|
|
76
|
+
* | `types` | {@linkcode PluginSelectionEntityType}`[]` | entity kind ∈ `types` |
|
|
77
|
+
*/
|
|
78
|
+
export declare const PluginSelectionFilter: z.ZodObject<{
|
|
79
|
+
storeys: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
80
|
+
types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
81
|
+
terrain: "terrain";
|
|
82
|
+
floor: "floor";
|
|
83
|
+
wall: "wall";
|
|
84
|
+
ceiling: "ceiling";
|
|
85
|
+
image: "image";
|
|
86
|
+
cad: "cad";
|
|
87
|
+
pdf: "pdf";
|
|
88
|
+
door: "door";
|
|
89
|
+
window: "window";
|
|
90
|
+
furniture: "furniture";
|
|
91
|
+
space: "space";
|
|
92
|
+
slab: "slab";
|
|
93
|
+
roof: "roof";
|
|
94
|
+
column: "column";
|
|
95
|
+
beam: "beam";
|
|
96
|
+
staircase: "staircase";
|
|
97
|
+
referenceLine: "referenceLine";
|
|
98
|
+
pergola: "pergola";
|
|
99
|
+
sunshade: "sunshade";
|
|
100
|
+
site: "site";
|
|
101
|
+
dimensionLine: "dimensionLine";
|
|
102
|
+
model3d: "model3d";
|
|
103
|
+
neighborhoodBuilding: "neighborhoodBuilding";
|
|
104
|
+
programBlock: "programBlock";
|
|
105
|
+
}>>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export type PluginSelectionFilter = z.infer<typeof PluginSelectionFilter>;
|
|
5
108
|
/**
|
|
6
109
|
* `snaptrude.design.selection` — read and mutate the current scene selection.
|
|
7
110
|
*
|
|
@@ -115,6 +218,47 @@ export declare abstract class PluginDesignSelectionApi {
|
|
|
115
218
|
* ```
|
|
116
219
|
*/
|
|
117
220
|
abstract clear(): PluginApiReturn<PluginDesignChangeResult>;
|
|
221
|
+
/**
|
|
222
|
+
* Replace the selection with every visible entity of the active building that
|
|
223
|
+
* matches the filter — the programmatic equivalent of the editor's
|
|
224
|
+
* **Story selection** (`storeys`) and **Filter selection** (`types`) menus
|
|
225
|
+
* under the select tool, including their combination (fields AND, values
|
|
226
|
+
* within a field OR). Reaches selection-only kinds the query surface cannot
|
|
227
|
+
* (sites, terrain, CAD/PDF/image imports, dimension lines, 3D models,
|
|
228
|
+
* neighborhood buildings) and selects whole groups the way the editor does.
|
|
229
|
+
*
|
|
230
|
+
* This is a one-shot bulk select, not a persistent mode: the user's next
|
|
231
|
+
* canvas click resets the underlying filter state (the selection it made
|
|
232
|
+
* stays until changed). Results honor the ambient view — active building,
|
|
233
|
+
* hidden objects/buckets, and in 2D the active storey.
|
|
234
|
+
*
|
|
235
|
+
* @param filter Which entities to select — {@linkcode PluginSelectionFilter};
|
|
236
|
+
* at least one field must be non-empty
|
|
237
|
+
* @returns The resulting selection snapshot
|
|
238
|
+
*
|
|
239
|
+
* @examplePrompt Select everything on storey 2
|
|
240
|
+
* @examplePrompt Select all the walls and doors
|
|
241
|
+
* @examplePrompt Story selection: select the ground floor and first floor
|
|
242
|
+
* @examplePrompt Filter selection: select all furniture in the model
|
|
243
|
+
* @examplePrompt Select only the furniture on the second storey
|
|
244
|
+
* @examplePrompt Select all the spaces so I can recolor them
|
|
245
|
+
*
|
|
246
|
+
* # Example
|
|
247
|
+
* ```ts
|
|
248
|
+
* // "Story selection": everything on storeys 1 and 2
|
|
249
|
+
* await snaptrude.design.selection.setByFilter({ storeys: [1, 2] })
|
|
250
|
+
*
|
|
251
|
+
* // "Filter selection": all walls and doors
|
|
252
|
+
* await snaptrude.design.selection.setByFilter({ types: ["wall", "door"] })
|
|
253
|
+
*
|
|
254
|
+
* // Combined: only the furniture on storey 2
|
|
255
|
+
* const { affected } = await snaptrude.design.selection.setByFilter({
|
|
256
|
+
* storeys: [2],
|
|
257
|
+
* types: ["furniture"],
|
|
258
|
+
* })
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
abstract setByFilter(filter: PluginSelectionFilter): PluginApiReturn<PluginDesignChangeResult>;
|
|
118
262
|
}
|
|
119
263
|
/**
|
|
120
264
|
* Arguments for {@linkcode PluginDesignSelectionApi.set}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/selection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;GAQG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;;;OAqBG;aACa,GAAG,IAAI,eAAe,CAAC,eAAe,EAAE,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC;IAE7F;;;;;;;;;;;;;;;;;;;OAmBG;aACa,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC;IAE7F;;;;;;;;;;;;;;;;;;OAkBG;aACa,MAAM,CACpB,UAAU,EAAE,eAAe,EAAE,GAC5B,eAAe,CAAC,wBAAwB,CAAC;IAE5C;;;;;;;;;;;;;;;OAeG;aACa,KAAK,IAAI,eAAe,CAAC,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/selection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;EAyBpC,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEjF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ9B,CAAA;AACJ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;;;GAQG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;;;OAqBG;aACa,GAAG,IAAI,eAAe,CAAC,eAAe,EAAE,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC;IAE7F;;;;;;;;;;;;;;;;;;;OAmBG;aACa,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC;IAE7F;;;;;;;;;;;;;;;;;;OAkBG;aACa,MAAM,CACpB,UAAU,EAAE,eAAe,EAAE,GAC5B,eAAe,CAAC,wBAAwB,CAAC;IAE5C;;;;;;;;;;;;;;;OAeG;aACa,KAAK,IAAI,eAAe,CAAC,wBAAwB,CAAC;IAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;aACa,WAAW,CACzB,MAAM,EAAE,qBAAqB,GAC5B,eAAe,CAAC,wBAAwB,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF,eAAO,MAAM,4BAA4B;;iBAA+B,CAAA;AACxE,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF,eAAO,MAAM,+BAA+B;;iBAA+B,CAAA;AAC3E,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA"}
|
|
@@ -5,11 +5,13 @@ import { PluginDesignChangeResult } from "../lock";
|
|
|
5
5
|
/**
|
|
6
6
|
* `snaptrude.design.transform` — rigid transforms on scene entities.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* `move` / `rotate` migrated from the removed `tools.transform.*`; `align` snaps a
|
|
9
|
+
* set of components' bounding-box edges to each other (or to a reference); `mirror`
|
|
10
|
+
* flips components in place about a horizontal axis. All ops are undoable and return
|
|
9
11
|
* {@linkcode PluginDesignChangeResult} `{ affected }`; failures throw (RPC rejects).
|
|
10
12
|
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
+
* `getPosition` / `setPosition` (and `scale`, an engine gap) are NOT in this surface
|
|
14
|
+
* yet — they are a later pass.
|
|
13
15
|
*/
|
|
14
16
|
export declare abstract class PluginDesignTransformApi {
|
|
15
17
|
constructor();
|
|
@@ -28,6 +30,9 @@ export declare abstract class PluginDesignTransformApi {
|
|
|
28
30
|
* @examplePrompt Translate the furniture block by (10, 0, 5)
|
|
29
31
|
* @examplePrompt Move these masses up one storey
|
|
30
32
|
*
|
|
33
|
+
* @performance Array API — one host round-trip for the whole set. Pass every target in a
|
|
34
|
+
* single call; never loop `design.transform.move` per entity.
|
|
35
|
+
*
|
|
31
36
|
* # Example
|
|
32
37
|
* ```ts
|
|
33
38
|
* const { vec3 } = snaptrude.core.math
|
|
@@ -39,37 +44,155 @@ export declare abstract class PluginDesignTransformApi {
|
|
|
39
44
|
trackParentChange?: boolean;
|
|
40
45
|
}): PluginApiReturn<PluginDesignChangeResult>;
|
|
41
46
|
/**
|
|
42
|
-
* Rotate entities by a **signed angle in DEGREES
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
47
|
+
* Rotate entities by a **signed angle in DEGREES** (positive = CCW about +Y).
|
|
48
|
+
* The pivot defaults to the combined bounding-box centre; pass `options.pivot`
|
|
49
|
+
* to rotate about an explicit world-space point instead. NOTE: unlike the
|
|
50
|
+
* removed `tools.transform.rotate` (radians), this canonical form takes
|
|
51
|
+
* DEGREES. Undoable.
|
|
46
52
|
*
|
|
47
53
|
* @param components - Entities to rotate
|
|
48
54
|
* @param angleInDegrees - Signed rotation angle in degrees
|
|
49
|
-
* @param options - `axis` (defaults to world +Y), `
|
|
55
|
+
* @param options - `axis` (defaults to world +Y), `pivot` (world-space rotation
|
|
56
|
+
* centre as a {@linkcode Vec3Handle}; defaults to the combined bbox centre),
|
|
57
|
+
* `is2D`
|
|
50
58
|
* @returns {@linkcode PluginDesignChangeResult}
|
|
51
59
|
*
|
|
52
60
|
* @examplePrompt Rotate the selected building 90 degrees
|
|
53
61
|
* @examplePrompt Turn this room 45 degrees clockwise
|
|
54
62
|
* @examplePrompt Spin the furniture block 180 degrees about its centre
|
|
55
63
|
* @examplePrompt Rotate these masses 30 degrees around the vertical axis
|
|
64
|
+
* @examplePrompt Rotate these walls 90 degrees about the origin
|
|
65
|
+
*
|
|
66
|
+
* @performance Array API — one host round-trip for the whole set. Pass every target in a
|
|
67
|
+
* single call; never loop `design.transform.rotate` per entity.
|
|
56
68
|
*
|
|
57
69
|
* # Example
|
|
58
70
|
* ```ts
|
|
59
71
|
* await snaptrude.design.transform.rotate(["space-id"], 90)
|
|
72
|
+
* // …or rotate about an explicit pivot point
|
|
73
|
+
* const { vec3 } = snaptrude.core.math
|
|
74
|
+
* await snaptrude.design.transform.rotate(["space-id"], 90, { pivot: vec3.new(0, 0, 0) })
|
|
60
75
|
* ```
|
|
61
76
|
*/
|
|
62
77
|
abstract rotate(components: ComponentHandle[], angleInDegrees: number, options?: {
|
|
63
78
|
axis?: Vec3Handle;
|
|
79
|
+
pivot?: Vec3Handle;
|
|
64
80
|
is2D?: boolean;
|
|
65
81
|
}): PluginApiReturn<PluginDesignChangeResult>;
|
|
82
|
+
/**
|
|
83
|
+
* Align a set of components by snapping one bounding-box edge to a common value
|
|
84
|
+
* — the classic Left/Center/Right/Top/Middle/Bottom align. Purely **world-axis**
|
|
85
|
+
* (deterministic and headless — the UI's camera-relative remap is bypassed):
|
|
86
|
+
*
|
|
87
|
+
* - `left` / `right` / `center` → world **X** min / max / mid
|
|
88
|
+
* - `top` / `bottom` / `middle` → world **Z** max / min / mid
|
|
89
|
+
*
|
|
90
|
+
* There is **no vertical (Y) alignment** in v1 (the UI only reaches it via a
|
|
91
|
+
* side-elevation camera remap, which this API does not replicate). Doors and
|
|
92
|
+
* windows are **rejected** in v1 — if any component in `components` (or the
|
|
93
|
+
* `reference`) is a door or window, the whole call **throws**; nothing is
|
|
94
|
+
* silently dropped. A group aligns as **one rigid body** (its whole-group
|
|
95
|
+
* bounding box moves together). Undoable.
|
|
96
|
+
*
|
|
97
|
+
* Requires **at least 2 components** unless a `reference` is supplied; with a
|
|
98
|
+
* reference, every component aligns to that reference's edge (the reference does
|
|
99
|
+
* not move) and a single component is allowed. Y (height) is preserved.
|
|
100
|
+
*
|
|
101
|
+
* @param components - Entities to align (≥2 without a `reference`)
|
|
102
|
+
* @param edge - Which bounding-box edge to snap ({@linkcode PluginAlignEdge})
|
|
103
|
+
* @param options - `reference`: a component whose edge is the fixed target
|
|
104
|
+
* @returns {@linkcode PluginDesignChangeResult}
|
|
105
|
+
*
|
|
106
|
+
* @examplePrompt Align the selected rooms to the left
|
|
107
|
+
* @examplePrompt Line up these masses along their top edges
|
|
108
|
+
* @examplePrompt Center these columns horizontally
|
|
109
|
+
* @examplePrompt Align all the walls to the left edge of this reference wall
|
|
110
|
+
* @examplePrompt Snap the bottom edges of these spaces together
|
|
111
|
+
*
|
|
112
|
+
* @performance Array API — one host round-trip for the whole set. Pass every target in a
|
|
113
|
+
* single call; never loop `design.transform.align` per entity.
|
|
114
|
+
*
|
|
115
|
+
* # Example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const rooms = await snaptrude.design.selection.get()
|
|
118
|
+
* // align every room's left (world -X) edge to a common minimum
|
|
119
|
+
* await snaptrude.design.transform.align(rooms, "left")
|
|
120
|
+
* // …or align them to a fixed reference component's left edge
|
|
121
|
+
* const [anchor] = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
122
|
+
* await snaptrude.design.transform.align(rooms, "left", { reference: anchor })
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
abstract align(components: ComponentHandle[], edge: PluginAlignEdge, options?: {
|
|
126
|
+
reference?: ComponentHandle;
|
|
127
|
+
}): PluginApiReturn<PluginDesignChangeResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Mirror components **in place** about a horizontal axis, flipping their geometry
|
|
130
|
+
* across that axis through the combined bounding-box centre (the mesh's
|
|
131
|
+
* world-matrix flip + brep inversion + CAD/dimension-line/parametric handling
|
|
132
|
+
* commit atomically). Nothing moves off-centre — this is the toolbar "flip", not
|
|
133
|
+
* a translate-and-reflect. Undoable.
|
|
134
|
+
*
|
|
135
|
+
* `axis` names the axis the geometry mirrors **across** (world axes, Y is up):
|
|
136
|
+
* - `'x'` — mirror across world X (a front↔back flip in plan; reflects the Z coord)
|
|
137
|
+
* - `'z'` — mirror across world Z (a left↔right flip in plan; reflects the X coord)
|
|
138
|
+
*
|
|
139
|
+
* Vertical (`'y'`) mirroring is intentionally not exposed. Locked, bucket-locked
|
|
140
|
+
* and ineligible entries (terrain, plinths, reference/dimension lines,
|
|
141
|
+
* neighbourhood buildings) are **silently dropped**; the call only throws if
|
|
142
|
+
* nothing mirrorable remains. `affected` echoes the supplied handles.
|
|
143
|
+
*
|
|
144
|
+
* @param components - Entities to mirror (≥1)
|
|
145
|
+
* @param axis - Axis to mirror across ({@linkcode PluginTransformMirrorAxis})
|
|
146
|
+
* @returns {@linkcode PluginDesignChangeResult}
|
|
147
|
+
*
|
|
148
|
+
* @examplePrompt Mirror the selected building across the x axis
|
|
149
|
+
* @examplePrompt Flip these rooms left to right
|
|
150
|
+
* @examplePrompt Mirror this furniture block horizontally
|
|
151
|
+
* @examplePrompt Flip the selected walls front to back
|
|
152
|
+
* @examplePrompt Create a mirror image of these masses about the z axis
|
|
153
|
+
*
|
|
154
|
+
* @performance Array API — one host round-trip for the whole set. Pass every target in a
|
|
155
|
+
* single call; never loop `design.transform.mirror` per entity.
|
|
156
|
+
*
|
|
157
|
+
* # Example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const rooms = await snaptrude.design.selection.get()
|
|
160
|
+
* await snaptrude.design.transform.mirror(rooms, "x")
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
abstract mirror(components: ComponentHandle[], axis: PluginTransformMirrorAxis): PluginApiReturn<PluginDesignChangeResult>;
|
|
66
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* The horizontal axis a {@linkcode PluginDesignTransformApi.mirror} flips **across**
|
|
167
|
+
* (world axes, Y up): `'x'` mirrors across world X (front↔back in plan; reflects Z),
|
|
168
|
+
* `'z'` mirrors across world Z (left↔right in plan; reflects X). Vertical (`'y'`)
|
|
169
|
+
* mirroring is not exposed.
|
|
170
|
+
*/
|
|
171
|
+
export declare const PluginTransformMirrorAxis: z.ZodEnum<{
|
|
172
|
+
x: "x";
|
|
173
|
+
z: "z";
|
|
174
|
+
}>;
|
|
175
|
+
export type PluginTransformMirrorAxis = z.infer<typeof PluginTransformMirrorAxis>;
|
|
176
|
+
/**
|
|
177
|
+
* The bounding-box edge an {@linkcode PluginDesignTransformApi.align} snaps to.
|
|
178
|
+
* Mirrors the engine's align `DirectionType`. World-axis mapping: `left`/`right`/`center`
|
|
179
|
+
* → world X min/max/mid; `top`/`bottom`/`middle` → world Z max/min/mid.
|
|
180
|
+
*/
|
|
181
|
+
export declare const PluginAlignEdge: z.ZodEnum<{
|
|
182
|
+
center: "center";
|
|
183
|
+
top: "top";
|
|
184
|
+
left: "left";
|
|
185
|
+
right: "right";
|
|
186
|
+
bottom: "bottom";
|
|
187
|
+
middle: "middle";
|
|
188
|
+
}>;
|
|
189
|
+
export type PluginAlignEdge = z.infer<typeof PluginAlignEdge>;
|
|
67
190
|
/**
|
|
68
191
|
* Arguments for {@linkcode PluginDesignTransformApi.move} (options flattened).
|
|
69
192
|
*/
|
|
70
193
|
export declare const PluginDesignMoveArgs: z.ZodObject<{
|
|
71
194
|
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
72
|
-
displacement: z.ZodPipe<z.
|
|
195
|
+
displacement: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
|
|
73
196
|
is2D: z.ZodOptional<z.ZodBoolean>;
|
|
74
197
|
trackParentChange: z.ZodOptional<z.ZodBoolean>;
|
|
75
198
|
}, z.core.$strip>;
|
|
@@ -80,8 +203,47 @@ export type PluginDesignMoveArgs = z.infer<typeof PluginDesignMoveArgs>;
|
|
|
80
203
|
export declare const PluginDesignRotateArgs: z.ZodObject<{
|
|
81
204
|
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
82
205
|
angleInDegrees: z.ZodNumber;
|
|
83
|
-
axis: z.ZodOptional<z.ZodPipe<z.
|
|
206
|
+
axis: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
84
207
|
is2D: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
pivot: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
85
209
|
}, z.core.$strip>;
|
|
86
210
|
export type PluginDesignRotateArgs = z.infer<typeof PluginDesignRotateArgs>;
|
|
211
|
+
/**
|
|
212
|
+
* Arguments for {@linkcode PluginDesignTransformApi.align} (options flattened).
|
|
213
|
+
*
|
|
214
|
+
* | Property | Type | Description |
|
|
215
|
+
* |---|---|---|
|
|
216
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to align (≥2 unless `reference` is set — host-enforced) |
|
|
217
|
+
* | `edge` | {@linkcode PluginAlignEdge} | Which bounding-box edge to snap |
|
|
218
|
+
* | `reference` | {@linkcode ComponentHandle} | A fixed component whose edge is the target (optional) |
|
|
219
|
+
*/
|
|
220
|
+
export declare const PluginDesignAlignArgs: z.ZodObject<{
|
|
221
|
+
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
222
|
+
edge: z.ZodEnum<{
|
|
223
|
+
center: "center";
|
|
224
|
+
top: "top";
|
|
225
|
+
left: "left";
|
|
226
|
+
right: "right";
|
|
227
|
+
bottom: "bottom";
|
|
228
|
+
middle: "middle";
|
|
229
|
+
}>;
|
|
230
|
+
reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
export type PluginDesignAlignArgs = z.infer<typeof PluginDesignAlignArgs>;
|
|
233
|
+
/**
|
|
234
|
+
* Arguments for {@linkcode PluginDesignTransformApi.mirror}.
|
|
235
|
+
*
|
|
236
|
+
* | Property | Type | Description |
|
|
237
|
+
* |---|---|---|
|
|
238
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to mirror (≥1) |
|
|
239
|
+
* | `axis` | {@linkcode PluginTransformMirrorAxis} | Horizontal axis to mirror across (`'x'` \| `'z'`) |
|
|
240
|
+
*/
|
|
241
|
+
export declare const PluginDesignMirrorArgs: z.ZodObject<{
|
|
242
|
+
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
243
|
+
axis: z.ZodEnum<{
|
|
244
|
+
x: "x";
|
|
245
|
+
z: "z";
|
|
246
|
+
}>;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
export type PluginDesignMirrorArgs = z.infer<typeof PluginDesignMirrorArgs>;
|
|
87
249
|
//# sourceMappingURL=index.d.ts.map
|