@snaptrude/plugin-core 0.5.0 → 0.6.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/CHANGELOG.md +52 -0
- package/api-manifest.full.json +2044 -443
- package/api-manifest.json +2051 -394
- package/dist/api/analysis/heatmaps.d.ts +234 -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 +44 -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/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/core/index.d.ts +5 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +392 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +35 -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 +206 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +286 -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/design/create/index.d.ts +9 -0
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +3 -3
- package/dist/api/design/selection/index.d.ts +144 -0
- package/dist/api/design/selection/index.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +2 -2
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +84 -0
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/handles.d.ts +33 -0
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +1335 -987
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1278 -983
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/generate-manifest.test.mjs +26 -4
- package/src/api/analysis/heatmaps.ts +256 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +46 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/core/index.ts +5 -0
- package/src/api/core/io/import/index.ts +432 -0
- package/src/api/core/io/index.ts +37 -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 +214 -0
- package/src/api/core/io/underlay/index.ts +295 -0
- package/src/api/design/create/index.ts +9 -0
- package/src/api/design/erase/index.ts +1 -1
- package/src/api/design/selection/index.ts +129 -0
- package/src/api/index.ts +5 -0
- package/src/api/program/site.ts +93 -0
- package/src/handles.ts +46 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../../../types";
|
|
3
|
+
import { TerrainHandle } from "../../../../handles";
|
|
4
|
+
/**
|
|
5
|
+
* Terrain — inspect and manage the project's site terrain (the singleton created
|
|
6
|
+
* by `core.io.import.terrain`).
|
|
7
|
+
*
|
|
8
|
+
* There is at most one terrain per project. These methods read and edit it: the
|
|
9
|
+
* vertical **datum**, elevation/satellite layers, opacity, the cut/fill report,
|
|
10
|
+
* and removal. All edits are undoable.
|
|
11
|
+
*
|
|
12
|
+
* ## Datum
|
|
13
|
+
* The **datum** is the terrain's vertical position relative to where it was
|
|
14
|
+
* imported. {@link PluginCoreIoTerrainApi.setDatum} shifts the whole terrain
|
|
15
|
+
* vertically by a **relative** offset (each call moves it further — calls are
|
|
16
|
+
* cumulative, not absolute); {@link PluginCoreIoTerrainApi.getDatum} reads the
|
|
17
|
+
* current vertical offset from the imported position.
|
|
18
|
+
*
|
|
19
|
+
* Accessed via `snaptrude.core.io.terrain`.
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class PluginCoreIoTerrainApi {
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Whether the project has a site terrain.
|
|
25
|
+
*
|
|
26
|
+
* @examplePrompt Does this project have site terrain?
|
|
27
|
+
* @examplePrompt Is there a terrain imported?
|
|
28
|
+
* @examplePrompt Check if the site topography exists
|
|
29
|
+
* @examplePrompt Has a terrain been added yet?
|
|
30
|
+
*
|
|
31
|
+
* # Example
|
|
32
|
+
* ```ts
|
|
33
|
+
* if (!(await snaptrude.core.io.terrain.exists())) {
|
|
34
|
+
* await snaptrude.core.io.import.terrain(40.7128, -74.006, 300, 300)
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
abstract exists(): PluginApiReturn<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Resolve the project's terrain handle, or `null` if there is none. The same
|
|
41
|
+
* handle {@link core.io.import.terrain} returns — use it to obtain the handle
|
|
42
|
+
* without re-importing.
|
|
43
|
+
*
|
|
44
|
+
* @examplePrompt Get the terrain handle
|
|
45
|
+
* @examplePrompt Give me the site terrain
|
|
46
|
+
* @examplePrompt Fetch the current terrain
|
|
47
|
+
* @examplePrompt Return the topography handle if it exists
|
|
48
|
+
*/
|
|
49
|
+
abstract get(): PluginApiReturn<TerrainHandle | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Read the terrain's current vertical position (world Y, internal units).
|
|
52
|
+
* `null` if there is no terrain. Import places the terrain so its highest
|
|
53
|
+
* point sits at `y = 0`, so a never-shifted terrain reads a negative
|
|
54
|
+
* baseline, not `0`; each {@link PluginCoreIoTerrainApi.setDatum} shift
|
|
55
|
+
* moves this value.
|
|
56
|
+
*
|
|
57
|
+
* @examplePrompt What's the terrain's datum?
|
|
58
|
+
* @examplePrompt Read the current site elevation reference
|
|
59
|
+
* @examplePrompt Get the terrain vertical offset
|
|
60
|
+
* @examplePrompt How far has the datum been shifted?
|
|
61
|
+
*/
|
|
62
|
+
abstract getDatum(): PluginApiReturn<number | null>;
|
|
63
|
+
/**
|
|
64
|
+
* Shift the terrain's **datum** — move the whole terrain vertically DOWN by
|
|
65
|
+
* `offset` (internal units) from its current position; pass a negative value to
|
|
66
|
+
* raise it. Undoable.
|
|
67
|
+
*
|
|
68
|
+
* **Relative and cumulative**, not absolute: `setDatum(5)` called twice shifts
|
|
69
|
+
* the terrain down by 10 total, it does not settle at a fixed level. Read the
|
|
70
|
+
* terrain's resulting vertical position (world Y — not the accumulated
|
|
71
|
+
* shift) back with {@link PluginCoreIoTerrainApi.getDatum}.
|
|
72
|
+
*
|
|
73
|
+
* @param offset - How far to shift the terrain down, in internal units
|
|
74
|
+
* (negative raises it).
|
|
75
|
+
* @throws if writes are disabled, there is no terrain, or the terrain is
|
|
76
|
+
* **locked** (unlock it in the app first).
|
|
77
|
+
*
|
|
78
|
+
* @examplePrompt Shift the terrain datum down by 12
|
|
79
|
+
* @examplePrompt Lower the site terrain by 10
|
|
80
|
+
* @examplePrompt Raise the terrain a little
|
|
81
|
+
* @examplePrompt Nudge the terrain datum down
|
|
82
|
+
*
|
|
83
|
+
* # Example
|
|
84
|
+
* ```ts
|
|
85
|
+
* await snaptrude.core.io.terrain.setDatum(12) // shift terrain down by 12 (relative)
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
abstract setDatum(offset: number): PluginApiReturn<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Delete the site terrain. Undoable.
|
|
91
|
+
*
|
|
92
|
+
* @throws if writes are disabled, there is no terrain, or the terrain is
|
|
93
|
+
* **locked** (unlock it in the app first).
|
|
94
|
+
*
|
|
95
|
+
* @examplePrompt Delete the site terrain
|
|
96
|
+
* @examplePrompt Remove the topography
|
|
97
|
+
* @examplePrompt Clear the imported site
|
|
98
|
+
* @examplePrompt Get rid of the terrain
|
|
99
|
+
*/
|
|
100
|
+
abstract delete(): PluginApiReturn<void>;
|
|
101
|
+
/**
|
|
102
|
+
* The terrain cut/fill earthwork report — cut, fill, and net volumes — or
|
|
103
|
+
* `null` if there is no terrain.
|
|
104
|
+
*
|
|
105
|
+
* @examplePrompt What are the cut and fill volumes for the site?
|
|
106
|
+
* @examplePrompt Get the terrain earthwork report
|
|
107
|
+
* @examplePrompt How much cut and fill does the grading need?
|
|
108
|
+
* @examplePrompt Show the net volume of the terrain edits
|
|
109
|
+
*
|
|
110
|
+
* # Example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const r = await snaptrude.core.io.terrain.getReport()
|
|
113
|
+
* if (r) console.log(`cut ${r.cutVolume}, fill ${r.fillVolume}, net ${r.netVolume}`)
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
abstract getReport(): PluginApiReturn<TerrainReport | null>;
|
|
117
|
+
/** Whether terrain elevation (DEM height) is on. `null` if no terrain. */
|
|
118
|
+
abstract isElevationEnabled(): PluginApiReturn<boolean | null>;
|
|
119
|
+
/**
|
|
120
|
+
* Turn terrain elevation (DEM height) ON — a real 3D topography surface. Undoable.
|
|
121
|
+
* @throws if writes are disabled, there is no terrain, or the terrain is
|
|
122
|
+
* **locked** (unlock it in the app first).
|
|
123
|
+
* @examplePrompt Turn on terrain elevation
|
|
124
|
+
* @examplePrompt Enable the site heightmap
|
|
125
|
+
* @examplePrompt Make the terrain 3D
|
|
126
|
+
* @examplePrompt Show the topography relief
|
|
127
|
+
*/
|
|
128
|
+
abstract enableElevation(): PluginApiReturn<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Turn terrain elevation OFF — flatten to a plane. Undoable.
|
|
131
|
+
* @throws if writes are disabled, there is no terrain, or the terrain is
|
|
132
|
+
* **locked** (unlock it in the app first).
|
|
133
|
+
* @examplePrompt Flatten the terrain
|
|
134
|
+
* @examplePrompt Turn off site elevation
|
|
135
|
+
* @examplePrompt Disable the heightmap
|
|
136
|
+
* @examplePrompt Make the terrain flat
|
|
137
|
+
*/
|
|
138
|
+
abstract disableElevation(): PluginApiReturn<void>;
|
|
139
|
+
/** Whether satellite imagery is draped on the terrain. `null` if no terrain. */
|
|
140
|
+
abstract isSatelliteEnabled(): PluginApiReturn<boolean | null>;
|
|
141
|
+
/**
|
|
142
|
+
* Turn satellite imagery ON. Undoable.
|
|
143
|
+
* @throws if writes are disabled, there is no terrain, or the terrain is
|
|
144
|
+
* **locked** (unlock it in the app first).
|
|
145
|
+
* @examplePrompt Show satellite imagery on the site
|
|
146
|
+
* @examplePrompt Enable the satellite texture
|
|
147
|
+
* @examplePrompt Turn on aerial imagery
|
|
148
|
+
* @examplePrompt Drape satellite over the terrain
|
|
149
|
+
*/
|
|
150
|
+
abstract enableSatellite(): PluginApiReturn<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Turn satellite imagery OFF. Undoable.
|
|
153
|
+
* @throws if writes are disabled, there is no terrain, or the terrain is
|
|
154
|
+
* **locked** (unlock it in the app first).
|
|
155
|
+
* @examplePrompt Hide the satellite imagery
|
|
156
|
+
* @examplePrompt Turn off the aerial texture
|
|
157
|
+
* @examplePrompt Disable satellite on the site
|
|
158
|
+
* @examplePrompt Remove the satellite drape
|
|
159
|
+
*/
|
|
160
|
+
abstract disableSatellite(): PluginApiReturn<void>;
|
|
161
|
+
/** Read the terrain opacity, `0`..`1`, or `null` if no terrain. */
|
|
162
|
+
abstract getOpacity(): PluginApiReturn<number | null>;
|
|
163
|
+
/**
|
|
164
|
+
* Set the terrain opacity (`0` transparent .. `1` opaque). Undoable.
|
|
165
|
+
* @param opacity - Target opacity, `0`..`1`.
|
|
166
|
+
* @throws if writes are disabled, there is no terrain, or the terrain is
|
|
167
|
+
* **locked** (unlock it in the app first).
|
|
168
|
+
* @examplePrompt Fade the terrain to 50%
|
|
169
|
+
* @examplePrompt Make the site semi-transparent
|
|
170
|
+
* @examplePrompt Set terrain opacity to 0.3
|
|
171
|
+
* @examplePrompt Dim the topography
|
|
172
|
+
*
|
|
173
|
+
* # Example
|
|
174
|
+
* ```ts
|
|
175
|
+
* await snaptrude.core.io.terrain.setOpacity(0.5)
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
abstract setOpacity(opacity: number): PluginApiReturn<void>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Terrain cut/fill earthwork report. Volumes are in the **project's display
|
|
182
|
+
* volume unit** (what the UI shows), not internal units.
|
|
183
|
+
*
|
|
184
|
+
* | Property | Type | Description |
|
|
185
|
+
* |---|---|---|
|
|
186
|
+
* | `cutVolume` | `number` | Total excavated (cut) volume |
|
|
187
|
+
* | `fillVolume` | `number` | Total added (fill) volume |
|
|
188
|
+
* | `netVolume` | `number` | Net volume (`fill − cut`) |
|
|
189
|
+
*/
|
|
190
|
+
export declare const TerrainReport: z.ZodObject<{
|
|
191
|
+
cutVolume: z.ZodNumber;
|
|
192
|
+
fillVolume: z.ZodNumber;
|
|
193
|
+
netVolume: z.ZodNumber;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
export type TerrainReport = z.infer<typeof TerrainReport>;
|
|
196
|
+
/** Arguments for {@link PluginCoreIoTerrainApi.setDatum}. */
|
|
197
|
+
export declare const PluginTerrainSetDatumArgs: z.ZodObject<{
|
|
198
|
+
offset: z.ZodNumber;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
export type PluginTerrainSetDatumArgs = z.infer<typeof PluginTerrainSetDatumArgs>;
|
|
201
|
+
/** Arguments for {@link PluginCoreIoTerrainApi.setOpacity}. */
|
|
202
|
+
export declare const PluginTerrainSetOpacityArgs: z.ZodObject<{
|
|
203
|
+
opacity: z.ZodNumber;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
export type PluginTerrainSetOpacityArgs = z.infer<typeof PluginTerrainSetOpacityArgs>;
|
|
206
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/io/terrain/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;;;;;;;;;;;;;;;GAgBG;AACH,8BAAsB,sBAAsB;;IAG1C;;;;;;;;;;;;;;OAcG;aACa,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC;IAElD;;;;;;;;;OASG;aACa,GAAG,IAAI,eAAe,CAAC,aAAa,GAAG,IAAI,CAAC;IAE5D;;;;;;;;;;;OAWG;aACa,QAAQ,IAAI,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAE1D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;IAE/D;;;;;;;;;;OAUG;aACa,MAAM,IAAI,eAAe,CAAC,IAAI,CAAC;IAE/C;;;;;;;;;;;;;;OAcG;aACa,SAAS,IAAI,eAAe,CAAC,aAAa,GAAG,IAAI,CAAC;IAElE,0EAA0E;aAC1D,kBAAkB,IAAI,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;IACrE;;;;;;;;OAQG;aACa,eAAe,IAAI,eAAe,CAAC,IAAI,CAAC;IACxD;;;;;;;;OAQG;aACa,gBAAgB,IAAI,eAAe,CAAC,IAAI,CAAC;IAEzD,gFAAgF;aAChE,kBAAkB,IAAI,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;IACrE;;;;;;;;OAQG;aACa,eAAe,IAAI,eAAe,CAAC,IAAI,CAAC;IACxD;;;;;;;;OAQG;aACa,gBAAgB,IAAI,eAAe,CAAC,IAAI,CAAC;IAEzD,mEAAmE;aACnD,UAAU,IAAI,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAC5D;;;;;;;;;;;;;;OAcG;aACa,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;CACnE;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;;;;iBAIxB,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEzD,6DAA6D;AAC7D,eAAO,MAAM,yBAAyB;;iBAA4C,CAAA;AAClF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEjF,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B;;iBAAkD,CAAA;AAC1F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../../../types";
|
|
3
|
+
import { UnderlayHandle, BBoxComponents } from "../../../../handles";
|
|
4
|
+
/**
|
|
5
|
+
* Underlays — inspect and edit the placed reference planes imported into the
|
|
6
|
+
* scene (`core.io.import.image` / `pdf` / `dwg` / `cadJson`).
|
|
7
|
+
*
|
|
8
|
+
* An underlay is an image, PDF, or CAD sketch dropped on a storey to trace over.
|
|
9
|
+
* This namespace lists them, calibrates their scale, sets opacity, and removes
|
|
10
|
+
* them. Every underlay is an {@linkcode UnderlayHandle}.
|
|
11
|
+
*
|
|
12
|
+
* ## Set-scale
|
|
13
|
+
* {@link PluginCoreIoUnderlayApi.setScale} takes **either** a numeric factor **or**
|
|
14
|
+
* a `{ planSize }` — the real-world length of the plan's longest side. A numeric
|
|
15
|
+
* factor is **absolute**: it is the total scale relative to the underlay's
|
|
16
|
+
* import-time size, the same number {@link PluginCoreIoUnderlayApi.getScale}
|
|
17
|
+
* returns as `scaleFactor` (so `setScale(u, 2)` is idempotent, and
|
|
18
|
+
* `setScale(u, (await getScale(u)).scaleFactor)` is a no-op). Use `planSize` to
|
|
19
|
+
* calibrate programmatically ("this plan is 50 m across") without clicking
|
|
20
|
+
* points on the canvas. Scale is supported for **image and PDF** underlays;
|
|
21
|
+
* **CAD scaling is not supported** (`getScale` returns `null`, `setScale`/`resetScale`
|
|
22
|
+
* throw). Image scale is tracked on the plan (and is **not undoable**); PDF scale is
|
|
23
|
+
* baked into the mesh (X/Z) and **is undoable**.
|
|
24
|
+
*
|
|
25
|
+
* Accessed via `snaptrude.core.io.underlay`.
|
|
26
|
+
*/
|
|
27
|
+
export declare abstract class PluginCoreIoUnderlayApi {
|
|
28
|
+
constructor();
|
|
29
|
+
/**
|
|
30
|
+
* List the underlays in the scene, optionally limited to one storey.
|
|
31
|
+
*
|
|
32
|
+
* @param storey - When given, only underlays on this storey number.
|
|
33
|
+
* @returns an array of {@linkcode UnderlayHandle} (empty, never `null`).
|
|
34
|
+
*
|
|
35
|
+
* @examplePrompt List all the reference underlays in the model
|
|
36
|
+
* @examplePrompt What underlays are on the ground floor?
|
|
37
|
+
* @examplePrompt Show every imported floor plan and PDF
|
|
38
|
+
* @examplePrompt How many trace-over images are on storey 2?
|
|
39
|
+
*
|
|
40
|
+
* # Example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const underlays = await snaptrude.core.io.underlay.list(1)
|
|
43
|
+
* console.log(`${underlays.length} underlays on storey 1`)
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
abstract list(storey?: number): PluginApiReturn<UnderlayHandle[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Read an underlay's world-space bounding box (image, PDF, or CAD). `null` if
|
|
49
|
+
* the underlay no longer resolves or has no measurable mesh. Useful for fitting
|
|
50
|
+
* drawn geometry to a reference, or computing a plan size before scaling.
|
|
51
|
+
*
|
|
52
|
+
* @param underlay - The underlay to measure.
|
|
53
|
+
*
|
|
54
|
+
* @examplePrompt How big is this floor plan in the scene?
|
|
55
|
+
* @examplePrompt Get the bounding box of the underlay
|
|
56
|
+
* @examplePrompt What's the extent of the imported PDF?
|
|
57
|
+
* @examplePrompt Measure the CAD sketch's size
|
|
58
|
+
*
|
|
59
|
+
* # Example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const bb = await snaptrude.core.io.underlay.getBounds(plan)
|
|
62
|
+
* if (bb) console.log(`width ${bb.max.x - bb.min.x}`)
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
abstract getBounds(underlay: UnderlayHandle): PluginApiReturn<BBoxComponents | null>;
|
|
66
|
+
/**
|
|
67
|
+
* Read an underlay's scale. Works for **image and PDF** underlays. Returns
|
|
68
|
+
* `null` for CAD (scaling not supported) or if the handle no longer resolves.
|
|
69
|
+
*
|
|
70
|
+
* - `scaleFactor` — the **cumulative user scale** relative to the underlay's
|
|
71
|
+
* import-time size (`1` = as imported). This is the same number
|
|
72
|
+
* {@link PluginCoreIoUnderlayApi.setScale} accepts.
|
|
73
|
+
* - `initialScaleFactor` — the engine's import-time fit factor (how the raw
|
|
74
|
+
* image was sized to the canvas on import); informational only. For PDF it
|
|
75
|
+
* is always `1`.
|
|
76
|
+
*
|
|
77
|
+
* @param underlay - The underlay to read.
|
|
78
|
+
*
|
|
79
|
+
* @examplePrompt What scale is this floor plan set to?
|
|
80
|
+
* @examplePrompt Get the current and original scale of the underlay
|
|
81
|
+
* @examplePrompt How much has this image been scaled since import?
|
|
82
|
+
* @examplePrompt Read the scale factor of the reference plan
|
|
83
|
+
*
|
|
84
|
+
* # Example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const s = await snaptrude.core.io.underlay.getScale(plan)
|
|
87
|
+
* if (s) console.log(`scale ${s.scaleFactor} (was ${s.initialScaleFactor})`)
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
abstract getScale(underlay: UnderlayHandle): PluginApiReturn<{
|
|
91
|
+
scaleFactor: number;
|
|
92
|
+
initialScaleFactor: number;
|
|
93
|
+
} | null>;
|
|
94
|
+
/**
|
|
95
|
+
* Set an underlay's scale — the **calibration** step after import. Works for
|
|
96
|
+
* **image and PDF** underlays (CAD scaling is not supported — throws).
|
|
97
|
+
*
|
|
98
|
+
* Pass the `scale` argument as **either**:
|
|
99
|
+
* - a **number** — the **absolute** scale factor relative to the underlay's
|
|
100
|
+
* import-time size (e.g. `2` makes it twice its imported size, `0.5` half —
|
|
101
|
+
* no matter what the current scale is). It is the same number
|
|
102
|
+
* {@link PluginCoreIoUnderlayApi.getScale} returns as `scaleFactor`, so the
|
|
103
|
+
* call is idempotent: repeating `setScale(u, 2)` leaves the underlay at 2×.
|
|
104
|
+
* **Or**
|
|
105
|
+
* - a **`{ planSize }`** object — the real-world **length of the plan's longest
|
|
106
|
+
* side**, in the project's length unit. The factor is computed precisely so the
|
|
107
|
+
* underlay's longest side becomes exactly `planSize`. This is the way to
|
|
108
|
+
* calibrate programmatically without clicking points on the canvas: if you
|
|
109
|
+
* know the plan is 50 m across, pass `{ planSize: 50 }`.
|
|
110
|
+
*
|
|
111
|
+
* Image scale is not undoable; PDF scale is undoable.
|
|
112
|
+
*
|
|
113
|
+
* @param underlay - The underlay to scale (image or PDF).
|
|
114
|
+
* @param scale - An absolute numeric factor, **or** `{ planSize }` (the real
|
|
115
|
+
* length of the underlay's longest side, in project units).
|
|
116
|
+
* @returns the applied `{ scaleFactor }` (the new absolute factor).
|
|
117
|
+
* @throws if writes are disabled, the underlay is CAD / can't be resolved, the plan
|
|
118
|
+
* has zero size, or the engine fails.
|
|
119
|
+
*
|
|
120
|
+
* @examplePrompt Scale this floor plan so it's 50 meters across
|
|
121
|
+
* @examplePrompt Set the plan size to 30m — it's imported too small
|
|
122
|
+
* @examplePrompt Make the reference image twice its imported size
|
|
123
|
+
* @examplePrompt Calibrate the PDF: the site is 120 meters long
|
|
124
|
+
*
|
|
125
|
+
* # Example
|
|
126
|
+
* ```ts
|
|
127
|
+
* // Absolute factor — set the underlay to 2× its imported size:
|
|
128
|
+
* await snaptrude.core.io.underlay.setScale(plan, 2)
|
|
129
|
+
*
|
|
130
|
+
* // Fit to a real-world size — make the plan's longest side 50 project-units:
|
|
131
|
+
* await snaptrude.core.io.underlay.setScale(plan, { planSize: 50 })
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
abstract setScale(underlay: UnderlayHandle, scale: number | {
|
|
135
|
+
planSize: number;
|
|
136
|
+
}): PluginApiReturn<{
|
|
137
|
+
scaleFactor: number;
|
|
138
|
+
}>;
|
|
139
|
+
/**
|
|
140
|
+
* Reset an underlay's scale back to its import-time size (image or PDF; CAD
|
|
141
|
+
* scaling is not supported — throws). Equivalent to `setScale(underlay, 1)`.
|
|
142
|
+
*
|
|
143
|
+
* @param underlay - The underlay to reset (image or PDF).
|
|
144
|
+
* @returns the restored `{ scaleFactor }` (`1`).
|
|
145
|
+
* @throws if writes are disabled, the underlay is CAD / can't be resolved, or the engine fails.
|
|
146
|
+
*
|
|
147
|
+
* @examplePrompt Reset this floor plan's scale to how it was imported
|
|
148
|
+
* @examplePrompt Undo the scaling on the underlay
|
|
149
|
+
* @examplePrompt Put the reference image back to its original size
|
|
150
|
+
* @examplePrompt Restore the plan's default scale
|
|
151
|
+
*
|
|
152
|
+
* # Example
|
|
153
|
+
* ```ts
|
|
154
|
+
* await snaptrude.core.io.underlay.resetScale(plan)
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
abstract resetScale(underlay: UnderlayHandle): PluginApiReturn<{
|
|
158
|
+
scaleFactor: number;
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* Read an underlay's opacity (`0`..`1`), or `null` if it has no material.
|
|
162
|
+
*
|
|
163
|
+
* @param underlay - The underlay to read.
|
|
164
|
+
*
|
|
165
|
+
* @examplePrompt How transparent is this underlay?
|
|
166
|
+
* @examplePrompt Get the opacity of the floor plan
|
|
167
|
+
* @examplePrompt What's the fade level on the reference image?
|
|
168
|
+
* @examplePrompt Read the underlay's opacity
|
|
169
|
+
*
|
|
170
|
+
* # Example
|
|
171
|
+
* ```ts
|
|
172
|
+
* const o = await snaptrude.core.io.underlay.getOpacity(plan)
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
abstract getOpacity(underlay: UnderlayHandle): PluginApiReturn<number | null>;
|
|
176
|
+
/**
|
|
177
|
+
* Set an underlay's opacity (`0` = transparent .. `1` = opaque). Undoable.
|
|
178
|
+
* The engine keeps underlays faintly visible: values below `0.01` clamp to
|
|
179
|
+
* `0.01`, so `setOpacity(u, 0)` reads back as `0.01`, not `0`.
|
|
180
|
+
*
|
|
181
|
+
* @param underlay - The underlay to change.
|
|
182
|
+
* @param opacity - Target opacity, `0`..`1` (engine floor `0.01`).
|
|
183
|
+
* @throws if writes are disabled, the underlay can't be resolved, or the
|
|
184
|
+
* underlay is **locked** (unlock it in the app first).
|
|
185
|
+
*
|
|
186
|
+
* @examplePrompt Fade this floor plan to 30% so I can see through it
|
|
187
|
+
* @examplePrompt Make the underlay half transparent
|
|
188
|
+
* @examplePrompt Set the reference image opacity to 0.2
|
|
189
|
+
* @examplePrompt Dim the trace-over plan
|
|
190
|
+
*
|
|
191
|
+
* # Example
|
|
192
|
+
* ```ts
|
|
193
|
+
* await snaptrude.core.io.underlay.setOpacity(plan, 0.3)
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
abstract setOpacity(underlay: UnderlayHandle, opacity: number): PluginApiReturn<void>;
|
|
197
|
+
/**
|
|
198
|
+
* Delete an underlay from the scene (and its backend record). Applies to image,
|
|
199
|
+
* PDF, and CAD underlays.
|
|
200
|
+
*
|
|
201
|
+
* @param underlay - The underlay to delete.
|
|
202
|
+
* @throws if writes are disabled or the underlay can't be resolved.
|
|
203
|
+
*
|
|
204
|
+
* @examplePrompt Delete this floor plan underlay
|
|
205
|
+
* @examplePrompt Remove the imported PDF from the scene
|
|
206
|
+
* @examplePrompt Get rid of the CAD sketch I traced over
|
|
207
|
+
* @examplePrompt Clear the reference image off storey 1
|
|
208
|
+
*
|
|
209
|
+
* # Example
|
|
210
|
+
* ```ts
|
|
211
|
+
* const [first] = await snaptrude.core.io.underlay.list(1)
|
|
212
|
+
* if (first) await snaptrude.core.io.underlay.delete(first)
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
abstract delete(underlay: UnderlayHandle): PluginApiReturn<void>;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Arguments for {@link PluginCoreIoUnderlayApi.list}.
|
|
219
|
+
*
|
|
220
|
+
* | Property | Type | Description |
|
|
221
|
+
* |---|---|---|
|
|
222
|
+
* | `storey` | `number`? | Only underlays on this storey (default: all) |
|
|
223
|
+
*/
|
|
224
|
+
export declare const PluginUnderlayListArgs: z.ZodObject<{
|
|
225
|
+
storey: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
export type PluginUnderlayListArgs = z.infer<typeof PluginUnderlayListArgs>;
|
|
228
|
+
/**
|
|
229
|
+
* Fit-to-size calibration: the real-world **length of the plan's longest side**, in
|
|
230
|
+
* the project's length unit. Passed to {@link PluginCoreIoUnderlayApi.setScale}; the
|
|
231
|
+
* factor is computed as `planSize / currentLongestSide`.
|
|
232
|
+
*
|
|
233
|
+
* | Property | Type | Description |
|
|
234
|
+
* |---|---|---|
|
|
235
|
+
* | `planSize` | `number` | Real-world length of the underlay's longest side (project units) |
|
|
236
|
+
*/
|
|
237
|
+
export declare const PluginUnderlayPlanSize: z.ZodObject<{
|
|
238
|
+
planSize: z.ZodNumber;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
export type PluginUnderlayPlanSize = z.infer<typeof PluginUnderlayPlanSize>;
|
|
241
|
+
/** The `scale` argument of {@link PluginCoreIoUnderlayApi.setScale}: a direct factor or a `{ planSize }`. */
|
|
242
|
+
export declare const PluginUnderlaySetScaleValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
243
|
+
planSize: z.ZodNumber;
|
|
244
|
+
}, z.core.$strip>]>;
|
|
245
|
+
export type PluginUnderlaySetScaleValue = z.infer<typeof PluginUnderlaySetScaleValue>;
|
|
246
|
+
/**
|
|
247
|
+
* Arguments for {@link PluginCoreIoUnderlayApi.setScale}.
|
|
248
|
+
*
|
|
249
|
+
* | Property | Type | Description |
|
|
250
|
+
* |---|---|---|
|
|
251
|
+
* | `underlay` | {@link UnderlayHandle} | The image/PDF underlay to scale |
|
|
252
|
+
* | `scale` | `number \| {@link PluginUnderlayPlanSize}` | Direct factor, or `{ planSize }` |
|
|
253
|
+
*/
|
|
254
|
+
export declare const PluginUnderlaySetScaleArgs: z.ZodObject<{
|
|
255
|
+
underlay: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
256
|
+
scale: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
257
|
+
planSize: z.ZodNumber;
|
|
258
|
+
}, z.core.$strip>]>;
|
|
259
|
+
}, z.core.$strip>;
|
|
260
|
+
export type PluginUnderlaySetScaleArgs = z.infer<typeof PluginUnderlaySetScaleArgs>;
|
|
261
|
+
/**
|
|
262
|
+
* Arguments for {@link PluginCoreIoUnderlayApi.setOpacity}.
|
|
263
|
+
*
|
|
264
|
+
* | Property | Type | Description |
|
|
265
|
+
* |---|---|---|
|
|
266
|
+
* | `underlay` | {@link UnderlayHandle} | The underlay to change |
|
|
267
|
+
* | `opacity` | `number` | Target opacity, `0`..`1` |
|
|
268
|
+
*/
|
|
269
|
+
export declare const PluginUnderlaySetOpacityArgs: z.ZodObject<{
|
|
270
|
+
underlay: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
271
|
+
opacity: z.ZodNumber;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
export type PluginUnderlaySetOpacityArgs = z.infer<typeof PluginUnderlaySetOpacityArgs>;
|
|
274
|
+
/**
|
|
275
|
+
* Arguments for the single-underlay methods
|
|
276
|
+
* ({@link PluginCoreIoUnderlayApi.getScale} / `resetScale` / `getOpacity` / `delete`).
|
|
277
|
+
*
|
|
278
|
+
* | Property | Type | Description |
|
|
279
|
+
* |---|---|---|
|
|
280
|
+
* | `underlay` | {@link UnderlayHandle} | The target underlay |
|
|
281
|
+
*/
|
|
282
|
+
export declare const PluginUnderlayRefArgs: z.ZodObject<{
|
|
283
|
+
underlay: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
export type PluginUnderlayRefArgs = z.infer<typeof PluginUnderlayRefArgs>;
|
|
286
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/io/underlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,uBAAuB;;IAG3C;;;;;;;;;;;;;;;;OAgBG;aACa,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,cAAc,EAAE,CAAC;IAExE;;;;;;;;;;;;;;;;;OAiBG;aACa,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,eAAe,CAAC,cAAc,GAAG,IAAI,CAAC;IAE3F;;;;;;;;;;;;;;;;;;;;;;;OAuBG;aACa,QAAQ,CACtB,QAAQ,EAAE,cAAc,GACvB,eAAe,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;iBAEhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
|
|
@@ -134,6 +134,7 @@ export declare abstract class PluginCoreLayersApi {
|
|
|
134
134
|
* read-only imported underlays (`image`, `cad`, `pdf`, `terrain`, `buildings`).
|
|
135
135
|
*/
|
|
136
136
|
export declare const PluginCoreLayerType: z.ZodEnum<{
|
|
137
|
+
terrain: "terrain";
|
|
137
138
|
default: "default";
|
|
138
139
|
buildings: "buildings";
|
|
139
140
|
floor: "floor";
|
|
@@ -143,7 +144,6 @@ export declare const PluginCoreLayerType: z.ZodEnum<{
|
|
|
143
144
|
image: "image";
|
|
144
145
|
cad: "cad";
|
|
145
146
|
pdf: "pdf";
|
|
146
|
-
terrain: "terrain";
|
|
147
147
|
}>;
|
|
148
148
|
export type PluginCoreLayerType = z.infer<typeof PluginCoreLayerType>;
|
|
149
149
|
/**
|
|
@@ -172,6 +172,7 @@ export declare const PluginCoreLayer: z.ZodObject<{
|
|
|
172
172
|
id: z.ZodString;
|
|
173
173
|
name: z.ZodString;
|
|
174
174
|
layerType: z.ZodEnum<{
|
|
175
|
+
terrain: "terrain";
|
|
175
176
|
default: "default";
|
|
176
177
|
buildings: "buildings";
|
|
177
178
|
floor: "floor";
|
|
@@ -181,7 +182,6 @@ export declare const PluginCoreLayer: z.ZodObject<{
|
|
|
181
182
|
image: "image";
|
|
182
183
|
cad: "cad";
|
|
183
184
|
pdf: "pdf";
|
|
184
|
-
terrain: "terrain";
|
|
185
185
|
}>;
|
|
186
186
|
storeyId: z.ZodString;
|
|
187
187
|
buildingId: z.ZodString;
|
|
@@ -205,6 +205,7 @@ export type PluginCoreLayer = z.infer<typeof PluginCoreLayer>;
|
|
|
205
205
|
export declare const PluginCoreLayersListArgs: z.ZodObject<{
|
|
206
206
|
storeyId: z.ZodString;
|
|
207
207
|
layerType: z.ZodOptional<z.ZodEnum<{
|
|
208
|
+
terrain: "terrain";
|
|
208
209
|
default: "default";
|
|
209
210
|
buildings: "buildings";
|
|
210
211
|
floor: "floor";
|
|
@@ -214,7 +215,6 @@ export declare const PluginCoreLayersListArgs: z.ZodObject<{
|
|
|
214
215
|
image: "image";
|
|
215
216
|
cad: "cad";
|
|
216
217
|
pdf: "pdf";
|
|
217
|
-
terrain: "terrain";
|
|
218
218
|
}>>;
|
|
219
219
|
}, z.core.$strip>;
|
|
220
220
|
export type PluginCoreLayersListArgs = z.infer<typeof PluginCoreLayersListArgs>;
|
|
@@ -230,6 +230,7 @@ export declare const PluginCoreLayersListResult: z.ZodObject<{
|
|
|
230
230
|
id: z.ZodString;
|
|
231
231
|
name: z.ZodString;
|
|
232
232
|
layerType: z.ZodEnum<{
|
|
233
|
+
terrain: "terrain";
|
|
233
234
|
default: "default";
|
|
234
235
|
buildings: "buildings";
|
|
235
236
|
floor: "floor";
|
|
@@ -239,7 +240,6 @@ export declare const PluginCoreLayersListResult: z.ZodObject<{
|
|
|
239
240
|
image: "image";
|
|
240
241
|
cad: "cad";
|
|
241
242
|
pdf: "pdf";
|
|
242
|
-
terrain: "terrain";
|
|
243
243
|
}>;
|
|
244
244
|
storeyId: z.ZodString;
|
|
245
245
|
buildingId: z.ZodString;
|
|
@@ -272,6 +272,7 @@ export declare const PluginCoreLayersGetResult: z.ZodNullable<z.ZodObject<{
|
|
|
272
272
|
id: z.ZodString;
|
|
273
273
|
name: z.ZodString;
|
|
274
274
|
layerType: z.ZodEnum<{
|
|
275
|
+
terrain: "terrain";
|
|
275
276
|
default: "default";
|
|
276
277
|
buildings: "buildings";
|
|
277
278
|
floor: "floor";
|
|
@@ -281,7 +282,6 @@ export declare const PluginCoreLayersGetResult: z.ZodNullable<z.ZodObject<{
|
|
|
281
282
|
image: "image";
|
|
282
283
|
cad: "cad";
|
|
283
284
|
pdf: "pdf";
|
|
284
|
-
terrain: "terrain";
|
|
285
285
|
}>;
|
|
286
286
|
storeyId: z.ZodString;
|
|
287
287
|
buildingId: z.ZodString;
|
|
@@ -313,6 +313,7 @@ export declare const PluginCoreLayersGetActiveResult: z.ZodNullable<z.ZodObject<
|
|
|
313
313
|
id: z.ZodString;
|
|
314
314
|
name: z.ZodString;
|
|
315
315
|
layerType: z.ZodEnum<{
|
|
316
|
+
terrain: "terrain";
|
|
316
317
|
default: "default";
|
|
317
318
|
buildings: "buildings";
|
|
318
319
|
floor: "floor";
|
|
@@ -322,7 +323,6 @@ export declare const PluginCoreLayersGetActiveResult: z.ZodNullable<z.ZodObject<
|
|
|
322
323
|
image: "image";
|
|
323
324
|
cad: "cad";
|
|
324
325
|
pdf: "pdf";
|
|
325
|
-
terrain: "terrain";
|
|
326
326
|
}>;
|
|
327
327
|
storeyId: z.ZodString;
|
|
328
328
|
buildingId: z.ZodString;
|
|
@@ -377,6 +377,7 @@ export declare const PluginCoreLayersUpdateResult: z.ZodObject<{
|
|
|
377
377
|
id: z.ZodString;
|
|
378
378
|
name: z.ZodString;
|
|
379
379
|
layerType: z.ZodEnum<{
|
|
380
|
+
terrain: "terrain";
|
|
380
381
|
default: "default";
|
|
381
382
|
buildings: "buildings";
|
|
382
383
|
floor: "floor";
|
|
@@ -386,7 +387,6 @@ export declare const PluginCoreLayersUpdateResult: z.ZodObject<{
|
|
|
386
387
|
image: "image";
|
|
387
388
|
cad: "cad";
|
|
388
389
|
pdf: "pdf";
|
|
389
|
-
terrain: "terrain";
|
|
390
390
|
}>;
|
|
391
391
|
storeyId: z.ZodString;
|
|
392
392
|
buildingId: z.ZodString;
|
|
@@ -360,10 +360,19 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
360
360
|
* mode copies stay in the source's instance family where possible; `"unique"` makes
|
|
361
361
|
* independent geometry. The created copies become the active selection. Undoable.
|
|
362
362
|
*
|
|
363
|
+
* Runs on the engine's array-copy tool, so its semantics carry over: an
|
|
364
|
+
* `"instance"` copy of a source that is not yet an instance **replaces that
|
|
365
|
+
* source** with a fresh instance component — the handle you passed in stops
|
|
366
|
+
* resolving after the call. Re-query (e.g. `design.query.listSpaces`) to pick
|
|
367
|
+
* up the replacement before operating on that entity again; copying the stale
|
|
368
|
+
* handle throws. `"unique"` mode never replaces sources.
|
|
369
|
+
*
|
|
363
370
|
* @param components - Entities to copy (≥1)
|
|
364
371
|
* @param displacement - Per-copy offset as a {@linkcode Vec3Handle} (copy `i` at `displacement * i`)
|
|
365
372
|
* @param options - `count` (copies per component, default 1), `mode` (`"instance"` | `"unique"`, default `"instance"`)
|
|
366
373
|
* @returns the created copies as {@linkcode ComponentHandle}`[]`
|
|
374
|
+
* @throws if a component handle is unknown or stale (replaced by an earlier
|
|
375
|
+
* `"instance"` copy), `count` is not a positive integer, or the engine fails
|
|
367
376
|
*
|
|
368
377
|
* @examplePrompt Copy this room 3 times spaced 6m apart
|
|
369
378
|
* @examplePrompt Duplicate the selected furniture along the X axis
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/create/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,EACb,UAAU,EACX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;;;GAaG;AACH,8BAAsB,qBAAqB;;IAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;aACa,KAAK,CACnB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,CA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