@snaptrude/plugin-core 0.3.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/AGENTS.md +130 -48
- package/CHANGELOG.md +163 -0
- package/api-manifest.full.json +5600 -0
- package/api-manifest.json +5502 -0
- 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/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 +51 -1
- 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 +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 +837 -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 +282 -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 +261 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
- 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 +9 -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 +484 -251
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +49 -39
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +22 -12
- 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 +451 -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 +171 -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 +4344 -899
- 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 +3682 -865
- 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 +215 -0
- 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/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 +51 -1
- 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/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 +895 -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 +273 -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 +318 -0
- package/src/api/entity/department.ts +0 -113
- package/src/api/entity/index.ts +9 -9
- package/src/api/entity/referenceLine.ts +50 -38
- package/src/api/entity/space.ts +285 -226
- package/src/api/entity/story.ts +53 -42
- package/src/api/index.ts +22 -12
- 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 +419 -0
- package/src/api/program/spreadsheet.ts +2075 -0
- package/src/handles.ts +194 -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/tools/copy.d.ts +0 -59
- package/dist/api/tools/copy.d.ts.map +0 -1
- package/dist/api/tools/index.d.ts +0 -33
- package/dist/api/tools/index.d.ts.map +0 -1
- package/dist/api/tools/material.d.ts +0 -51
- package/dist/api/tools/material.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/tools/copy.ts +0 -55
- package/src/api/tools/index.ts +0 -39
- package/src/api/tools/material.ts +0 -49
- 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
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Analysis sunlightHours — the direct-sunlight-hours heatmap study.
|
|
5
|
+
*
|
|
6
|
+
* Computes, for every space surface (Room or Department Mass — generic
|
|
7
|
+
* Masses are not enough), how many hours of direct sunlight
|
|
8
|
+
* it receives over a date range, and renders the result as a heatmap on the
|
|
9
|
+
* scene. The computation is an **asynchronous backend job**:
|
|
10
|
+
*
|
|
11
|
+
* 1. {@linkcode PluginAnalysisSunlightHoursApi.compute} starts the job and
|
|
12
|
+
* returns immediately.
|
|
13
|
+
* 2. Poll {@linkcode PluginAnalysisSunlightHoursApi.get} until `status` is
|
|
14
|
+
* `"active"` (heatmap rendered) — a run typically takes minutes. There is
|
|
15
|
+
* no completion event; polling is the pattern.
|
|
16
|
+
* 3. {@linkcode PluginAnalysisSunlightHoursApi.cancel} aborts an in-flight
|
|
17
|
+
* run; {@linkcode PluginAnalysisSunlightHoursApi.reset} clears a rendered
|
|
18
|
+
* heatmap.
|
|
19
|
+
*
|
|
20
|
+
* Heatmaps are invalidated by scene-mutating edits — re-run the study after
|
|
21
|
+
* changing the model. Dates cross as ISO 8601 date strings (`"YYYY-MM-DD"`).
|
|
22
|
+
*
|
|
23
|
+
* Accessed via `snaptrude.analysis.sunlightHours`.
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class PluginAnalysisSunlightHoursApi {
|
|
26
|
+
constructor();
|
|
27
|
+
/**
|
|
28
|
+
* Start a direct-sunlight-hours run for a date range.
|
|
29
|
+
*
|
|
30
|
+
* Starts the backend job and **returns immediately** — it does not wait
|
|
31
|
+
* for the heatmap. Poll {@linkcode PluginAnalysisSunlightHoursApi.get}
|
|
32
|
+
* until `status` is `"active"`. Starting a new run while one is in flight
|
|
33
|
+
* replaces it. Shadows and the heatmap analyses are mutually exclusive in
|
|
34
|
+
* the product: starting a run disables real-time shadows and resets/cancels
|
|
35
|
+
* any {@linkcode PluginAnalysisIlluminanceApi} (`analysis.illuminance`)
|
|
36
|
+
* study.
|
|
37
|
+
*
|
|
38
|
+
* @param startDate - Start of the study range, ISO date `"YYYY-MM-DD"`.
|
|
39
|
+
* @param endDate - End of the study range, ISO date `"YYYY-MM-DD"` (on or
|
|
40
|
+
* after `startDate`).
|
|
41
|
+
* @returns A {@linkcode PluginAnalysisComputeResult} — `{ success: true }`
|
|
42
|
+
* when the job was started. The `{ success: false, error }` arm is
|
|
43
|
+
* reserved — not yet emitted (start failures currently throw).
|
|
44
|
+
* @throws When the project has no geo-located site/terrain (no location to
|
|
45
|
+
* compute sun exposure for — there is no fallback location).
|
|
46
|
+
* @throws When the scene has no space (Room or Department Mass) to analyse
|
|
47
|
+
* or the editor is not in the 3D view.
|
|
48
|
+
* @throws When a date is not a parseable ISO date or the range is inverted.
|
|
49
|
+
* @throws When plugin writes are disabled.
|
|
50
|
+
*
|
|
51
|
+
* @examplePrompt Run a sunlight hours analysis for June
|
|
52
|
+
* @examplePrompt Compute direct sunlight hours between March and September
|
|
53
|
+
* @examplePrompt How much sun does my building get over the summer?
|
|
54
|
+
*
|
|
55
|
+
* # Example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const { success } = await snaptrude.analysis.sunlightHours.compute(
|
|
58
|
+
* "2026-06-01",
|
|
59
|
+
* "2026-06-30",
|
|
60
|
+
* )
|
|
61
|
+
* // poll until the heatmap is rendered
|
|
62
|
+
* let job = await snaptrude.analysis.sunlightHours.get()
|
|
63
|
+
* while (job?.status === "running") {
|
|
64
|
+
* await new Promise((r) => setTimeout(r, 5000))
|
|
65
|
+
* job = await snaptrude.analysis.sunlightHours.get()
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
abstract compute(startDate: string, endDate: string): PluginApiReturn<PluginAnalysisComputeResult>;
|
|
70
|
+
/**
|
|
71
|
+
* Get the state of the sunlight-hours study.
|
|
72
|
+
*
|
|
73
|
+
* The polling read for the async job started by
|
|
74
|
+
* {@linkcode PluginAnalysisSunlightHoursApi.compute}. `status` values:
|
|
75
|
+
*
|
|
76
|
+
* | Status | Meaning |
|
|
77
|
+
* |---|---|
|
|
78
|
+
* | `"running"` | A run is in flight — keep polling |
|
|
79
|
+
* | `"active"` | The heatmap is rendered on the scene |
|
|
80
|
+
* | `"inactive"` | A previous run exists but its heatmap is not showing |
|
|
81
|
+
*
|
|
82
|
+
* @returns A {@linkcode PluginAnalysisJobStateResult} with the `status` and
|
|
83
|
+
* the run's ISO `startDate`/`endDate`, or `null` when no run result is
|
|
84
|
+
* available (the study never ran, was cancelled, or the last run failed).
|
|
85
|
+
*
|
|
86
|
+
* @examplePrompt Is the sunlight analysis done?
|
|
87
|
+
* @examplePrompt Check the status of the sunlight hours run
|
|
88
|
+
* @examplePrompt What date range was the sunlight heatmap computed for?
|
|
89
|
+
*
|
|
90
|
+
* # Example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const job = await snaptrude.analysis.sunlightHours.get()
|
|
93
|
+
* if (job?.status === "active") console.log(job.startDate, job.endDate)
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
abstract get(): PluginApiReturn<PluginAnalysisJobStateResult>;
|
|
97
|
+
/**
|
|
98
|
+
* Cancel the in-flight sunlight-hours run.
|
|
99
|
+
*
|
|
100
|
+
* Aborts the backend job. A no-op (returns `false`) when nothing is
|
|
101
|
+
* running.
|
|
102
|
+
*
|
|
103
|
+
* @returns `true` when a run was cancelled, `false` when nothing was
|
|
104
|
+
* running.
|
|
105
|
+
* @throws When plugin writes are disabled.
|
|
106
|
+
*
|
|
107
|
+
* @examplePrompt Cancel the sunlight analysis
|
|
108
|
+
* @examplePrompt Stop the running sunlight hours computation
|
|
109
|
+
* @examplePrompt Abort the sun study
|
|
110
|
+
*
|
|
111
|
+
* # Example
|
|
112
|
+
* ```ts
|
|
113
|
+
* await snaptrude.analysis.sunlightHours.cancel()
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
abstract cancel(): PluginApiReturn<boolean>;
|
|
117
|
+
/**
|
|
118
|
+
* Clear the sunlight-hours heatmap from the scene.
|
|
119
|
+
*
|
|
120
|
+
* Un-applies the rendered heatmap and restores the normal material view.
|
|
121
|
+
* A no-op (returns `false`) when no heatmap is showing. Does not cancel an
|
|
122
|
+
* in-flight run — use {@linkcode PluginAnalysisSunlightHoursApi.cancel}.
|
|
123
|
+
*
|
|
124
|
+
* @returns `true` when a heatmap was cleared, `false` when none was
|
|
125
|
+
* showing.
|
|
126
|
+
* @throws When plugin writes are disabled.
|
|
127
|
+
*
|
|
128
|
+
* @examplePrompt Clear the sunlight heatmap
|
|
129
|
+
* @examplePrompt Remove the sun hours colours from the model
|
|
130
|
+
* @examplePrompt Reset the sunlight analysis view
|
|
131
|
+
*
|
|
132
|
+
* # Example
|
|
133
|
+
* ```ts
|
|
134
|
+
* await snaptrude.analysis.sunlightHours.reset()
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
abstract reset(): PluginApiReturn<boolean>;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Result of starting an analysis job
|
|
141
|
+
* ({@linkcode PluginAnalysisSunlightHoursApi.compute} /
|
|
142
|
+
* {@linkcode PluginAnalysisIlluminanceApi.compute}).
|
|
143
|
+
*
|
|
144
|
+
* The `success: false` arm is **reserved — not yet emitted**: the current
|
|
145
|
+
* host always returns `{ success: true }` (start failures throw instead); a
|
|
146
|
+
* failure indicator may be added additively later.
|
|
147
|
+
*
|
|
148
|
+
* | Property | Type | Description |
|
|
149
|
+
* |---|---|---|
|
|
150
|
+
* | `success` | `boolean` | `true` when the backend job was started |
|
|
151
|
+
* | `error` | `string \| undefined` | Failure reason when `success` is `false` (reserved — not yet emitted) |
|
|
152
|
+
*/
|
|
153
|
+
export declare const PluginAnalysisComputeResult: z.ZodObject<{
|
|
154
|
+
success: z.ZodBoolean;
|
|
155
|
+
error: z.ZodOptional<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
export type PluginAnalysisComputeResult = z.infer<typeof PluginAnalysisComputeResult>;
|
|
158
|
+
/**
|
|
159
|
+
* The status of an analysis heatmap job.
|
|
160
|
+
*
|
|
161
|
+
* | Value | Meaning |
|
|
162
|
+
* |---|---|
|
|
163
|
+
* | `"running"` | A run is in flight — keep polling |
|
|
164
|
+
* | `"active"` | The heatmap is rendered on the scene |
|
|
165
|
+
* | `"inactive"` | A previous run exists but its heatmap is not showing |
|
|
166
|
+
*/
|
|
167
|
+
export declare const PluginAnalysisJobStatus: z.ZodEnum<{
|
|
168
|
+
running: "running";
|
|
169
|
+
active: "active";
|
|
170
|
+
inactive: "inactive";
|
|
171
|
+
}>;
|
|
172
|
+
export type PluginAnalysisJobStatus = z.infer<typeof PluginAnalysisJobStatus>;
|
|
173
|
+
/**
|
|
174
|
+
* The state of an analysis heatmap job.
|
|
175
|
+
*
|
|
176
|
+
* | Property | Type | Description |
|
|
177
|
+
* |---|---|---|
|
|
178
|
+
* | `status` | {@linkcode PluginAnalysisJobStatus} | `"running"` \| `"active"` \| `"inactive"` |
|
|
179
|
+
* | `startDate` | `string` | ISO date (`"YYYY-MM-DD"`) the run was computed from |
|
|
180
|
+
* | `endDate` | `string` | ISO date (`"YYYY-MM-DD"`) the run was computed to |
|
|
181
|
+
*/
|
|
182
|
+
export declare const PluginAnalysisJobState: z.ZodObject<{
|
|
183
|
+
status: z.ZodEnum<{
|
|
184
|
+
running: "running";
|
|
185
|
+
active: "active";
|
|
186
|
+
inactive: "inactive";
|
|
187
|
+
}>;
|
|
188
|
+
startDate: z.ZodString;
|
|
189
|
+
endDate: z.ZodString;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
export type PluginAnalysisJobState = z.infer<typeof PluginAnalysisJobState>;
|
|
192
|
+
/**
|
|
193
|
+
* Result of {@linkcode PluginAnalysisSunlightHoursApi.get} /
|
|
194
|
+
* {@linkcode PluginAnalysisIlluminanceApi.get} — the job state, or `null`
|
|
195
|
+
* when no run result is available (the study never ran, was cancelled, or
|
|
196
|
+
* the last run failed).
|
|
197
|
+
*/
|
|
198
|
+
export declare const PluginAnalysisJobStateResult: z.ZodNullable<z.ZodObject<{
|
|
199
|
+
status: z.ZodEnum<{
|
|
200
|
+
running: "running";
|
|
201
|
+
active: "active";
|
|
202
|
+
inactive: "inactive";
|
|
203
|
+
}>;
|
|
204
|
+
startDate: z.ZodString;
|
|
205
|
+
endDate: z.ZodString;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
export type PluginAnalysisJobStateResult = z.infer<typeof PluginAnalysisJobStateResult>;
|
|
208
|
+
//# sourceMappingURL=sunlightHours.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sunlightHours.d.ts","sourceRoot":"","sources":["../../../src/api/analysis/sunlightHours.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BAAsB,8BAA8B;;IAGlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;aACa,OAAO,CACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,eAAe,CAAC,2BAA2B,CAAC;IAE/C;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;aACa,GAAG,IAAI,eAAe,CAAC,4BAA4B,CAAC;IAEpE;;;;;;;;;;;;;;;;;;OAkBG;aACa,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC;IAElD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,KAAK,IAAI,eAAe,CAAC,OAAO,CAAC;CAClD;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB;;;;EAIlC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;iBAIjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;kBAAoC,CAAA;AAC7E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { PluginApiReturn } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Analysis sunpath — the sun-path diagram overlay.
|
|
4
|
+
*
|
|
5
|
+
* The sun-path diagram draws the sun's annual/daily trajectory arcs over the
|
|
6
|
+
* scene for the project's geographic location, so daylight behaviour can be
|
|
7
|
+
* read directly off the model. Toggling it is an **undoable** action (it goes
|
|
8
|
+
* through the command stack, so `core.history.undo` reverts it).
|
|
9
|
+
*
|
|
10
|
+
* The overlay is computed for the project's geo-location. Enabling **throws**
|
|
11
|
+
* when the project has no geo-located site/terrain — there is no fallback
|
|
12
|
+
* location. Set the site location first (Import terrain / site context);
|
|
13
|
+
* read it via `program.site.getLocation`.
|
|
14
|
+
*
|
|
15
|
+
* Accessed via `snaptrude.analysis.sunpath`.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class PluginAnalysisSunpathApi {
|
|
18
|
+
constructor();
|
|
19
|
+
/**
|
|
20
|
+
* Turn the sun-path diagram overlay ON.
|
|
21
|
+
*
|
|
22
|
+
* Undoable: the toggle is committed through the command stack. A no-op
|
|
23
|
+
* (returns `true`) when the overlay is already active.
|
|
24
|
+
*
|
|
25
|
+
* @returns `true` — the overlay is active after the call.
|
|
26
|
+
* @throws When the project has no geo-located site/terrain (no location to
|
|
27
|
+
* compute the sun trajectory for).
|
|
28
|
+
* @throws When plugin writes are disabled.
|
|
29
|
+
*
|
|
30
|
+
* @examplePrompt Show the sun path diagram
|
|
31
|
+
* @examplePrompt Turn on the sunpath overlay
|
|
32
|
+
* @examplePrompt Visualize the sun's trajectory over my building
|
|
33
|
+
*
|
|
34
|
+
* # Example
|
|
35
|
+
* ```ts
|
|
36
|
+
* await snaptrude.analysis.sunpath.enable()
|
|
37
|
+
* const active = await snaptrude.analysis.sunpath.isActive() // true
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
abstract enable(): PluginApiReturn<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Turn the sun-path diagram overlay OFF.
|
|
43
|
+
*
|
|
44
|
+
* Undoable: the toggle is committed through the command stack. A no-op
|
|
45
|
+
* (returns `false`) when the overlay is already off.
|
|
46
|
+
*
|
|
47
|
+
* @returns `false` — the overlay is inactive after the call.
|
|
48
|
+
* @throws When plugin writes are disabled.
|
|
49
|
+
*
|
|
50
|
+
* @examplePrompt Hide the sun path diagram
|
|
51
|
+
* @examplePrompt Turn off the sunpath overlay
|
|
52
|
+
* @examplePrompt Remove the sun trajectory arcs from the scene
|
|
53
|
+
*
|
|
54
|
+
* # Example
|
|
55
|
+
* ```ts
|
|
56
|
+
* await snaptrude.analysis.sunpath.disable()
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
abstract disable(): PluginApiReturn<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the sun-path diagram overlay is currently active.
|
|
62
|
+
*
|
|
63
|
+
* A pure read — never mutates, never throws.
|
|
64
|
+
*
|
|
65
|
+
* @returns `true` when the overlay is showing.
|
|
66
|
+
*
|
|
67
|
+
* @examplePrompt Is the sun path diagram on?
|
|
68
|
+
* @examplePrompt Check whether the sunpath overlay is active
|
|
69
|
+
* @examplePrompt Am I looking at the sun trajectory right now?
|
|
70
|
+
*
|
|
71
|
+
* # Example
|
|
72
|
+
* ```ts
|
|
73
|
+
* if (!(await snaptrude.analysis.sunpath.isActive())) {
|
|
74
|
+
* await snaptrude.analysis.sunpath.enable()
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
abstract isActive(): PluginApiReturn<boolean>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=sunpath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sunpath.d.ts","sourceRoot":"","sources":["../../../src/api/analysis/sunpath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;;OAoBG;aACa,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC;IAElD;;;;;;;;;;;;;;;;;OAiBG;aACa,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC;IAEnD;;;;;;;;;;;;;;;;;OAiBG;aACa,QAAQ,IAAI,eAAe,CAAC,OAAO,CAAC;CACrD"}
|