@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.
Files changed (302) hide show
  1. package/AGENTS.md +130 -48
  2. package/CHANGELOG.md +163 -0
  3. package/api-manifest.full.json +5600 -0
  4. package/api-manifest.json +5502 -0
  5. package/dist/api/analysis/heatmaps.d.ts +234 -0
  6. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  7. package/dist/api/analysis/illuminance.d.ts +145 -0
  8. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  9. package/dist/api/analysis/index.d.ts +44 -0
  10. package/dist/api/analysis/index.d.ts.map +1 -0
  11. package/dist/api/analysis/shadows.d.ts +165 -0
  12. package/dist/api/analysis/shadows.d.ts.map +1 -0
  13. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  14. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  15. package/dist/api/analysis/sunpath.d.ts +80 -0
  16. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  17. package/dist/api/core/buildings.d.ts +427 -0
  18. package/dist/api/core/buildings.d.ts.map +1 -0
  19. package/dist/api/core/comment/index.d.ts +230 -0
  20. package/dist/api/core/comment/index.d.ts.map +1 -0
  21. package/dist/api/core/geom/create/index.d.ts +247 -0
  22. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  23. package/dist/api/core/geom/delete/index.d.ts +72 -0
  24. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  25. package/dist/api/core/geom/index.d.ts +24 -23
  26. package/dist/api/core/geom/index.d.ts.map +1 -1
  27. package/dist/api/core/geom/query/arc.d.ts +169 -0
  28. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  29. package/dist/api/core/geom/query/brep.d.ts +402 -0
  30. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  31. package/dist/api/core/geom/query/circle.d.ts +378 -0
  32. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  33. package/dist/api/core/geom/query/contour.d.ts +450 -0
  34. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/curve.d.ts +918 -0
  36. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  37. package/dist/api/core/geom/query/edge.d.ts +128 -0
  38. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  39. package/dist/api/core/geom/query/face.d.ts +363 -0
  40. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  41. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  42. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  43. package/dist/api/core/geom/query/index.d.ts +61 -0
  44. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  45. package/dist/api/core/geom/query/profile.d.ts +410 -0
  46. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  47. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  48. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  49. package/dist/api/core/geom/update/contour.d.ts +272 -0
  50. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  51. package/dist/api/core/geom/update/curve.d.ts +180 -0
  52. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  53. package/dist/api/core/geom/update/index.d.ts +27 -0
  54. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  55. package/dist/api/core/geom/update/profile.d.ts +329 -0
  56. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  57. package/dist/api/core/groups.d.ts +485 -0
  58. package/dist/api/core/groups.d.ts.map +1 -0
  59. package/dist/api/core/history/index.d.ts +78 -0
  60. package/dist/api/core/history/index.d.ts.map +1 -0
  61. package/dist/api/core/index.d.ts +51 -1
  62. package/dist/api/core/index.d.ts.map +1 -1
  63. package/dist/api/core/io/import/index.d.ts +392 -0
  64. package/dist/api/core/io/import/index.d.ts.map +1 -0
  65. package/dist/api/core/io/index.d.ts +35 -0
  66. package/dist/api/core/io/index.d.ts.map +1 -0
  67. package/dist/api/core/io/job/index.d.ts +139 -0
  68. package/dist/api/core/io/job/index.d.ts.map +1 -0
  69. package/dist/api/core/io/query/index.d.ts +74 -0
  70. package/dist/api/core/io/query/index.d.ts.map +1 -0
  71. package/dist/api/core/io/terrain/index.d.ts +206 -0
  72. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  73. package/dist/api/core/io/underlay/index.d.ts +286 -0
  74. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  75. package/dist/api/core/layers.d.ts +402 -0
  76. package/dist/api/core/layers.d.ts.map +1 -0
  77. package/dist/api/core/math/quat.d.ts +111 -128
  78. package/dist/api/core/math/quat.d.ts.map +1 -1
  79. package/dist/api/core/math/vec3.d.ts +120 -102
  80. package/dist/api/core/math/vec3.d.ts.map +1 -1
  81. package/dist/api/core/project/index.d.ts +399 -0
  82. package/dist/api/core/project/index.d.ts.map +1 -0
  83. package/dist/api/core/tags.d.ts +755 -0
  84. package/dist/api/core/tags.d.ts.map +1 -0
  85. package/dist/api/core/units/index.d.ts +175 -0
  86. package/dist/api/core/units/index.d.ts.map +1 -0
  87. package/dist/api/core/zoom/index.d.ts +45 -0
  88. package/dist/api/core/zoom/index.d.ts.map +1 -0
  89. package/dist/api/design/boolean/index.d.ts +168 -0
  90. package/dist/api/design/boolean/index.d.ts.map +1 -0
  91. package/dist/api/design/create/index.d.ts +837 -0
  92. package/dist/api/design/create/index.d.ts.map +1 -0
  93. package/dist/api/design/delete/index.d.ts +63 -0
  94. package/dist/api/design/delete/index.d.ts.map +1 -0
  95. package/dist/api/design/doors/index.d.ts +268 -0
  96. package/dist/api/design/doors/index.d.ts.map +1 -0
  97. package/dist/api/design/edit/index.d.ts +49 -0
  98. package/dist/api/design/edit/index.d.ts.map +1 -0
  99. package/dist/api/design/erase/index.d.ts +160 -0
  100. package/dist/api/design/erase/index.d.ts.map +1 -0
  101. package/dist/api/design/furniture/index.d.ts +123 -0
  102. package/dist/api/design/furniture/index.d.ts.map +1 -0
  103. package/dist/api/design/index.d.ts +153 -0
  104. package/dist/api/design/index.d.ts.map +1 -0
  105. package/dist/api/design/lock.d.ts +41 -0
  106. package/dist/api/design/lock.d.ts.map +1 -0
  107. package/dist/api/design/materials/index.d.ts +297 -0
  108. package/dist/api/design/materials/index.d.ts.map +1 -0
  109. package/dist/api/design/query/geometry/index.d.ts +140 -0
  110. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  111. package/dist/api/design/query/index.d.ts +1011 -0
  112. package/dist/api/design/query/index.d.ts.map +1 -0
  113. package/dist/api/design/query/spaces.d.ts +221 -0
  114. package/dist/api/design/query/spaces.d.ts.map +1 -0
  115. package/dist/api/design/selection/index.d.ts +282 -0
  116. package/dist/api/design/selection/index.d.ts.map +1 -0
  117. package/dist/api/design/shared.d.ts +38 -0
  118. package/dist/api/design/shared.d.ts.map +1 -0
  119. package/dist/api/design/transform/index.d.ts +87 -0
  120. package/dist/api/design/transform/index.d.ts.map +1 -0
  121. package/dist/api/design/update/index.d.ts +178 -0
  122. package/dist/api/design/update/index.d.ts.map +1 -0
  123. package/dist/api/design/windows/index.d.ts +189 -0
  124. package/dist/api/design/windows/index.d.ts.map +1 -0
  125. package/dist/api/entity/buildableEnvelope.d.ts +261 -0
  126. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  127. package/dist/api/entity/department.d.ts +0 -98
  128. package/dist/api/entity/department.d.ts.map +1 -1
  129. package/dist/api/entity/index.d.ts +9 -9
  130. package/dist/api/entity/index.d.ts.map +1 -1
  131. package/dist/api/entity/referenceLine.d.ts +49 -106
  132. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  133. package/dist/api/entity/space.d.ts +484 -251
  134. package/dist/api/entity/space.d.ts.map +1 -1
  135. package/dist/api/entity/story.d.ts +49 -39
  136. package/dist/api/entity/story.d.ts.map +1 -1
  137. package/dist/api/index.d.ts +22 -12
  138. package/dist/api/index.d.ts.map +1 -1
  139. package/dist/api/presentation/aiInspiration.d.ts +440 -0
  140. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  141. package/dist/api/presentation/diagrams.d.ts +81 -0
  142. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  143. package/dist/api/presentation/import.d.ts +113 -0
  144. package/dist/api/presentation/import.d.ts.map +1 -0
  145. package/dist/api/presentation/index.d.ts +46 -0
  146. package/dist/api/presentation/index.d.ts.map +1 -0
  147. package/dist/api/presentation/sheets.d.ts +176 -0
  148. package/dist/api/presentation/sheets.d.ts.map +1 -0
  149. package/dist/api/presentation/views.d.ts +296 -0
  150. package/dist/api/presentation/views.d.ts.map +1 -0
  151. package/dist/api/program/adjacency.d.ts +155 -0
  152. package/dist/api/program/adjacency.d.ts.map +1 -0
  153. package/dist/api/program/areas.d.ts +360 -0
  154. package/dist/api/program/areas.d.ts.map +1 -0
  155. package/dist/api/program/classification.d.ts +135 -0
  156. package/dist/api/program/classification.d.ts.map +1 -0
  157. package/dist/api/program/cores.d.ts +174 -0
  158. package/dist/api/program/cores.d.ts.map +1 -0
  159. package/dist/api/program/departments.d.ts +431 -0
  160. package/dist/api/program/departments.d.ts.map +1 -0
  161. package/dist/api/program/index.d.ts +69 -0
  162. package/dist/api/program/index.d.ts.map +1 -0
  163. package/dist/api/program/layout.d.ts +63 -0
  164. package/dist/api/program/layout.d.ts.map +1 -0
  165. package/dist/api/program/metrics.d.ts +108 -0
  166. package/dist/api/program/metrics.d.ts.map +1 -0
  167. package/dist/api/program/site.d.ts +451 -0
  168. package/dist/api/program/site.d.ts.map +1 -0
  169. package/dist/api/program/spreadsheet.d.ts +2041 -0
  170. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  171. package/dist/handles.d.ts +171 -0
  172. package/dist/handles.d.ts.map +1 -0
  173. package/dist/host-utils.d.ts +7 -5
  174. package/dist/host-utils.d.ts.map +1 -1
  175. package/dist/index.cjs +4344 -899
  176. package/dist/index.cjs.map +1 -1
  177. package/dist/index.d.ts +1 -0
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +3682 -865
  180. package/dist/index.js.map +1 -1
  181. package/package.json +6 -2
  182. package/scripts/generate-manifest.mjs +193 -0
  183. package/scripts/generate-manifest.test.mjs +215 -0
  184. package/src/api/analysis/heatmaps.ts +256 -0
  185. package/src/api/analysis/illuminance.ts +155 -0
  186. package/src/api/analysis/index.ts +46 -0
  187. package/src/api/analysis/shadows.ts +183 -0
  188. package/src/api/analysis/sunlightHours.ts +211 -0
  189. package/src/api/analysis/sunpath.ts +83 -0
  190. package/src/api/core/buildings.ts +485 -0
  191. package/src/api/core/comment/index.ts +258 -0
  192. package/src/api/core/geom/create/index.ts +293 -0
  193. package/src/api/core/geom/delete/index.ts +78 -0
  194. package/src/api/core/geom/index.ts +24 -23
  195. package/src/api/core/geom/query/arc.ts +169 -0
  196. package/src/api/core/geom/query/brep.ts +444 -0
  197. package/src/api/core/geom/query/circle.ts +404 -0
  198. package/src/api/core/geom/query/contour.ts +540 -0
  199. package/src/api/core/geom/query/curve.ts +1078 -0
  200. package/src/api/core/geom/query/edge.ts +130 -0
  201. package/src/api/core/geom/query/face.ts +403 -0
  202. package/src/api/core/geom/query/halfedge.ts +210 -0
  203. package/src/api/core/geom/query/index.ts +63 -0
  204. package/src/api/core/geom/query/profile.ts +473 -0
  205. package/src/api/core/geom/query/vertex.ts +205 -0
  206. package/src/api/core/geom/update/contour.ts +315 -0
  207. package/src/api/core/geom/update/curve.ts +209 -0
  208. package/src/api/core/geom/update/index.ts +29 -0
  209. package/src/api/core/geom/update/profile.ts +377 -0
  210. package/src/api/core/groups.ts +521 -0
  211. package/src/api/core/history/index.ts +84 -0
  212. package/src/api/core/index.ts +51 -1
  213. package/src/api/core/io/import/index.ts +432 -0
  214. package/src/api/core/io/index.ts +37 -0
  215. package/src/api/core/io/job/index.ts +140 -0
  216. package/src/api/core/io/query/index.ts +71 -0
  217. package/src/api/core/io/terrain/index.ts +214 -0
  218. package/src/api/core/io/underlay/index.ts +295 -0
  219. package/src/api/core/layers.ts +333 -0
  220. package/src/api/core/math/quat.ts +112 -235
  221. package/src/api/core/math/vec3.ts +124 -159
  222. package/src/api/core/project/index.ts +418 -0
  223. package/src/api/core/tags.ts +808 -0
  224. package/src/api/core/units/index.ts +164 -0
  225. package/src/api/core/zoom/index.ts +47 -0
  226. package/src/api/design/boolean/index.ts +179 -0
  227. package/src/api/design/create/index.ts +895 -0
  228. package/src/api/design/delete/index.ts +67 -0
  229. package/src/api/design/doors/index.ts +285 -0
  230. package/src/api/design/edit/index.ts +54 -0
  231. package/src/api/design/erase/index.ts +151 -0
  232. package/src/api/design/furniture/index.ts +130 -0
  233. package/src/api/design/index.ts +162 -0
  234. package/src/api/design/lock.ts +42 -0
  235. package/src/api/design/materials/index.ts +301 -0
  236. package/src/api/design/query/geometry/index.ts +166 -0
  237. package/src/api/design/query/index.ts +937 -0
  238. package/src/api/design/query/spaces.ts +132 -0
  239. package/src/api/design/selection/index.ts +273 -0
  240. package/src/api/design/shared.ts +40 -0
  241. package/src/api/design/transform/index.ts +93 -0
  242. package/src/api/design/update/index.ts +117 -0
  243. package/src/api/design/windows/index.ts +207 -0
  244. package/src/api/entity/buildableEnvelope.ts +318 -0
  245. package/src/api/entity/department.ts +0 -113
  246. package/src/api/entity/index.ts +9 -9
  247. package/src/api/entity/referenceLine.ts +50 -38
  248. package/src/api/entity/space.ts +285 -226
  249. package/src/api/entity/story.ts +53 -42
  250. package/src/api/index.ts +22 -12
  251. package/src/api/presentation/aiInspiration.ts +362 -0
  252. package/src/api/presentation/diagrams.ts +84 -0
  253. package/src/api/presentation/import.ts +112 -0
  254. package/src/api/presentation/index.ts +48 -0
  255. package/src/api/presentation/sheets.ts +198 -0
  256. package/src/api/presentation/views.ts +303 -0
  257. package/src/api/program/adjacency.ts +164 -0
  258. package/src/api/program/areas.ts +335 -0
  259. package/src/api/program/classification.ts +138 -0
  260. package/src/api/program/cores.ts +171 -0
  261. package/src/api/program/departments.ts +465 -0
  262. package/src/api/program/index.ts +71 -0
  263. package/src/api/program/layout.ts +68 -0
  264. package/src/api/program/metrics.ts +120 -0
  265. package/src/api/program/site.ts +419 -0
  266. package/src/api/program/spreadsheet.ts +2075 -0
  267. package/src/handles.ts +194 -0
  268. package/src/host-utils.ts +10 -6
  269. package/src/index.ts +1 -0
  270. package/dist/api/core/geom/arc.d.ts +0 -81
  271. package/dist/api/core/geom/arc.d.ts.map +0 -1
  272. package/dist/api/core/geom/curve.d.ts +0 -70
  273. package/dist/api/core/geom/curve.d.ts.map +0 -1
  274. package/dist/api/core/geom/line.d.ts +0 -56
  275. package/dist/api/core/geom/line.d.ts.map +0 -1
  276. package/dist/api/core/geom/profile.d.ts +0 -121
  277. package/dist/api/core/geom/profile.d.ts.map +0 -1
  278. package/dist/api/tools/copy.d.ts +0 -59
  279. package/dist/api/tools/copy.d.ts.map +0 -1
  280. package/dist/api/tools/index.d.ts +0 -33
  281. package/dist/api/tools/index.d.ts.map +0 -1
  282. package/dist/api/tools/material.d.ts +0 -51
  283. package/dist/api/tools/material.d.ts.map +0 -1
  284. package/dist/api/tools/offset.d.ts +0 -43
  285. package/dist/api/tools/offset.d.ts.map +0 -1
  286. package/dist/api/tools/selection.d.ts +0 -48
  287. package/dist/api/tools/selection.d.ts.map +0 -1
  288. package/dist/api/tools/transform.d.ts +0 -114
  289. package/dist/api/tools/transform.d.ts.map +0 -1
  290. package/dist/api/units/index.d.ts +0 -163
  291. package/dist/api/units/index.d.ts.map +0 -1
  292. package/src/api/core/geom/arc.ts +0 -70
  293. package/src/api/core/geom/curve.ts +0 -41
  294. package/src/api/core/geom/line.ts +0 -53
  295. package/src/api/core/geom/profile.ts +0 -94
  296. package/src/api/tools/copy.ts +0 -55
  297. package/src/api/tools/index.ts +0 -39
  298. package/src/api/tools/material.ts +0 -49
  299. package/src/api/tools/offset.ts +0 -43
  300. package/src/api/tools/selection.ts +0 -51
  301. package/src/api/tools/transform.ts +0 -117
  302. package/src/api/units/index.ts +0 -163
