@snaptrude/plugin-core 0.9.16 → 0.9.18-edgesetbacks-20261021.1

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.
Files changed (221) hide show
  1. package/AGENTS.md +231 -231
  2. package/CHANGELOG.md +408 -402
  3. package/CLAUDE.md +11 -11
  4. package/api-manifest.json +1510 -701
  5. package/dist/api/analysis/daylight.d.ts +5 -5
  6. package/dist/api/analysis/solar.d.ts +2 -2
  7. package/dist/api/core/camera/index.d.ts +29 -0
  8. package/dist/api/core/camera/index.d.ts.map +1 -1
  9. package/dist/api/core/geom/create/index.d.ts +7 -1
  10. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  11. package/dist/api/core/geom/update/contour.d.ts +8 -2
  12. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  13. package/dist/api/core/storeys/index.d.ts +5 -2
  14. package/dist/api/core/storeys/index.d.ts.map +1 -1
  15. package/dist/api/core/zoom/index.d.ts +13 -0
  16. package/dist/api/core/zoom/index.d.ts.map +1 -1
  17. package/dist/api/design/bim.d.ts +299 -0
  18. package/dist/api/design/bim.d.ts.map +1 -0
  19. package/dist/api/design/boolean/index.d.ts +2 -0
  20. package/dist/api/design/boolean/index.d.ts.map +1 -1
  21. package/dist/api/design/catalog.d.ts +320 -0
  22. package/dist/api/design/catalog.d.ts.map +1 -0
  23. package/dist/api/design/create/bulk-items.d.ts +65 -25
  24. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  25. package/dist/api/design/create/index.d.ts +299 -100
  26. package/dist/api/design/create/index.d.ts.map +1 -1
  27. package/dist/api/design/create/opening-fields.d.ts +13 -12
  28. package/dist/api/design/create/opening-fields.d.ts.map +1 -1
  29. package/dist/api/design/delete/index.d.ts +1 -0
  30. package/dist/api/design/delete/index.d.ts.map +1 -1
  31. package/dist/api/design/doors/index.d.ts +18 -24
  32. package/dist/api/design/doors/index.d.ts.map +1 -1
  33. package/dist/api/design/family.d.ts +813 -35
  34. package/dist/api/design/family.d.ts.map +1 -1
  35. package/dist/api/design/index.d.ts +16 -0
  36. package/dist/api/design/index.d.ts.map +1 -1
  37. package/dist/api/design/networks.d.ts +1703 -0
  38. package/dist/api/design/networks.d.ts.map +1 -0
  39. package/dist/api/design/query/grids.d.ts +2 -2
  40. package/dist/api/design/query/index.d.ts +42 -32
  41. package/dist/api/design/query/index.d.ts.map +1 -1
  42. package/dist/api/design/selection/index.d.ts +10 -10
  43. package/dist/api/design/types/index.d.ts +40 -24
  44. package/dist/api/design/types/index.d.ts.map +1 -1
  45. package/dist/api/design/update/index.d.ts +111 -6
  46. package/dist/api/design/update/index.d.ts.map +1 -1
  47. package/dist/api/design/windows/index.d.ts +8 -8
  48. package/dist/api/design/windows/index.d.ts.map +1 -1
  49. package/dist/api/entity/buildableEnvelope.d.ts +84 -2
  50. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  51. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  52. package/dist/api/presentation/annotate.d.ts +38 -22
  53. package/dist/api/presentation/annotate.d.ts.map +1 -1
  54. package/dist/api/presentation/drawingContract.d.ts +32 -0
  55. package/dist/api/presentation/drawingContract.d.ts.map +1 -0
  56. package/dist/api/presentation/drawings.d.ts +3523 -0
  57. package/dist/api/presentation/drawings.d.ts.map +1 -0
  58. package/dist/api/presentation/export.d.ts +23 -5
  59. package/dist/api/presentation/export.d.ts.map +1 -1
  60. package/dist/api/presentation/index.d.ts +41 -12
  61. package/dist/api/presentation/index.d.ts.map +1 -1
  62. package/dist/api/presentation/placedViews.d.ts +106 -6
  63. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  64. package/dist/api/presentation/sections.d.ts +461 -0
  65. package/dist/api/presentation/sections.d.ts.map +1 -0
  66. package/dist/api/presentation/shapes.d.ts +2 -2
  67. package/dist/api/presentation/sheets.d.ts +175 -19
  68. package/dist/api/presentation/sheets.d.ts.map +1 -1
  69. package/dist/api/presentation/viewPresets.d.ts +222 -0
  70. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  71. package/dist/api/presentation/views.d.ts +141 -8
  72. package/dist/api/presentation/views.d.ts.map +1 -1
  73. package/dist/api/presentation/walkthroughs.d.ts +6 -6
  74. package/dist/errors/codes.d.ts +3 -1
  75. package/dist/errors/codes.d.ts.map +1 -1
  76. package/dist/index.cjs +3883 -2385
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.js +3744 -2385
  79. package/dist/index.js.map +1 -1
  80. package/package.json +1 -1
  81. package/scripts/check-dist-fresh.mjs +22 -22
  82. package/scripts/generate-manifest.mjs +243 -238
  83. package/scripts/generate-manifest.test.mjs +303 -303
  84. package/src/api/analysis/daylight.ts +470 -470
  85. package/src/api/analysis/heatmaps.ts +683 -683
  86. package/src/api/analysis/illuminance.ts +155 -155
  87. package/src/api/analysis/index.ts +61 -61
  88. package/src/api/analysis/shadows.ts +183 -183
  89. package/src/api/analysis/solar.ts +237 -237
  90. package/src/api/analysis/sunlightHours.ts +211 -211
  91. package/src/api/analysis/sunpath.ts +83 -83
  92. package/src/api/analysis/weather.ts +179 -179
  93. package/src/api/core/buildings.ts +485 -485
  94. package/src/api/core/camera/index.ts +696 -667
  95. package/src/api/core/comment/index.ts +376 -376
  96. package/src/api/core/geom/create/index.ts +2139 -2133
  97. package/src/api/core/geom/delete/index.ts +84 -84
  98. package/src/api/core/geom/index.ts +35 -35
  99. package/src/api/core/geom/query/arc.ts +169 -169
  100. package/src/api/core/geom/query/brep.ts +621 -621
  101. package/src/api/core/geom/query/circle.ts +404 -404
  102. package/src/api/core/geom/query/contour.ts +540 -540
  103. package/src/api/core/geom/query/curve.ts +1102 -1102
  104. package/src/api/core/geom/query/edge.ts +130 -130
  105. package/src/api/core/geom/query/face.ts +508 -508
  106. package/src/api/core/geom/query/halfedge.ts +210 -210
  107. package/src/api/core/geom/query/index.ts +63 -63
  108. package/src/api/core/geom/query/profile.ts +473 -473
  109. package/src/api/core/geom/query/vertex.ts +205 -205
  110. package/src/api/core/geom/update/contour.ts +323 -317
  111. package/src/api/core/geom/update/curve.ts +209 -209
  112. package/src/api/core/geom/update/index.ts +29 -29
  113. package/src/api/core/geom/update/profile.ts +379 -379
  114. package/src/api/core/groups.ts +521 -521
  115. package/src/api/core/handles/index.ts +234 -234
  116. package/src/api/core/history/index.ts +84 -84
  117. package/src/api/core/index.ts +99 -99
  118. package/src/api/core/io/export/index.ts +126 -126
  119. package/src/api/core/io/import/index.ts +504 -504
  120. package/src/api/core/io/index.ts +42 -42
  121. package/src/api/core/io/job/index.ts +140 -140
  122. package/src/api/core/io/query/index.ts +71 -71
  123. package/src/api/core/io/terrain/index.ts +360 -360
  124. package/src/api/core/io/underlay/index.ts +705 -705
  125. package/src/api/core/layers.ts +540 -540
  126. package/src/api/core/math/index.ts +20 -20
  127. package/src/api/core/math/quat.ts +172 -172
  128. package/src/api/core/math/vec3.ts +179 -179
  129. package/src/api/core/mode/index.ts +108 -108
  130. package/src/api/core/project/index.ts +479 -479
  131. package/src/api/core/proposals/index.ts +570 -570
  132. package/src/api/core/storeys/index.ts +311 -308
  133. package/src/api/core/storeys/layers.ts +339 -339
  134. package/src/api/core/tags.ts +911 -911
  135. package/src/api/core/units/index.ts +164 -164
  136. package/src/api/core/user.ts +46 -46
  137. package/src/api/core/zoom/index.ts +64 -51
  138. package/src/api/design/bim.ts +210 -0
  139. package/src/api/design/boolean/index.ts +181 -179
  140. package/src/api/design/catalog.ts +203 -0
  141. package/src/api/design/create/bulk-items.ts +294 -254
  142. package/src/api/design/create/grids.ts +137 -137
  143. package/src/api/design/create/index.ts +2178 -1980
  144. package/src/api/design/create/opening-fields.ts +40 -37
  145. package/src/api/design/delete/index.ts +75 -74
  146. package/src/api/design/dimensions.ts +453 -453
  147. package/src/api/design/doors/index.ts +516 -500
  148. package/src/api/design/edit/index.ts +54 -54
  149. package/src/api/design/erase/index.ts +151 -151
  150. package/src/api/design/family.ts +1342 -704
  151. package/src/api/design/furniture/index.ts +319 -319
  152. package/src/api/design/grids.ts +237 -237
  153. package/src/api/design/index.ts +304 -274
  154. package/src/api/design/lock.ts +69 -69
  155. package/src/api/design/materials/index.ts +608 -608
  156. package/src/api/design/networks.ts +607 -0
  157. package/src/api/design/query/geometry/index.ts +319 -319
  158. package/src/api/design/query/grids.ts +197 -197
  159. package/src/api/design/query/index.ts +1236 -1226
  160. package/src/api/design/query/referenceLines.ts +52 -52
  161. package/src/api/design/query/spaces.ts +275 -275
  162. package/src/api/design/selection/index.ts +273 -273
  163. package/src/api/design/shared.ts +40 -40
  164. package/src/api/design/transform/index.ts +254 -254
  165. package/src/api/design/types/index.ts +163 -156
  166. package/src/api/design/update/index.ts +1096 -983
  167. package/src/api/design/visibility.ts +143 -143
  168. package/src/api/design/windows/index.ts +351 -333
  169. package/src/api/entity/buildableEnvelope.ts +397 -322
  170. package/src/api/entity/index.ts +30 -30
  171. package/src/api/entity/referenceLine.ts +235 -235
  172. package/src/api/entity/space.ts +612 -612
  173. package/src/api/entity/story.ts +517 -517
  174. package/src/api/index.ts +47 -47
  175. package/src/api/presentation/aiInspiration.ts +1116 -1116
  176. package/src/api/presentation/annotate.ts +417 -385
  177. package/src/api/presentation/camera.ts +289 -289
  178. package/src/api/presentation/diagrams.ts +194 -194
  179. package/src/api/presentation/drawingContract.ts +70 -0
  180. package/src/api/presentation/drawings.ts +1179 -0
  181. package/src/api/presentation/export.ts +134 -108
  182. package/src/api/presentation/import.ts +159 -159
  183. package/src/api/presentation/index.ts +160 -126
  184. package/src/api/presentation/placedViews.ts +1211 -1120
  185. package/src/api/presentation/sections.ts +420 -0
  186. package/src/api/presentation/shapes.ts +274 -274
  187. package/src/api/presentation/sheets.ts +746 -585
  188. package/src/api/presentation/slideshow.ts +134 -134
  189. package/src/api/presentation/tables.ts +84 -84
  190. package/src/api/presentation/viewPresets.ts +241 -0
  191. package/src/api/presentation/views.ts +742 -673
  192. package/src/api/presentation/walkthroughs.ts +1201 -1201
  193. package/src/api/program/adjacency.ts +164 -164
  194. package/src/api/program/areas.ts +408 -408
  195. package/src/api/program/classification.ts +138 -138
  196. package/src/api/program/cores.ts +83 -83
  197. package/src/api/program/departments.ts +517 -517
  198. package/src/api/program/index.ts +73 -73
  199. package/src/api/program/labels.ts +332 -332
  200. package/src/api/program/layout.ts +422 -422
  201. package/src/api/program/metadata.ts +364 -364
  202. package/src/api/program/metrics.ts +120 -120
  203. package/src/api/program/site.ts +748 -748
  204. package/src/api/program/spreadsheet.ts +2698 -2698
  205. package/src/api/workspace/index.ts +612 -612
  206. package/src/errors/codes.ts +143 -136
  207. package/src/errors/envelope.ts +75 -75
  208. package/src/errors/index.ts +21 -21
  209. package/src/errors/plugin-error.ts +134 -134
  210. package/src/handles.ts +297 -297
  211. package/src/host-utils.ts +67 -67
  212. package/src/index.ts +7 -7
  213. package/src/massParameters.ops.ts +246 -246
  214. package/src/massParameters.ts +427 -427
  215. package/src/types.ts +16 -16
  216. package/test/drawingContract.test.mjs +288 -0
  217. package/test/errors.test.mjs +185 -184
  218. package/test/massParameters.test.mjs +952 -952
  219. package/test/presentationViewSettings.test.mjs +85 -0
  220. package/tsconfig.json +22 -22
  221. package/tsup.config.ts +12 -12