@@ -0,0 +1,895 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../../types"
3
+ import {
4
+ ComponentHandle,
5
+ ContourHandle,
6
+ ProfileHandle,
7
+ Vec3Handle,
8
+ } from "../../../handles"
9
+ import {
10
+ PluginSpaceType,
11
+ PluginMassType,
12
+ PluginDepartmentId,
13
+ } from "../../entity/space"
14
+
15
+ /**
16
+ * `design.create.*` — author new scene-committed BIM entities.
17
+ *
18
+ * Every creator takes geometry handles + scalars and returns a
19
+ * {@linkcode ComponentHandle} (or `ComponentHandle[]` for plural creators) — the
20
+ * `Component.id` of the created entity, resolvable across the rest of the
21
+ * `design.*` surface. Creation is an undoable host call; it **throws** on failure
22
+ * (no `Result` wrapper — consistent with `core.geom.create.*`).
23
+ *
24
+ * Footprint objects take a {@linkcode ContourHandle} (outer profile + holes);
25
+ * build one with `snaptrude.core.geom.create.contourFromProfile(s)`.
26
+ *
27
+ * Accessed via `snaptrude.design.create`.
28
+ */
29
+ export abstract class PluginDesignCreateApi {
30
+ constructor() {}
31
+
32
+ /**
33
+ * Create a **space** (a room / mass) by extruding a footprint contour upward.
34
+ *
35
+ * The `contour` is the bottom footprint (outer profile + optional holes); it
36
+ * is extruded by `height` along +Y. The space is placed on the active story
37
+ * and assigned a default department unless overridden.
38
+ *
39
+ * @param contour - Bottom footprint (outer + holes)
40
+ * @param height - Extrusion height (Snaptrude units, > 0)
41
+ * @param label - Room label (maps to the space's `room_type`)
42
+ * @param position - Offset from origin (default origin)
43
+ * @param spaceType - Space-type classification (default `Room`)
44
+ * @param massType - Mass-type classification (default `Room`)
45
+ * @param departmentId - Department assignment (default department)
46
+ * @returns the {@linkcode ComponentHandle} of the created space
47
+ * @throws if the contour is invalid or the height is not positive
48
+ *
49
+ * @examplePrompt Create a room called Living Room that's 3m tall from this outline
50
+ * @examplePrompt Add a new space on the current storey using this footprint
51
+ * @examplePrompt Make a bedroom here and assign it to the Residential department
52
+ * @examplePrompt Extrude this closed outline into a 10 foot high room
53
+ * @examplePrompt Can you create a Kitchen space from the sketch I just drew?
54
+ *
55
+ * # Example
56
+ * ```ts
57
+ * const v = snaptrude.core.math.vec3
58
+ * const outer = await snaptrude.core.geom.create.profileFromLinePoints([
59
+ * await v.new(0, 0, 0),
60
+ * await v.new(10, 0, 0),
61
+ * await v.new(10, 0, 8),
62
+ * await v.new(0, 0, 8),
63
+ * ])
64
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(outer)
65
+ * const space = await snaptrude.design.create.space(contour, 3, "Living")
66
+ * ```
67
+ */
68
+ public abstract space(
69
+ contour: ContourHandle,
70
+ height: number,
71
+ label?: string,
72
+ position?: Vec3Handle,
73
+ spaceType?: PluginSpaceType,
74
+ massType?: PluginMassType,
75
+ departmentId?: PluginDepartmentId,
76
+ ): PluginApiReturn<ComponentHandle>
77
+
78
+ /**
79
+ * Create a **mass** — a generic extruded prism (default `massType` "Generic mass").
80
+ * Same footprint-extrude path as {@linkcode PluginDesignCreateApi.space}.
81
+ *
82
+ * @param contour - Footprint (outer + holes)
83
+ * @param height - Extrusion height (> 0)
84
+ * @param label - Label (maps to `room_type`)
85
+ * @param position - Offset from origin
86
+ * @param massType - Mass type (default `Generic mass`)
87
+ * @returns the {@linkcode ComponentHandle} of the created mass
88
+ * @throws if the contour is invalid or the height is not positive
89
+ *
90
+ * @examplePrompt Create a generic mass 30m tall from this footprint
91
+ * @examplePrompt Block out a conceptual massing volume for the site
92
+ * @examplePrompt Extrude this shape into a building mass
93
+ * @examplePrompt Add a simple study-model volume at the origin
94
+ *
95
+ * # Example
96
+ * ```ts
97
+ * const rect = await snaptrude.core.geom.create.profileRect(20, 15)
98
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
99
+ * const tower = await snaptrude.design.create.mass(contour, 30, "Tower A", undefined, "Building")
100
+ * ```
101
+ */
102
+ public abstract mass(
103
+ contour: ContourHandle,
104
+ height: number,
105
+ label?: string,
106
+ position?: Vec3Handle,
107
+ massType?: PluginMassType,
108
+ ): PluginApiReturn<ComponentHandle>
109
+
110
+ /**
111
+ * Create a **slab** by extruding a footprint contour by `thickness`
112
+ * (default direction: down).
113
+ *
114
+ * @param contour - Footprint (outer + holes)
115
+ * @param thickness - Slab thickness (> 0)
116
+ * @param direction - Extrusion direction (default `"down"`)
117
+ * @param slabType - Slab-type classification
118
+ * @returns the {@linkcode ComponentHandle} of the created slab
119
+ * @throws if the contour is invalid or the thickness is not positive
120
+ *
121
+ * @examplePrompt Add a 150mm thick slab under this footprint
122
+ * @examplePrompt Create a floor slab from this outline
123
+ * @examplePrompt Pour a plinth slab over the building footprint
124
+ * @examplePrompt Make a basement slab that extrudes downward
125
+ * @examplePrompt Give this room outline a 6 inch slab
126
+ *
127
+ * # Example
128
+ * ```ts
129
+ * const rect = await snaptrude.core.geom.create.profileRect(12, 10)
130
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
131
+ * const slab = await snaptrude.design.create.slab(contour, 0.15, "down", "Plinth")
132
+ * ```
133
+ */
134
+ public abstract slab(
135
+ contour: ContourHandle,
136
+ thickness: number,
137
+ direction?: "up" | "down",
138
+ slabType?: PluginSlabType,
139
+ ): PluginApiReturn<ComponentHandle>
140
+
141
+ /**
142
+ * Create a **floor** by extruding a footprint contour by `thickness`
143
+ * (extruded upward).
144
+ *
145
+ * @param contour - Footprint (outer + holes)
146
+ * @param thickness - Floor thickness (> 0)
147
+ * @param position - Offset from origin
148
+ * @returns the {@linkcode ComponentHandle} of the created floor
149
+ * @throws if the contour is invalid or the thickness is not positive
150
+ *
151
+ * @examplePrompt Create a floor from this room outline
152
+ * @examplePrompt Add a 100mm thick floor over the footprint
153
+ * @examplePrompt Lay flooring across the selected outline
154
+ * @examplePrompt Put a floor at this position with 150mm thickness
155
+ *
156
+ * # Example
157
+ * ```ts
158
+ * const rect = await snaptrude.core.geom.create.profileRect(5, 4)
159
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
160
+ * const floor = await snaptrude.design.create.floor(contour, 0.1)
161
+ * ```
162
+ */
163
+ public abstract floor(
164
+ contour: ContourHandle,
165
+ thickness: number,
166
+ position?: Vec3Handle,
167
+ ): PluginApiReturn<ComponentHandle>
168
+
169
+ /**
170
+ * Create a **roof** by extruding a footprint contour by `thickness`. Created
171
+ * flat (extruded downward); pitch/slope is a separate post-creation edit.
172
+ *
173
+ * @param contour - Footprint (outer + holes)
174
+ * @param thickness - Roof-slab thickness (> 0)
175
+ * @returns the {@linkcode ComponentHandle} of the created roof
176
+ * @throws if the contour is invalid or the thickness is not positive
177
+ *
178
+ * @examplePrompt Add a flat roof over the building footprint
179
+ * @examplePrompt Create a roof 200mm thick from this outline
180
+ * @examplePrompt Cover the top storey with a roof slab
181
+ * @examplePrompt Put a roof on this building
182
+ *
183
+ * # Example
184
+ * ```ts
185
+ * const rect = await snaptrude.core.geom.create.profileRect(12, 10)
186
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
187
+ * const roof = await snaptrude.design.create.roof(contour, 0.2)
188
+ * ```
189
+ */
190
+ public abstract roof(
191
+ contour: ContourHandle,
192
+ thickness: number,
193
+ ): PluginApiReturn<ComponentHandle>
194
+
195
+ /**
196
+ * Create a **ceiling** by extruding a footprint contour by `thickness`, lifted
197
+ * `heightFromFloor` above the floor.
198
+ *
199
+ * @param contour - Footprint (outer + holes)
200
+ * @param thickness - Ceiling thickness (> 0)
201
+ * @param heightFromFloor - Lift above the floor (default 0)
202
+ * @returns the {@linkcode ComponentHandle} of the created ceiling
203
+ * @throws if the contour is invalid or the thickness is not positive
204
+ *
205
+ * @examplePrompt Add a false ceiling 2.7m above the floor
206
+ * @examplePrompt Create a ceiling over this room footprint
207
+ * @examplePrompt Put a dropped ceiling in the living room at 3 metres
208
+ * @examplePrompt Add a 50mm thick ceiling lifted 2800mm from floor level
209
+ *
210
+ * # Example
211
+ * ```ts
212
+ * const rect = await snaptrude.core.geom.create.profileRect(5, 4)
213
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
214
+ * const ceiling = await snaptrude.design.create.ceiling(contour, 0.05, 2.8)
215
+ * ```
216
+ */
217
+ public abstract ceiling(
218
+ contour: ContourHandle,
219
+ thickness: number,
220
+ heightFromFloor?: number,
221
+ ): PluginApiReturn<ComponentHandle>
222
+
223
+ /**
224
+ * Create a **column** by extruding a cross-section contour upward by `height`
225
+ * from a base `position`.
226
+ *
227
+ * @param position - Base point
228
+ * @param crossSection - Column cross-section footprint
229
+ * @param height - Column height (> 0)
230
+ * @param directionUp - Up axis (default world up)
231
+ * @returns the {@linkcode ComponentHandle} of the created column
232
+ * @throws if the cross-section is invalid or the height is not positive
233
+ *
234
+ * @examplePrompt Add a 3m tall column at this point
235
+ * @examplePrompt Place a column at the grid intersection
236
+ * @examplePrompt Create a 450mm square concrete column 4 metres high
237
+ * @examplePrompt Stand a column up from this base point
238
+ *
239
+ * # Example
240
+ * ```ts
241
+ * const rect = await snaptrude.core.geom.create.profileRect(0.45, 0.45)
242
+ * const crossSection = await snaptrude.core.geom.create.contourFromProfile(rect)
243
+ * const base = await snaptrude.core.math.vec3.new(4, 0, 4)
244
+ * const column = await snaptrude.design.create.column(base, crossSection, 3)
245
+ * ```
246
+ */
247
+ public abstract column(
248
+ position: Vec3Handle,
249
+ crossSection: ContourHandle,
250
+ height: number,
251
+ directionUp?: Vec3Handle,
252
+ ): PluginApiReturn<ComponentHandle>
253
+
254
+ /**
255
+ * Create a **beam** by extruding a cross-section contour along `direction` by
256
+ * `length`.
257
+ *
258
+ * @param section - Beam cross-section footprint
259
+ * @param length - Beam length along `direction` (> 0)
260
+ * @param direction - Extrusion axis (default world up)
261
+ * @returns the {@linkcode ComponentHandle} of the created beam
262
+ * @throws if the section is invalid or the length is not positive
263
+ *
264
+ * @examplePrompt Add a beam spanning 6 metres between the columns
265
+ * @examplePrompt Create a horizontal beam along the X axis
266
+ * @examplePrompt Run a 300x600 beam across the room
267
+ * @examplePrompt Extrude this cross-section into a 5m long beam
268
+ *
269
+ * # Example
270
+ * ```ts
271
+ * const rect = await snaptrude.core.geom.create.profileRect(0.3, 0.6)
272
+ * const section = await snaptrude.core.geom.create.contourFromProfile(rect)
273
+ * const alongX = await snaptrude.core.math.vec3.new(1, 0, 0)
274
+ * const beam = await snaptrude.design.create.beam(section, 6, alongX)
275
+ * ```
276
+ */
277
+ public abstract beam(
278
+ section: ContourHandle,
279
+ length: number,
280
+ direction?: Vec3Handle,
281
+ ): PluginApiReturn<ComponentHandle>
282
+
283
+ /**
284
+ * Create a connected run of **walls** from a profile — one wall per curve in
285
+ * the profile's chain, with mitred corners at shared endpoints.
286
+ *
287
+ * @param profile - Ordered curve chain (wall centerlines)
288
+ * @param height - Wall height (default engine default)
289
+ * @param thickness - Wall thickness (default engine default)
290
+ * @returns a {@linkcode ComponentHandle}`[]` (one per wall), in profile order
291
+ * @throws if the profile is empty or wall creation fails
292
+ *
293
+ * @examplePrompt Draw walls along this centerline
294
+ * @examplePrompt Create 3m high, 200mm thick walls from these points
295
+ * @examplePrompt Build a wall run around the room outline
296
+ * @examplePrompt Turn this polyline sketch into walls
297
+ * @examplePrompt Add walls with mitred corners along the path
298
+ *
299
+ * # Example
300
+ * ```ts
301
+ * const v = snaptrude.core.math.vec3
302
+ * const centerlines = await snaptrude.core.geom.create.profileFromLinePoints([
303
+ * await v.new(0, 0, 0),
304
+ * await v.new(8, 0, 0),
305
+ * await v.new(8, 0, 6),
306
+ * ])
307
+ * const walls = await snaptrude.design.create.walls(centerlines, 3, 0.2)
308
+ * ```
309
+ */
310
+ public abstract walls(
311
+ profile: ProfileHandle,
312
+ height?: number,
313
+ thickness?: number,
314
+ ): PluginApiReturn<ComponentHandle[]>
315
+
316
+ /**
317
+ * Create a **staircase** from a parametric preset, placed at a point.
318
+ *
319
+ * Geometry is procedurally generated from the chosen `preset`; there is no
320
+ * footprint input. Placed on the active structure/story unless overridden.
321
+ *
322
+ * @param preset - The parametric preset to generate
323
+ * @param position - Placement point
324
+ * @param label - Optional label
325
+ * @param structureId - Target structure (default active)
326
+ * @param level - Target level name (default active/`"01"`)
327
+ * @returns the {@linkcode ComponentHandle} of the created staircase
328
+ * @throws if the preset is unknown or placement fails
329
+ *
330
+ * @examplePrompt Add a dog-legged staircase at this location
331
+ * @examplePrompt Place a straight stair on level 01
332
+ * @examplePrompt Create an L-shaped staircase in the lobby
333
+ * @examplePrompt Insert a staircase near the entrance
334
+ * @examplePrompt Put amphitheatre steps at these coordinates
335
+ *
336
+ * # Example
337
+ * ```ts
338
+ * const stair = await snaptrude.design.create.staircase(
339
+ * "dogLegged",
340
+ * await snaptrude.core.math.vec3.new(5, 0, 5),
341
+ * )
342
+ * ```
343
+ */
344
+ public abstract staircase(
345
+ preset: PluginStaircasePreset,
346
+ position: Vec3Handle,
347
+ label?: string,
348
+ structureId?: string,
349
+ level?: string,
350
+ ): PluginApiReturn<ComponentHandle>
351
+
352
+ /**
353
+ * Create **reference lines** from a profile — one reference line per curve in
354
+ * the profile's ordered chain. Returns a handle per created line.
355
+ *
356
+ * Optional style (`color`, `thickness`, `style`, `gridTag`) applies to
357
+ * every created line.
358
+ *
359
+ * @param profile - Ordered curve chain (centerlines)
360
+ * @param color - Hex color `"#RRGGBB"` (default white)
361
+ * @param thickness - Line thickness (default 1)
362
+ * @param style - Line style (default `SOLID`)
363
+ * @param gridTag - Grid tag label (default `"A"`)
364
+ * @returns a {@linkcode ComponentHandle}`[]` (one per curve), in profile order
365
+ * @throws if the profile is empty or creation fails
366
+ *
367
+ * @examplePrompt Draw a reference line between these two points
368
+ * @examplePrompt Add dashed guide lines along this path
369
+ * @examplePrompt Create grid lines tagged A through the plan
370
+ * @examplePrompt Set up construction lines for the column grid
371
+ * @examplePrompt Mark a red reference line across the site
372
+ *
373
+ * # Example
374
+ * ```ts
375
+ * const v = snaptrude.core.math.vec3
376
+ * const profile = await snaptrude.core.geom.create.profileFromLinePoints([
377
+ * await v.new(0, 0, 0),
378
+ * await v.new(10, 0, 0),
379
+ * ])
380
+ * const lines = await snaptrude.design.create.referenceLines(
381
+ * profile,
382
+ * undefined,
383
+ * undefined,
384
+ * "DASHED",
385
+ * )
386
+ * ```
387
+ */
388
+ public abstract referenceLines(
389
+ profile: ProfileHandle,
390
+ color?: string,
391
+ thickness?: number,
392
+ style?: PluginReferenceLineStyle,
393
+ gridTag?: string,
394
+ ): PluginApiReturn<ComponentHandle[]>
395
+
396
+ /**
397
+ * Place a **furniture** item from the project library at a world position.
398
+ *
399
+ * Identified by a **catalog (library) id** — the team object's stable `_id` for
400
+ * project uploads, or the item's `fullName` for the general library. Discover ids
401
+ * with {@linkcode PluginDesignFurnitureApi.listCatalog}. Placement is asynchronous
402
+ * (the source mesh is fetched if not cached) and creates one undo entry.
403
+ *
404
+ * Placed at the item's default rotation; rotate afterward via `design.transform.rotate`
405
+ * on the returned handle (planned namespace).
406
+ *
407
+ * @param catalogId - Library id: team `_id` or general `fullName`
408
+ * @param position - Absolute world placement point
409
+ * @param options - Optional placement options: `label` — instance name
410
+ * (default auto `${name}Ins${n}`); `createNewSourceMesh` — emit a
411
+ * source-mesh creation command (default `true`)
412
+ * @returns the {@linkcode ComponentHandle} of the placed furniture instance
413
+ * @throws if the catalog id is unknown, the source mesh fails to load, or placement fails
414
+ *
415
+ * @examplePrompt Place a chair from the library at this spot
416
+ * @examplePrompt Add a sofa from the furniture catalog to the living room
417
+ * @examplePrompt Drop a desk into the scene at 3, 0, 5
418
+ * @examplePrompt Insert the uploaded bed model in the bedroom
419
+ * @examplePrompt Put a table from my project library here and name it Table-01
420
+ *
421
+ * # Example
422
+ * ```ts
423
+ * const chair = await snaptrude.design.create.furniture(
424
+ * "6620f1a…", // from design.furniture.listCatalog()
425
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
426
+ * { label: "Chair-01" },
427
+ * )
428
+ * ```
429
+ */
430
+ public abstract furniture(
431
+ catalogId: string,
432
+ position: Vec3Handle,
433
+ options?: { label?: string; createNewSourceMesh?: boolean },
434
+ ): PluginApiReturn<ComponentHandle>
435
+
436
+ /**
437
+ * **Copy** existing entities, offsetting each copy by `displacement * i` (i = 1…count),
438
+ * source positions preserved. Migrated from the removed `tools.copy`. In `"instance"`
439
+ * mode copies stay in the source's instance family where possible; `"unique"` makes
440
+ * independent geometry. The created copies become the active selection. Undoable.
441
+ *
442
+ * Runs on the engine's array-copy tool, so its semantics carry over: an
443
+ * `"instance"` copy of a source that is not yet an instance **replaces that
444
+ * source** with a fresh instance component — the handle you passed in stops
445
+ * resolving after the call. Re-query (e.g. `design.query.listSpaces`) to pick
446
+ * up the replacement before operating on that entity again; copying the stale
447
+ * handle throws. `"unique"` mode never replaces sources.
448
+ *
449
+ * @param components - Entities to copy (≥1)
450
+ * @param displacement - Per-copy offset as a {@linkcode Vec3Handle} (copy `i` at `displacement * i`)
451
+ * @param options - `count` (copies per component, default 1), `mode` (`"instance"` | `"unique"`, default `"instance"`)
452
+ * @returns the created copies as {@linkcode ComponentHandle}`[]`
453
+ * @throws if a component handle is unknown or stale (replaced by an earlier
454
+ * `"instance"` copy), `count` is not a positive integer, or the engine fails
455
+ *
456
+ * @examplePrompt Copy this room 3 times spaced 6m apart
457
+ * @examplePrompt Duplicate the selected furniture along the X axis
458
+ * @examplePrompt Make 5 copies of this column at 4 metre intervals
459
+ * @examplePrompt Array these walls with a 3m offset
460
+ * @examplePrompt Clone the desk as a unique copy, not an instance
461
+ *
462
+ * # Example
463
+ * ```ts
464
+ * const { vec3 } = snaptrude.core.math
465
+ * const copies = await snaptrude.design.create.copy(["space-id"], vec3.new(6, 0, 0), { count: 3 })
466
+ * ```
467
+ */
468
+ public abstract copy(
469
+ components: ComponentHandle[],
470
+ displacement: Vec3Handle,
471
+ options?: { count?: number; mode?: PluginCopyMode },
472
+ ): PluginApiReturn<ComponentHandle[]>
473
+
474
+ /**
475
+ * Create **many spaces** in one undoable operation (bulk plural of {@linkcode space}).
476
+ * Migrated from the removed `entity.space.bulkCreate`. Each item extrudes a contour
477
+ * footprint up `height`. Validate-all-or-throw; one command. For a rectangular
478
+ * (box) space, build the footprint with `core.geom.create.profileRect` →
479
+ * `contourFromProfile`, then pass it as an item.
480
+ *
481
+ * @param items - One {@linkcode PluginCreateSpaceItem} per space to create (≥1)
482
+ * @returns the created spaces as {@linkcode ComponentHandle}`[]`, in input order
483
+ *
484
+ * @examplePrompt Create several rooms at once from these footprints
485
+ * @examplePrompt Generate all the bedrooms in one operation
486
+ * @examplePrompt Bulk create the spaces for this floor plan
487
+ * @examplePrompt Add three rooms with different heights in a single undo step
488
+ *
489
+ * # Example
490
+ * ```ts
491
+ * const rect = await snaptrude.core.geom.create.profileRect(4, 3)
492
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
493
+ * const [a, b] = await snaptrude.design.create.spaces([
494
+ * { contour, height: 3, label: "R1" },
495
+ * { contour, height: 4, label: "R2", position: await vec3.new(10, 0, 0) },
496
+ * ])
497
+ * ```
498
+ */
499
+ public abstract spaces(items: PluginCreateSpaceItem[]): PluginApiReturn<ComponentHandle[]>
500
+ }
501
+
502
+ // ---------------------------------------------------------------------------
503
+ // Enums
504
+ // ---------------------------------------------------------------------------
505
+
506
+ /**
507
+ * Line style of a reference line (mirrors the engine `ReferenceLineMode` verbatim).
508
+ *
509
+ * | Value | Description |
510
+ * |---|---|
511
+ * | `"SOLID"` | Solid line (default) |
512
+ * | `"DASHED"` | Dashed line |
513
+ * | `"DOT_DASH"` | Dot-dash line |
514
+ */
515
+ export const PluginReferenceLineStyle = z.enum(["SOLID", "DASHED", "DOT_DASH"])
516
+ export type PluginReferenceLineStyle = z.infer<typeof PluginReferenceLineStyle>
517
+
518
+ /**
519
+ * Slab type (mirrors the engine `SLAB_TYPES` values verbatim).
520
+ *
521
+ * | Value | Description |
522
+ * |---|---|
523
+ * | `"Intermediate Slab"` | Intermediate floor slab (default) |
524
+ * | `"Basement Slab"` | Basement slab |
525
+ * | `"Plinth"` | Plinth slab |
526
+ * | `"Roof"` | Roof slab |
527
+ */
528
+ export const PluginSlabType = z.enum([
529
+ "Intermediate Slab",
530
+ "Basement Slab",
531
+ "Plinth",
532
+ "Roof",
533
+ ])
534
+ export type PluginSlabType = z.infer<typeof PluginSlabType>
535
+
536
+ /**
537
+ * A staircase preset — a base type or a named parametric preset. Mirrors the
538
+ * engine `STAIRCASE_PRESETS` / `StaircaseType`. Use the value that matches the
539
+ * shape you want (e.g. `"straight"`, `"dogLegged"`, `"lShaped"`).
540
+ */
541
+ export const PluginStaircasePreset = z.enum([
542
+ "straight",
543
+ "straightWoLanding",
544
+ "straightFlightWoMidLanding",
545
+ "dogLegged",
546
+ "openWell",
547
+ "lShaped",
548
+ "3StepLShaped",
549
+ "square",
550
+ "singleStep",
551
+ "plinthLevel",
552
+ "amphitheatre",
553
+ "connectingStepsToAmphitheatre",
554
+ "mezzanineFloorStraight",
555
+ "mezzanineFloorDogLegged",
556
+ "mezzanineFloorLShaped",
557
+ "custom",
558
+ ])
559
+ export type PluginStaircasePreset = z.infer<typeof PluginStaircasePreset>
560
+
561
+ // ---------------------------------------------------------------------------
562
+ // space
563
+ // ---------------------------------------------------------------------------
564
+
565
+ /**
566
+ * Arguments for {@linkcode PluginDesignCreateApi.space}.
567
+ *
568
+ * | Property | Type | Description |
569
+ * |---|---|---|
570
+ * | `contour` | {@linkcode ContourHandle} | Bottom footprint (outer + holes) |
571
+ * | `height` | `number` | Extrusion height (Snaptrude units, > 0) |
572
+ * | `label` | `string`? | Room label (maps to the space's `room_type`) |
573
+ * | `position` | {@linkcode Vec3Handle}? | Offset from origin (default origin) |
574
+ * | `spaceType` | {@linkcode PluginSpaceType}? | Space-type classification (default `Room`) |
575
+ * | `massType` | {@linkcode PluginMassType}? | Mass-type classification (default `Room`) |
576
+ * | `departmentId` | {@linkcode PluginDepartmentId}? | Department assignment (default department) |
577
+ */
578
+ export const PluginDesignCreateSpaceArgs = z.object({
579
+ contour: ContourHandle,
580
+ height: z.number(),
581
+ label: z.string().optional(),
582
+ position: Vec3Handle.optional(),
583
+ spaceType: PluginSpaceType.optional(),
584
+ massType: PluginMassType.optional(),
585
+ departmentId: PluginDepartmentId.optional(),
586
+ })
587
+ export type PluginDesignCreateSpaceArgs = z.infer<typeof PluginDesignCreateSpaceArgs>
588
+
589
+ // ---------------------------------------------------------------------------
590
+ // mass
591
+ // ---------------------------------------------------------------------------
592
+
593
+ /**
594
+ * Arguments for {@linkcode PluginDesignCreateApi.mass}.
595
+ *
596
+ * | Property | Type | Description |
597
+ * |---|---|---|
598
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
599
+ * | `height` | `number` | Extrusion height (> 0) |
600
+ * | `label` | `string`? | Label (maps to `room_type`) |
601
+ * | `position` | {@linkcode Vec3Handle}? | Offset from origin |
602
+ * | `massType` | {@linkcode PluginMassType}? | Mass type (default `Generic mass`) |
603
+ */
604
+ export const PluginDesignCreateMassArgs = z.object({
605
+ contour: ContourHandle,
606
+ height: z.number(),
607
+ label: z.string().optional(),
608
+ position: Vec3Handle.optional(),
609
+ massType: PluginMassType.optional(),
610
+ })
611
+ export type PluginDesignCreateMassArgs = z.infer<typeof PluginDesignCreateMassArgs>
612
+
613
+ // ---------------------------------------------------------------------------
614
+ // slab
615
+ // ---------------------------------------------------------------------------
616
+
617
+ /**
618
+ * Arguments for {@linkcode PluginDesignCreateApi.slab}.
619
+ *
620
+ * | Property | Type | Description |
621
+ * |---|---|---|
622
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
623
+ * | `thickness` | `number` | Slab thickness (> 0) |
624
+ * | `direction` | `"up" \| "down"`? | Extrusion direction (default `"down"`) |
625
+ * | `slabType` | {@linkcode PluginSlabType}? | Slab-type classification |
626
+ */
627
+ export const PluginDesignCreateSlabArgs = z.object({
628
+ contour: ContourHandle,
629
+ thickness: z.number(),
630
+ direction: z.enum(["up", "down"]).optional(),
631
+ slabType: PluginSlabType.optional(),
632
+ })
633
+ export type PluginDesignCreateSlabArgs = z.infer<typeof PluginDesignCreateSlabArgs>
634
+
635
+ // ---------------------------------------------------------------------------
636
+ // floor
637
+ // ---------------------------------------------------------------------------
638
+
639
+ /**
640
+ * Arguments for {@linkcode PluginDesignCreateApi.floor}.
641
+ *
642
+ * | Property | Type | Description |
643
+ * |---|---|---|
644
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
645
+ * | `thickness` | `number` | Floor thickness (> 0) |
646
+ * | `position` | {@linkcode Vec3Handle}? | Offset from origin |
647
+ */
648
+ export const PluginDesignCreateFloorArgs = z.object({
649
+ contour: ContourHandle,
650
+ thickness: z.number(),
651
+ position: Vec3Handle.optional(),
652
+ })
653
+ export type PluginDesignCreateFloorArgs = z.infer<typeof PluginDesignCreateFloorArgs>
654
+
655
+ // ---------------------------------------------------------------------------
656
+ // roof
657
+ // ---------------------------------------------------------------------------
658
+
659
+ /**
660
+ * Arguments for {@linkcode PluginDesignCreateApi.roof}.
661
+ *
662
+ * | Property | Type | Description |
663
+ * |---|---|---|
664
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
665
+ * | `thickness` | `number` | Roof-slab thickness (> 0) |
666
+ */
667
+ export const PluginDesignCreateRoofArgs = z.object({
668
+ contour: ContourHandle,
669
+ thickness: z.number(),
670
+ })
671
+ export type PluginDesignCreateRoofArgs = z.infer<typeof PluginDesignCreateRoofArgs>
672
+
673
+ // ---------------------------------------------------------------------------
674
+ // ceiling
675
+ // ---------------------------------------------------------------------------
676
+
677
+ /**
678
+ * Arguments for {@linkcode PluginDesignCreateApi.ceiling}.
679
+ *
680
+ * | Property | Type | Description |
681
+ * |---|---|---|
682
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
683
+ * | `thickness` | `number` | Ceiling thickness (> 0) |
684
+ * | `heightFromFloor` | `number`? | Lift above the floor (default 0) |
685
+ */
686
+ export const PluginDesignCreateCeilingArgs = z.object({
687
+ contour: ContourHandle,
688
+ thickness: z.number(),
689
+ heightFromFloor: z.number().optional(),
690
+ })
691
+ export type PluginDesignCreateCeilingArgs = z.infer<typeof PluginDesignCreateCeilingArgs>
692
+
693
+ // ---------------------------------------------------------------------------
694
+ // column
695
+ // ---------------------------------------------------------------------------
696
+
697
+ /**
698
+ * Arguments for {@linkcode PluginDesignCreateApi.column}.
699
+ *
700
+ * | Property | Type | Description |
701
+ * |---|---|---|
702
+ * | `position` | {@linkcode Vec3Handle} | Base point |
703
+ * | `crossSection` | {@linkcode ContourHandle} | Column cross-section footprint |
704
+ * | `height` | `number` | Column height (> 0) |
705
+ * | `directionUp` | {@linkcode Vec3Handle}? | Up axis (default world up) |
706
+ */
707
+ export const PluginDesignCreateColumnArgs = z.object({
708
+ position: Vec3Handle,
709
+ crossSection: ContourHandle,
710
+ height: z.number(),
711
+ directionUp: Vec3Handle.optional(),
712
+ })
713
+ export type PluginDesignCreateColumnArgs = z.infer<typeof PluginDesignCreateColumnArgs>
714
+
715
+ // ---------------------------------------------------------------------------
716
+ // beam
717
+ // ---------------------------------------------------------------------------
718
+
719
+ /**
720
+ * Arguments for {@linkcode PluginDesignCreateApi.beam}.
721
+ *
722
+ * | Property | Type | Description |
723
+ * |---|---|---|
724
+ * | `section` | {@linkcode ContourHandle} | Beam cross-section footprint |
725
+ * | `length` | `number` | Beam length along `direction` (> 0) |
726
+ * | `direction` | {@linkcode Vec3Handle}? | Extrusion axis (default world up) |
727
+ */
728
+ export const PluginDesignCreateBeamArgs = z.object({
729
+ section: ContourHandle,
730
+ length: z.number(),
731
+ direction: Vec3Handle.optional(),
732
+ })
733
+ export type PluginDesignCreateBeamArgs = z.infer<typeof PluginDesignCreateBeamArgs>
734
+
735
+ // ---------------------------------------------------------------------------
736
+ // walls
737
+ // ---------------------------------------------------------------------------
738
+
739
+ /**
740
+ * Arguments for {@linkcode PluginDesignCreateApi.walls}.
741
+ *
742
+ * | Property | Type | Description |
743
+ * |---|---|---|
744
+ * | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (wall centerlines) |
745
+ * | `height` | `number`? | Wall height (default engine default) |
746
+ * | `thickness` | `number`? | Wall thickness (default engine default) |
747
+ */
748
+ export const PluginDesignCreateWallsArgs = z.object({
749
+ profile: ProfileHandle,
750
+ height: z.number().optional(),
751
+ thickness: z.number().optional(),
752
+ })
753
+ export type PluginDesignCreateWallsArgs = z.infer<typeof PluginDesignCreateWallsArgs>
754
+
755
+ // ---------------------------------------------------------------------------
756
+ // staircase
757
+ // ---------------------------------------------------------------------------
758
+
759
+ /**
760
+ * Arguments for {@linkcode PluginDesignCreateApi.staircase}.
761
+ *
762
+ * | Property | Type | Description |
763
+ * |---|---|---|
764
+ * | `preset` | {@linkcode PluginStaircasePreset} | The parametric preset to generate |
765
+ * | `position` | {@linkcode Vec3Handle} | Placement point |
766
+ * | `label` | `string`? | Optional label |
767
+ * | `structureId` | `string`? | Target structure (default active) |
768
+ * | `level` | `string`? | Target level name (default active/`"01"`) |
769
+ */
770
+ export const PluginDesignCreateStaircaseArgs = z.object({
771
+ preset: PluginStaircasePreset,
772
+ position: Vec3Handle,
773
+ label: z.string().optional(),
774
+ structureId: z.string().optional(),
775
+ level: z.string().optional(),
776
+ })
777
+ export type PluginDesignCreateStaircaseArgs = z.infer<
778
+ typeof PluginDesignCreateStaircaseArgs
779
+ >
780
+
781
+ // ---------------------------------------------------------------------------
782
+ // furniture
783
+ // ---------------------------------------------------------------------------
784
+
785
+ /**
786
+ * Arguments for {@linkcode PluginDesignCreateApi.furniture}.
787
+ *
788
+ * | Property | Type | Description |
789
+ * |---|---|---|
790
+ * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
791
+ * | `position` | {@linkcode Vec3Handle} | Absolute world placement point |
792
+ * | `label` | `string`? | Instance name (default auto `${name}Ins${n}`) |
793
+ * | `createNewSourceMesh` | `boolean`? | Emit a source-mesh creation command (default `true`) |
794
+ */
795
+ export const PluginDesignCreateFurnitureArgs = z.object({
796
+ catalogId: z.string().min(1),
797
+ position: Vec3Handle,
798
+ label: z.string().optional(),
799
+ createNewSourceMesh: z.boolean().optional(),
800
+ })
801
+ export type PluginDesignCreateFurnitureArgs = z.infer<
802
+ typeof PluginDesignCreateFurnitureArgs
803
+ >
804
+ // TRANSPORT: positional signature shipped —
805
+ // furniture(catalogId: string, position: Vec3Handle, options?: { label?, createNewSourceMesh? })
806
+
807
+ // ---------------------------------------------------------------------------
808
+ // referenceLines
809
+ // ---------------------------------------------------------------------------
810
+
811
+ /**
812
+ * Arguments for {@linkcode PluginDesignCreateApi.referenceLines}.
813
+ *
814
+ * | Property | Type | Description |
815
+ * |---|---|---|
816
+ * | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (centerlines) |
817
+ * | `color` | `string`? | Hex color `"#RRGGBB"` (default white) |
818
+ * | `thickness` | `number`? | Line thickness (default 1) |
819
+ * | `style` | {@linkcode PluginReferenceLineStyle}? | Line style (default `SOLID`) |
820
+ * | `gridTag` | `string`? | Grid tag label (default `"A"`) |
821
+ */
822
+ export const PluginDesignCreateReferenceLinesArgs = z.object({
823
+ profile: ProfileHandle,
824
+ color: z.string().optional(),
825
+ thickness: z.number().optional(),
826
+ style: PluginReferenceLineStyle.optional(),
827
+ gridTag: z.string().optional(),
828
+ })
829
+ export type PluginDesignCreateReferenceLinesArgs = z.infer<
830
+ typeof PluginDesignCreateReferenceLinesArgs
831
+ >
832
+
833
+ // ---------------------------------------------------------------------------
834
+ // copy
835
+ // ---------------------------------------------------------------------------
836
+
837
+ /**
838
+ * Copy mode for {@linkcode PluginDesignCreateApi.copy}.
839
+ *
840
+ * | Value | Description |
841
+ * |---|---|
842
+ * | `"instance"` | Keep copies in the source's instance family where possible |
843
+ * | `"unique"` | Independent geometry copies |
844
+ */
845
+ export const PluginCopyMode = z.enum(["instance", "unique"])
846
+ export type PluginCopyMode = z.infer<typeof PluginCopyMode>
847
+
848
+ /**
849
+ * Arguments for {@linkcode PluginDesignCreateApi.copy} (options flattened).
850
+ *
851
+ * | Property | Type | Description |
852
+ * |---|---|---|
853
+ * | `components` | {@linkcode ComponentHandle}`[]` | Entities to copy (≥1) |
854
+ * | `displacement` | {@linkcode Vec3Handle} | Per-copy offset (copy `i` at `displacement * i`) |
855
+ * | `count` | `number`? | Copies per component (default 1) |
856
+ * | `mode` | {@linkcode PluginCopyMode}? | `"instance"` (default) or `"unique"` |
857
+ */
858
+ export const PluginDesignCreateCopyArgs = z.object({
859
+ components: z.array(ComponentHandle).min(1),
860
+ displacement: Vec3Handle,
861
+ count: z.number().int().positive().optional(),
862
+ mode: PluginCopyMode.optional(),
863
+ })
864
+ export type PluginDesignCreateCopyArgs = z.infer<typeof PluginDesignCreateCopyArgs>
865
+ // TRANSPORT: positional signature shipped —
866
+ // copy(components: ComponentHandle[], displacement: Vec3Handle, options?: { count?, mode? })
867
+
868
+ // ---------------------------------------------------------------------------
869
+ // spaces (bulk)
870
+ // ---------------------------------------------------------------------------
871
+
872
+ /**
873
+ * One space to create via {@linkcode PluginDesignCreateApi.spaces} — the same
874
+ * footprint-extrude inputs as {@linkcode PluginDesignCreateApi.space}.
875
+ *
876
+ * | Property | Type | Description |
877
+ * |---|---|---|
878
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer profile + holes) |
879
+ * | `height` | `number` | Extrude height |
880
+ * | `label` | `string`? | Room label |
881
+ * | `position` | {@linkcode Vec3Handle}? | Placement offset |
882
+ * | `spaceType` | `PluginSpaceType`? | Space type |
883
+ * | `massType` | `PluginMassType`? | Mass type |
884
+ * | `departmentId` | `PluginDepartmentId`? | Department |
885
+ */
886
+ export const PluginCreateSpaceItem = z.object({
887
+ contour: ContourHandle,
888
+ height: z.number(),
889
+ label: z.string().optional(),
890
+ position: Vec3Handle.optional(),
891
+ spaceType: PluginSpaceType.optional(),
892
+ massType: PluginMassType.optional(),
893
+ departmentId: PluginDepartmentId.optional(),
894
+ })
895
+ export type PluginCreateSpaceItem = z.infer<typeof PluginCreateSpaceItem>