@@ -0,0 +1,461 @@
1
+ import * as z from "zod";
2
+ import type { PluginApiReturn } from "../../types";
3
+ /** A point on the plan: world `x` and `z` in babylon units. */
4
+ export declare const PluginSectionPoint: z.ZodObject<{
5
+ x: z.ZodNumber;
6
+ z: z.ZodNumber;
7
+ }, z.core.$strict>;
8
+ export type PluginSectionPoint = z.infer<typeof PluginSectionPoint>;
9
+ /**
10
+ * A section: a line drawn on the plan that cuts the model and looks one way
11
+ * along it.
12
+ *
13
+ * | Property | Type | Description |
14
+ * |---|---|---|
15
+ * | `sectionId` | `string` | The section's id |
16
+ * | `name` | `string` | Its name in the Views panel ("Section 1") |
17
+ * | `tagLabel` | `string` | What its heads are marked with on the plan ("A") |
18
+ * | `buildingId` | `string` | The building it belongs to |
19
+ * | `start` | {@linkcode PluginSectionPoint} | First head on the plan |
20
+ * | `end` | {@linkcode PluginSectionPoint} | Second head on the plan |
21
+ * | `isFlipped` | `boolean` | Looks the other way along the line |
22
+ * | `depth` | `number` | How far behind the line the view keeps, babylon units |
23
+ * | `base` | `number` | Bottom of the slice, world Y |
24
+ * | `top` | `number` | Top of the slice, world Y |
25
+ * | `isHidden` | `boolean` | The line is hidden on the plan |
26
+ * | `isLocked` | `boolean` | Geometry edits are refused |
27
+ * | `isActive` | `boolean` | It is the section view open now |
28
+ */
29
+ export declare const PluginSection: z.ZodObject<{
30
+ sectionId: z.ZodString;
31
+ name: z.ZodString;
32
+ tagLabel: z.ZodString;
33
+ buildingId: z.ZodString;
34
+ start: z.ZodObject<{
35
+ x: z.ZodNumber;
36
+ z: z.ZodNumber;
37
+ }, z.core.$strict>;
38
+ end: z.ZodObject<{
39
+ x: z.ZodNumber;
40
+ z: z.ZodNumber;
41
+ }, z.core.$strict>;
42
+ isFlipped: z.ZodBoolean;
43
+ depth: z.ZodNumber;
44
+ base: z.ZodNumber;
45
+ top: z.ZodNumber;
46
+ isHidden: z.ZodBoolean;
47
+ isLocked: z.ZodBoolean;
48
+ isActive: z.ZodBoolean;
49
+ }, z.core.$strip>;
50
+ export type PluginSection = z.infer<typeof PluginSection>;
51
+ export declare const PluginSectionIdArgs: z.ZodObject<{
52
+ sectionId: z.ZodString;
53
+ }, z.core.$strict>;
54
+ export type PluginSectionIdArgs = z.infer<typeof PluginSectionIdArgs>;
55
+ /**
56
+ * Options for {@linkcode PluginPresentationSectionsApi.create}.
57
+ *
58
+ * | Property | Type | Description |
59
+ * |---|---|---|
60
+ * | `name` | `string \| undefined` | Name in the Views panel (default: the next "Section N") |
61
+ * | `tagLabel` | `string \| undefined` | Head mark on the plan (default: the next free mark) |
62
+ * | `depth` | `number \| undefined` | How far behind the line the view keeps (default: to the far side of the model) |
63
+ * | `base` | `number \| undefined` | Bottom of the slice, world Y (default: the building's base) |
64
+ * | `top` | `number \| undefined` | Top of the slice, world Y (default: the building's top) |
65
+ * | `buildingId` | `string \| undefined` | Building it belongs to (default: the active one) |
66
+ * | `isActive` | `boolean \| undefined` | Open the section view once created (default `false`) |
67
+ */
68
+ export declare const PluginSectionCreateOptions: z.ZodObject<{
69
+ name: z.ZodOptional<z.ZodString>;
70
+ tagLabel: z.ZodOptional<z.ZodString>;
71
+ depth: z.ZodOptional<z.ZodNumber>;
72
+ base: z.ZodOptional<z.ZodNumber>;
73
+ top: z.ZodOptional<z.ZodNumber>;
74
+ buildingId: z.ZodOptional<z.ZodString>;
75
+ isActive: z.ZodOptional<z.ZodBoolean>;
76
+ }, z.core.$strict>;
77
+ export type PluginSectionCreateOptions = z.infer<typeof PluginSectionCreateOptions>;
78
+ export declare const PluginSectionCreateArgs: z.ZodObject<{
79
+ start: z.ZodObject<{
80
+ x: z.ZodNumber;
81
+ z: z.ZodNumber;
82
+ }, z.core.$strict>;
83
+ end: z.ZodObject<{
84
+ x: z.ZodNumber;
85
+ z: z.ZodNumber;
86
+ }, z.core.$strict>;
87
+ options: z.ZodOptional<z.ZodObject<{
88
+ name: z.ZodOptional<z.ZodString>;
89
+ tagLabel: z.ZodOptional<z.ZodString>;
90
+ depth: z.ZodOptional<z.ZodNumber>;
91
+ base: z.ZodOptional<z.ZodNumber>;
92
+ top: z.ZodOptional<z.ZodNumber>;
93
+ buildingId: z.ZodOptional<z.ZodString>;
94
+ isActive: z.ZodOptional<z.ZodBoolean>;
95
+ }, z.core.$strict>>;
96
+ }, z.core.$strict>;
97
+ export type PluginSectionCreateArgs = z.infer<typeof PluginSectionCreateArgs>;
98
+ /**
99
+ * The fields to change in {@linkcode PluginPresentationSectionsApi.update};
100
+ * omitted fields keep their value.
101
+ *
102
+ * | Property | Type | Description |
103
+ * |---|---|---|
104
+ * | `name` | `string \| undefined` | Name in the Views panel |
105
+ * | `tagLabel` | `string \| undefined` | Head mark on the plan |
106
+ * | `start` | {@linkcode PluginSectionPoint} `\| undefined` | First head |
107
+ * | `end` | {@linkcode PluginSectionPoint} `\| undefined` | Second head |
108
+ * | `isFlipped` | `boolean \| undefined` | Look the other way; without `depth`, the depth re-spans the model the new way |
109
+ * | `depth` | `number \| undefined` | View depth behind the line, > 0 |
110
+ * | `base` | `number \| undefined` | Bottom of the slice, world Y |
111
+ * | `top` | `number \| undefined` | Top of the slice, world Y; above `base` |
112
+ * | `isHidden` | `boolean \| undefined` | Hide the line on the plan |
113
+ */
114
+ export declare const PluginSectionPatch: z.ZodObject<{
115
+ name: z.ZodOptional<z.ZodString>;
116
+ tagLabel: z.ZodOptional<z.ZodString>;
117
+ start: z.ZodOptional<z.ZodObject<{
118
+ x: z.ZodNumber;
119
+ z: z.ZodNumber;
120
+ }, z.core.$strict>>;
121
+ end: z.ZodOptional<z.ZodObject<{
122
+ x: z.ZodNumber;
123
+ z: z.ZodNumber;
124
+ }, z.core.$strict>>;
125
+ isFlipped: z.ZodOptional<z.ZodBoolean>;
126
+ depth: z.ZodOptional<z.ZodNumber>;
127
+ base: z.ZodOptional<z.ZodNumber>;
128
+ top: z.ZodOptional<z.ZodNumber>;
129
+ isHidden: z.ZodOptional<z.ZodBoolean>;
130
+ }, z.core.$strict>;
131
+ export type PluginSectionPatch = z.infer<typeof PluginSectionPatch>;
132
+ export declare const PluginSectionUpdateArgs: z.ZodObject<{
133
+ sectionId: z.ZodString;
134
+ patch: z.ZodObject<{
135
+ name: z.ZodOptional<z.ZodString>;
136
+ tagLabel: z.ZodOptional<z.ZodString>;
137
+ start: z.ZodOptional<z.ZodObject<{
138
+ x: z.ZodNumber;
139
+ z: z.ZodNumber;
140
+ }, z.core.$strict>>;
141
+ end: z.ZodOptional<z.ZodObject<{
142
+ x: z.ZodNumber;
143
+ z: z.ZodNumber;
144
+ }, z.core.$strict>>;
145
+ isFlipped: z.ZodOptional<z.ZodBoolean>;
146
+ depth: z.ZodOptional<z.ZodNumber>;
147
+ base: z.ZodOptional<z.ZodNumber>;
148
+ top: z.ZodOptional<z.ZodNumber>;
149
+ isHidden: z.ZodOptional<z.ZodBoolean>;
150
+ }, z.core.$strict>;
151
+ }, z.core.$strict>;
152
+ export type PluginSectionUpdateArgs = z.infer<typeof PluginSectionUpdateArgs>;
153
+ /**
154
+ * Options for {@linkcode PluginPresentationSectionsApi.getCut}.
155
+ *
156
+ * | Property | Type | Description |
157
+ * |---|---|---|
158
+ * | `maxSegmentsPerElement` | `number \| undefined` | Outline segments to return per element, 0 to 2000 (default 0: none) |
159
+ */
160
+ export declare const PluginSectionCutOptions: z.ZodObject<{
161
+ maxSegmentsPerElement: z.ZodOptional<z.ZodNumber>;
162
+ }, z.core.$strict>;
163
+ export type PluginSectionCutOptions = z.infer<typeof PluginSectionCutOptions>;
164
+ export declare const PluginSectionCutArgs: z.ZodObject<{
165
+ sectionId: z.ZodString;
166
+ options: z.ZodOptional<z.ZodObject<{
167
+ maxSegmentsPerElement: z.ZodOptional<z.ZodNumber>;
168
+ }, z.core.$strict>>;
169
+ }, z.core.$strict>;
170
+ export type PluginSectionCutArgs = z.infer<typeof PluginSectionCutArgs>;
171
+ /**
172
+ * A rect on the cutting plane. `u` runs along the line from the first head
173
+ * (0) to the second (the line's length); `v` is world Y.
174
+ */
175
+ export declare const PluginSectionExtent: z.ZodObject<{
176
+ uMin: z.ZodNumber;
177
+ uMax: z.ZodNumber;
178
+ vMin: z.ZodNumber;
179
+ vMax: z.ZodNumber;
180
+ }, z.core.$strip>;
181
+ export type PluginSectionExtent = z.infer<typeof PluginSectionExtent>;
182
+ /**
183
+ * One element a section cuts.
184
+ *
185
+ * | Property | Type | Description |
186
+ * |---|---|---|
187
+ * | `entityId` | `string` | The element's component id (a `ComponentHandle`) |
188
+ * | `type` | `string` | Its component type ("wall", "slab", "mass", …) |
189
+ * | `area` | `number` | Cut area inside the section's extents, square babylon units |
190
+ * | `perimeter` | `number` | Length of the cut outline inside the extents, babylon units |
191
+ * | `extent` | {@linkcode PluginSectionExtent} | Where the cut lies on the plane |
192
+ * | `isHatched` | `boolean` | `false` for masses and voids, which the drawing leaves unfilled |
193
+ * | `isOpening` | `boolean` | Doors and windows, which the drawing fills white |
194
+ * | `segments` | `[u0, v0, u1, v1][]` | Cut outline segments, when asked for |
195
+ * | `droppedSegmentCount` | `number` | Segments not returned because of `maxSegmentsPerElement` |
196
+ */
197
+ export declare const PluginSectionCutElement: z.ZodObject<{
198
+ entityId: z.ZodString;
199
+ type: z.ZodString;
200
+ area: z.ZodNumber;
201
+ perimeter: z.ZodNumber;
202
+ extent: z.ZodObject<{
203
+ uMin: z.ZodNumber;
204
+ uMax: z.ZodNumber;
205
+ vMin: z.ZodNumber;
206
+ vMax: z.ZodNumber;
207
+ }, z.core.$strip>;
208
+ isHatched: z.ZodBoolean;
209
+ isOpening: z.ZodBoolean;
210
+ segments: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
211
+ droppedSegmentCount: z.ZodNumber;
212
+ }, z.core.$strip>;
213
+ export type PluginSectionCutElement = z.infer<typeof PluginSectionCutElement>;
214
+ /**
215
+ * What a section cuts, from {@linkcode PluginPresentationSectionsApi.getCut}.
216
+ *
217
+ * | Property | Type | Description |
218
+ * |---|---|---|
219
+ * | `sectionId` | `string` | The section |
220
+ * | `origin` | `{ x, y, z }` | World point at `u = 0, v = 0`: the first head, at Y 0 |
221
+ * | `uAxis` | `{ x, y, z }` | Unit direction of `u`: from the first head to the second |
222
+ * | `normal` | `{ x, y, z }` | Unit direction the section looks |
223
+ * | `extent` | {@linkcode PluginSectionExtent} | The cut rect: `u` 0 to the line's length, `v` base to top |
224
+ * | `elements` | {@linkcode PluginSectionCutElement}`[]` | What it cuts, largest area first |
225
+ * | `candidateCount` | `number` | Meshes near the plane that were tested |
226
+ * | `durationInMs` | `number` | Time the query took |
227
+ */
228
+ export declare const PluginSectionCut: z.ZodObject<{
229
+ sectionId: z.ZodString;
230
+ origin: z.ZodObject<{
231
+ x: z.ZodNumber;
232
+ y: z.ZodNumber;
233
+ z: z.ZodNumber;
234
+ }, z.core.$strip>;
235
+ uAxis: z.ZodObject<{
236
+ x: z.ZodNumber;
237
+ y: z.ZodNumber;
238
+ z: z.ZodNumber;
239
+ }, z.core.$strip>;
240
+ normal: z.ZodObject<{
241
+ x: z.ZodNumber;
242
+ y: z.ZodNumber;
243
+ z: z.ZodNumber;
244
+ }, z.core.$strip>;
245
+ extent: z.ZodObject<{
246
+ uMin: z.ZodNumber;
247
+ uMax: z.ZodNumber;
248
+ vMin: z.ZodNumber;
249
+ vMax: z.ZodNumber;
250
+ }, z.core.$strip>;
251
+ elements: z.ZodArray<z.ZodObject<{
252
+ entityId: z.ZodString;
253
+ type: z.ZodString;
254
+ area: z.ZodNumber;
255
+ perimeter: z.ZodNumber;
256
+ extent: z.ZodObject<{
257
+ uMin: z.ZodNumber;
258
+ uMax: z.ZodNumber;
259
+ vMin: z.ZodNumber;
260
+ vMax: z.ZodNumber;
261
+ }, z.core.$strip>;
262
+ isHatched: z.ZodBoolean;
263
+ isOpening: z.ZodBoolean;
264
+ segments: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
265
+ droppedSegmentCount: z.ZodNumber;
266
+ }, z.core.$strip>>;
267
+ candidateCount: z.ZodNumber;
268
+ durationInMs: z.ZodNumber;
269
+ }, z.core.$strip>;
270
+ export type PluginSectionCut = z.infer<typeof PluginSectionCut>;
271
+ /**
272
+ * Sections: lines on the plan that cut the model, each with its own section
273
+ * view.
274
+ *
275
+ * A section is a cutting plane through its line, vertical, looking one way
276
+ * along it; its view keeps `depth` behind the line, between `base` and `top`.
277
+ * Create, read, edit and delete sections (`create`, `list`, `get`, `update`,
278
+ * `delete`), open one's view (`setActive`, `getActive`), and ask what it cuts
279
+ * (`getCut`): which elements the plane passes through, with the area, outline
280
+ * and extent of each cut. `getCut` is computed from the model, needs no open
281
+ * view and changes nothing.
282
+ *
283
+ * Writes are write-gated and each call is one undo step. Geometry edits
284
+ * (`start`, `end`, `isFlipped`, `depth`, `base`, `top`) are refused on a locked
285
+ * section; names, marks and hiding are not, and repeating a locked section's
286
+ * geometry unchanged is not a geometry edit. View-only collaborators cannot
287
+ * write.
288
+ *
289
+ * Positions are world coordinates in internal `babylon` units (1 unit =
290
+ * 0.254 m, Y up); a section's heads are plan points `{ x, z }`. Accessed via
291
+ * `snaptrude.presentation.sections`.
292
+ */
293
+ export declare abstract class PluginPresentationSectionsApi {
294
+ constructor();
295
+ /**
296
+ * List the project's sections, in Views panel order.
297
+ *
298
+ * @returns Every {@linkcode PluginSection} (`[]` when there are none).
299
+ *
300
+ * @examplePrompt Which sections are there?
301
+ * @examplePrompt List the section lines in this project
302
+ * @examplePrompt Is there a section through the stair?
303
+ *
304
+ * # Example
305
+ * ```ts
306
+ * const sections = await snaptrude.presentation.sections.list()
307
+ * ```
308
+ */
309
+ abstract list(): PluginApiReturn<PluginSection[]>;
310
+ /**
311
+ * Get one section by id.
312
+ *
313
+ * @param sectionId - The section's id
314
+ * @returns The {@linkcode PluginSection}, or `null` when there is none with that id.
315
+ *
316
+ * @examplePrompt Where does Section A run?
317
+ * @examplePrompt How deep is this section?
318
+ *
319
+ * # Example
320
+ * ```ts
321
+ * const section = await snaptrude.presentation.sections.get(sectionId)
322
+ * console.log(section?.start, section?.end)
323
+ * ```
324
+ */
325
+ abstract get(sectionId: string): PluginApiReturn<PluginSection | null>;
326
+ /**
327
+ * Get the section whose view is open.
328
+ *
329
+ * @returns The open {@linkcode PluginSection}, or `null` when no section view is open.
330
+ *
331
+ * @examplePrompt Which section am I looking at?
332
+ *
333
+ * # Example
334
+ * ```ts
335
+ * const open = await snaptrude.presentation.sections.getActive()
336
+ * ```
337
+ */
338
+ abstract getActive(): PluginApiReturn<PluginSection | null>;
339
+ /**
340
+ * Open a section's view, or close the open one with `null`. Opening frames
341
+ * the section's saved camera, or a straight-on view when it has none.
342
+ * Closing returns to 3D; with no section view open, `null` does nothing. Not
343
+ * an edit: nothing is added to the undo history.
344
+ *
345
+ * @param sectionId - The section to open, or `null` to close the section view
346
+ * @returns The open {@linkcode PluginSection}, or `null` after closing.
347
+ * @throws HANDLE_INVALID when there is no section with that id.
348
+ *
349
+ * @examplePrompt Open Section A
350
+ * @examplePrompt Show me the section through the atrium
351
+ * @examplePrompt Close the section view
352
+ *
353
+ * # Example
354
+ * ```ts
355
+ * await snaptrude.presentation.sections.setActive(section.sectionId)
356
+ * await snaptrude.presentation.sections.setActive(null)
357
+ * ```
358
+ */
359
+ abstract setActive(sectionId: string | null): PluginApiReturn<PluginSection | null>;
360
+ /**
361
+ * Draw a section line from `start` to `end` on the plan. The section looks
362
+ * along the line's direction turned a quarter turn — a line drawn toward +x
363
+ * looks toward +z; flip it with `update(id, { isFlipped: true })`. Its slice
364
+ * defaults to the building's full height and its depth to the far side of
365
+ * the model. Write-gated; one undo step.
366
+ *
367
+ * @param start - First head, a plan point `{ x, z }`
368
+ * @param end - Second head; must differ from `start`
369
+ * @param options - Name, mark, depth, slice, building and whether to open it ({@linkcode PluginSectionCreateOptions})
370
+ * @returns The new {@linkcode PluginSection}.
371
+ * @throws METHOD_NOT_PERMITTED when plugin writes are disabled. VALIDATION when
372
+ * `start` and `end` coincide or `top` is not above `base`. PRECONDITION_FAILED
373
+ * when the project is view-only or has no model to cut.
374
+ *
375
+ * @examplePrompt Cut a section through the middle of the building, east to west
376
+ * @examplePrompt Add a section across the stair core
377
+ * @examplePrompt Draw a longitudinal section and open it
378
+ *
379
+ * # Example
380
+ * ```ts
381
+ * const section = await snaptrude.presentation.sections.create(
382
+ * { x: -40, z: 10 },
383
+ * { x: 40, z: 10 },
384
+ * { name: "Longitudinal", isActive: true },
385
+ * )
386
+ * ```
387
+ */
388
+ abstract create(start: PluginSectionPoint, end: PluginSectionPoint, options?: PluginSectionCreateOptions): PluginApiReturn<PluginSection>;
389
+ /**
390
+ * Change a section. Only the given fields change; the whole patch is one
391
+ * undo step. Flipping without a `depth` carries the depth to the far side of
392
+ * the model in the new direction, as `create` does. Write-gated.
393
+ *
394
+ * @param sectionId - The section's id
395
+ * @param patch - The fields to change ({@linkcode PluginSectionPatch})
396
+ * @returns The updated {@linkcode PluginSection}.
397
+ * @throws METHOD_NOT_PERMITTED when plugin writes are disabled. HANDLE_INVALID when
398
+ * there is no section with that id. VALIDATION when the heads coincide or `top`
399
+ * is not above `base`. PRECONDITION_FAILED when the project is view-only, or the
400
+ * patch changes a locked section's geometry.
401
+ *
402
+ * @examplePrompt Make Section A look the other way
403
+ * @examplePrompt Only show the ground floor in this section
404
+ * @examplePrompt Rename the section to "Through atrium"
405
+ * @examplePrompt Move the section line 5 m north
406
+ *
407
+ * # Example
408
+ * ```ts
409
+ * await snaptrude.presentation.sections.update(sectionId, {
410
+ * isFlipped: true,
411
+ * depth: 60,
412
+ * })
413
+ * ```
414
+ */
415
+ abstract update(sectionId: string, patch: PluginSectionPatch): PluginApiReturn<PluginSection>;
416
+ /**
417
+ * Delete a section. Closes its view first if it is open. Write-gated; one
418
+ * undo step.
419
+ *
420
+ * @param sectionId - The section's id
421
+ * @returns `true` once it has been deleted.
422
+ * @throws METHOD_NOT_PERMITTED when plugin writes are disabled. HANDLE_INVALID when
423
+ * there is no section with that id. PRECONDITION_FAILED when the project is view-only.
424
+ *
425
+ * @examplePrompt Delete Section B
426
+ *
427
+ * # Example
428
+ * ```ts
429
+ * await snaptrude.presentation.sections.delete(sectionId)
430
+ * ```
431
+ */
432
+ abstract delete(sectionId: string): PluginApiReturn<boolean>;
433
+ /**
434
+ * What a section cuts: every element its cutting plane passes through within
435
+ * the section's extents, with the cut's area, outline length and extent on
436
+ * the plane, largest first. Computed from the model, not from the drawing, so
437
+ * it needs no open view and works however the section is shown; furniture is
438
+ * left out, as in the drawing, and so is anything hidden in the model. Areas are exact for closed solids. Repeated
439
+ * calls reuse the cuts of elements that have not changed. Read-only.
440
+ *
441
+ * @param sectionId - The section's id
442
+ * @param options - Whether to return outline segments ({@linkcode PluginSectionCutOptions})
443
+ * @returns The {@linkcode PluginSectionCut}.
444
+ * @throws HANDLE_INVALID when there is no section with that id.
445
+ *
446
+ * @examplePrompt Which walls does Section A cut?
447
+ * @examplePrompt How thick is the slab where the section crosses it?
448
+ * @examplePrompt Does this section go through the stair?
449
+ * @examplePrompt What is the floor-to-floor height in this section?
450
+ *
451
+ * # Example
452
+ * ```ts
453
+ * const cut = await snaptrude.presentation.sections.getCut(sectionId)
454
+ * const walls = cut.elements.filter((element) => element.type === "wall")
455
+ * const thickest = walls[0]
456
+ * console.log(thickest.extent.uMax - thickest.extent.uMin)
457
+ * ```
458
+ */
459
+ abstract getCut(sectionId: string, options?: PluginSectionCutOptions): PluginApiReturn<PluginSectionCut>;
460
+ }
461
+ //# sourceMappingURL=sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/sections.ts"],"names":[],"mappings":"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"}
@@ -231,11 +231,11 @@ export declare const PluginPresentationShapeSpec: z.ZodDiscriminatedUnion<[z.Zod
231
231
  }, z.core.$strip>, z.ZodObject<{
232
232
  type: z.ZodLiteral<"geo">;
233
233
  kind: z.ZodEnum<{
234
+ hexagon: "hexagon";
234
235
  rectangle: "rectangle";
235
236
  ellipse: "ellipse";
236
237
  triangle: "triangle";
237
238
  diamond: "diamond";
238
- hexagon: "hexagon";
239
239
  oval: "oval";
240
240
  rhombus: "rhombus";
241
241
  star: "star";
@@ -386,11 +386,11 @@ export declare const PluginPresentationShapesUpsertArgs: z.ZodObject<{
386
386
  }, z.core.$strip>, z.ZodObject<{
387
387
  type: z.ZodLiteral<"geo">;
388
388
  kind: z.ZodEnum<{
389
+ hexagon: "hexagon";
389
390
  rectangle: "rectangle";
390
391
  ellipse: "ellipse";
391
392
  triangle: "triangle";
392
393
  diamond: "diamond";
393
- hexagon: "hexagon";
394
394
  oval: "oval";
395
395
  rhombus: "rhombus";
396
396
  star: "star";