@snaptrude/plugin-core 0.0.0-bimsvg-20260928124803

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 (383) hide show
  1. package/AGENTS.md +231 -0
  2. package/CHANGELOG.md +341 -0
  3. package/CLAUDE.md +11 -0
  4. package/api-manifest.json +9120 -0
  5. package/dist/api/analysis/daylight.d.ts +603 -0
  6. package/dist/api/analysis/daylight.d.ts.map +1 -0
  7. package/dist/api/analysis/heatmaps.d.ts +658 -0
  8. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  9. package/dist/api/analysis/illuminance.d.ts +145 -0
  10. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  11. package/dist/api/analysis/index.d.ts +59 -0
  12. package/dist/api/analysis/index.d.ts.map +1 -0
  13. package/dist/api/analysis/shadows.d.ts +165 -0
  14. package/dist/api/analysis/shadows.d.ts.map +1 -0
  15. package/dist/api/analysis/solar.d.ts +249 -0
  16. package/dist/api/analysis/solar.d.ts.map +1 -0
  17. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  18. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  19. package/dist/api/analysis/sunpath.d.ts +80 -0
  20. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  21. package/dist/api/analysis/weather.d.ts +193 -0
  22. package/dist/api/analysis/weather.d.ts.map +1 -0
  23. package/dist/api/core/buildings.d.ts +427 -0
  24. package/dist/api/core/buildings.d.ts.map +1 -0
  25. package/dist/api/core/camera/index.d.ts +261 -0
  26. package/dist/api/core/camera/index.d.ts.map +1 -0
  27. package/dist/api/core/comment/index.d.ts +333 -0
  28. package/dist/api/core/comment/index.d.ts.map +1 -0
  29. package/dist/api/core/geom/create/index.d.ts +1073 -0
  30. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  31. package/dist/api/core/geom/delete/index.d.ts +78 -0
  32. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  33. package/dist/api/core/geom/index.d.ts +33 -0
  34. package/dist/api/core/geom/index.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/arc.d.ts +169 -0
  36. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  37. package/dist/api/core/geom/query/brep.d.ts +514 -0
  38. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  39. package/dist/api/core/geom/query/circle.d.ts +378 -0
  40. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  41. package/dist/api/core/geom/query/contour.d.ts +450 -0
  42. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  43. package/dist/api/core/geom/query/curve.d.ts +918 -0
  44. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  45. package/dist/api/core/geom/query/edge.d.ts +128 -0
  46. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  47. package/dist/api/core/geom/query/face.d.ts +363 -0
  48. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  49. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  50. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  51. package/dist/api/core/geom/query/index.d.ts +61 -0
  52. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  53. package/dist/api/core/geom/query/profile.d.ts +410 -0
  54. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  55. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  56. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  57. package/dist/api/core/geom/update/contour.d.ts +272 -0
  58. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  59. package/dist/api/core/geom/update/curve.d.ts +180 -0
  60. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  61. package/dist/api/core/geom/update/index.d.ts +27 -0
  62. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  63. package/dist/api/core/geom/update/profile.d.ts +329 -0
  64. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  65. package/dist/api/core/groups.d.ts +485 -0
  66. package/dist/api/core/groups.d.ts.map +1 -0
  67. package/dist/api/core/handles/index.d.ts +210 -0
  68. package/dist/api/core/handles/index.d.ts.map +1 -0
  69. package/dist/api/core/history/index.d.ts +78 -0
  70. package/dist/api/core/history/index.d.ts.map +1 -0
  71. package/dist/api/core/index.d.ts +97 -0
  72. package/dist/api/core/index.d.ts.map +1 -0
  73. package/dist/api/core/io/export/index.d.ts +134 -0
  74. package/dist/api/core/io/export/index.d.ts.map +1 -0
  75. package/dist/api/core/io/import/index.d.ts +455 -0
  76. package/dist/api/core/io/import/index.d.ts.map +1 -0
  77. package/dist/api/core/io/index.d.ts +40 -0
  78. package/dist/api/core/io/index.d.ts.map +1 -0
  79. package/dist/api/core/io/job/index.d.ts +139 -0
  80. package/dist/api/core/io/job/index.d.ts.map +1 -0
  81. package/dist/api/core/io/query/index.d.ts +74 -0
  82. package/dist/api/core/io/query/index.d.ts.map +1 -0
  83. package/dist/api/core/io/terrain/index.d.ts +341 -0
  84. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  85. package/dist/api/core/io/underlay/index.d.ts +805 -0
  86. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  87. package/dist/api/core/layers.d.ts +402 -0
  88. package/dist/api/core/layers.d.ts.map +1 -0
  89. package/dist/api/core/math/index.d.ts +18 -0
  90. package/dist/api/core/math/index.d.ts.map +1 -0
  91. package/dist/api/core/math/quat.d.ts +170 -0
  92. package/dist/api/core/math/quat.d.ts.map +1 -0
  93. package/dist/api/core/math/vec3.d.ts +174 -0
  94. package/dist/api/core/math/vec3.d.ts.map +1 -0
  95. package/dist/api/core/mode/index.d.ts +111 -0
  96. package/dist/api/core/mode/index.d.ts.map +1 -0
  97. package/dist/api/core/project/index.d.ts +466 -0
  98. package/dist/api/core/project/index.d.ts.map +1 -0
  99. package/dist/api/core/proposals/index.d.ts +531 -0
  100. package/dist/api/core/proposals/index.d.ts.map +1 -0
  101. package/dist/api/core/storeys/index.d.ts +265 -0
  102. package/dist/api/core/storeys/index.d.ts.map +1 -0
  103. package/dist/api/core/tags.d.ts +860 -0
  104. package/dist/api/core/tags.d.ts.map +1 -0
  105. package/dist/api/core/units/index.d.ts +175 -0
  106. package/dist/api/core/units/index.d.ts.map +1 -0
  107. package/dist/api/core/user.d.ts +44 -0
  108. package/dist/api/core/user.d.ts.map +1 -0
  109. package/dist/api/core/zoom/index.d.ts +49 -0
  110. package/dist/api/core/zoom/index.d.ts.map +1 -0
  111. package/dist/api/design/boolean/index.d.ts +168 -0
  112. package/dist/api/design/boolean/index.d.ts.map +1 -0
  113. package/dist/api/design/create/bulk-items.d.ts +185 -0
  114. package/dist/api/design/create/bulk-items.d.ts.map +1 -0
  115. package/dist/api/design/create/grids.d.ts +132 -0
  116. package/dist/api/design/create/grids.d.ts.map +1 -0
  117. package/dist/api/design/create/index.d.ts +1747 -0
  118. package/dist/api/design/create/index.d.ts.map +1 -0
  119. package/dist/api/design/create/opening-fields.d.ts +37 -0
  120. package/dist/api/design/create/opening-fields.d.ts.map +1 -0
  121. package/dist/api/design/delete/index.d.ts +70 -0
  122. package/dist/api/design/delete/index.d.ts.map +1 -0
  123. package/dist/api/design/dimensions.d.ts +427 -0
  124. package/dist/api/design/dimensions.d.ts.map +1 -0
  125. package/dist/api/design/doors/index.d.ts +470 -0
  126. package/dist/api/design/doors/index.d.ts.map +1 -0
  127. package/dist/api/design/edit/index.d.ts +49 -0
  128. package/dist/api/design/edit/index.d.ts.map +1 -0
  129. package/dist/api/design/erase/index.d.ts +160 -0
  130. package/dist/api/design/erase/index.d.ts.map +1 -0
  131. package/dist/api/design/family.d.ts +611 -0
  132. package/dist/api/design/family.d.ts.map +1 -0
  133. package/dist/api/design/furniture/index.d.ts +296 -0
  134. package/dist/api/design/furniture/index.d.ts.map +1 -0
  135. package/dist/api/design/grids.d.ts +237 -0
  136. package/dist/api/design/grids.d.ts.map +1 -0
  137. package/dist/api/design/index.d.ts +260 -0
  138. package/dist/api/design/index.d.ts.map +1 -0
  139. package/dist/api/design/lock.d.ts +67 -0
  140. package/dist/api/design/lock.d.ts.map +1 -0
  141. package/dist/api/design/materials/index.d.ts +551 -0
  142. package/dist/api/design/materials/index.d.ts.map +1 -0
  143. package/dist/api/design/query/geometry/index.d.ts +252 -0
  144. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  145. package/dist/api/design/query/grids.d.ts +287 -0
  146. package/dist/api/design/query/grids.d.ts.map +1 -0
  147. package/dist/api/design/query/index.d.ts +1318 -0
  148. package/dist/api/design/query/index.d.ts.map +1 -0
  149. package/dist/api/design/query/referenceLines.d.ts +45 -0
  150. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  151. package/dist/api/design/query/spaces.d.ts +394 -0
  152. package/dist/api/design/query/spaces.d.ts.map +1 -0
  153. package/dist/api/design/selection/index.d.ts +282 -0
  154. package/dist/api/design/selection/index.d.ts.map +1 -0
  155. package/dist/api/design/shared.d.ts +38 -0
  156. package/dist/api/design/shared.d.ts.map +1 -0
  157. package/dist/api/design/transform/index.d.ts +249 -0
  158. package/dist/api/design/transform/index.d.ts.map +1 -0
  159. package/dist/api/design/types/index.d.ts +181 -0
  160. package/dist/api/design/types/index.d.ts.map +1 -0
  161. package/dist/api/design/update/index.d.ts +803 -0
  162. package/dist/api/design/update/index.d.ts.map +1 -0
  163. package/dist/api/design/visibility.d.ts +126 -0
  164. package/dist/api/design/visibility.d.ts.map +1 -0
  165. package/dist/api/design/windows/index.d.ts +300 -0
  166. package/dist/api/design/windows/index.d.ts.map +1 -0
  167. package/dist/api/entity/buildableEnvelope.d.ts +265 -0
  168. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  169. package/dist/api/entity/department.d.ts +1 -0
  170. package/dist/api/entity/department.d.ts.map +1 -0
  171. package/dist/api/entity/index.d.ts +28 -0
  172. package/dist/api/entity/index.d.ts.map +1 -0
  173. package/dist/api/entity/referenceLine.d.ts +210 -0
  174. package/dist/api/entity/referenceLine.d.ts.map +1 -0
  175. package/dist/api/entity/space.d.ts +846 -0
  176. package/dist/api/entity/space.d.ts.map +1 -0
  177. package/dist/api/entity/story.d.ts +476 -0
  178. package/dist/api/entity/story.d.ts.map +1 -0
  179. package/dist/api/index.d.ts +45 -0
  180. package/dist/api/index.d.ts.map +1 -0
  181. package/dist/api/presentation/aiInspiration.d.ts +2400 -0
  182. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  183. package/dist/api/presentation/annotate.d.ts +483 -0
  184. package/dist/api/presentation/annotate.d.ts.map +1 -0
  185. package/dist/api/presentation/diagrams.d.ts +184 -0
  186. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  187. package/dist/api/presentation/drawings.d.ts +2900 -0
  188. package/dist/api/presentation/drawings.d.ts.map +1 -0
  189. package/dist/api/presentation/export.d.ts +126 -0
  190. package/dist/api/presentation/export.d.ts.map +1 -0
  191. package/dist/api/presentation/import.d.ts +164 -0
  192. package/dist/api/presentation/import.d.ts.map +1 -0
  193. package/dist/api/presentation/index.d.ts +114 -0
  194. package/dist/api/presentation/index.d.ts.map +1 -0
  195. package/dist/api/presentation/placedViews.d.ts +1232 -0
  196. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  197. package/dist/api/presentation/shapes.d.ts +481 -0
  198. package/dist/api/presentation/shapes.d.ts.map +1 -0
  199. package/dist/api/presentation/sheets.d.ts +643 -0
  200. package/dist/api/presentation/sheets.d.ts.map +1 -0
  201. package/dist/api/presentation/slideshow.d.ts +125 -0
  202. package/dist/api/presentation/slideshow.d.ts.map +1 -0
  203. package/dist/api/presentation/tables.d.ts +81 -0
  204. package/dist/api/presentation/tables.d.ts.map +1 -0
  205. package/dist/api/presentation/viewPresets.d.ts +70 -0
  206. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  207. package/dist/api/presentation/views.d.ts +741 -0
  208. package/dist/api/presentation/views.d.ts.map +1 -0
  209. package/dist/api/program/adjacency.d.ts +155 -0
  210. package/dist/api/program/adjacency.d.ts.map +1 -0
  211. package/dist/api/program/areas.d.ts +450 -0
  212. package/dist/api/program/areas.d.ts.map +1 -0
  213. package/dist/api/program/classification.d.ts +135 -0
  214. package/dist/api/program/classification.d.ts.map +1 -0
  215. package/dist/api/program/cores.d.ts +78 -0
  216. package/dist/api/program/cores.d.ts.map +1 -0
  217. package/dist/api/program/departments.d.ts +487 -0
  218. package/dist/api/program/departments.d.ts.map +1 -0
  219. package/dist/api/program/index.d.ts +71 -0
  220. package/dist/api/program/index.d.ts.map +1 -0
  221. package/dist/api/program/labels.d.ts +355 -0
  222. package/dist/api/program/labels.d.ts.map +1 -0
  223. package/dist/api/program/layout.d.ts +398 -0
  224. package/dist/api/program/layout.d.ts.map +1 -0
  225. package/dist/api/program/metadata.d.ts +328 -0
  226. package/dist/api/program/metadata.d.ts.map +1 -0
  227. package/dist/api/program/metrics.d.ts +108 -0
  228. package/dist/api/program/metrics.d.ts.map +1 -0
  229. package/dist/api/program/site.d.ts +823 -0
  230. package/dist/api/program/site.d.ts.map +1 -0
  231. package/dist/api/program/spreadsheet.d.ts +2628 -0
  232. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  233. package/dist/api/workspace/index.d.ts +552 -0
  234. package/dist/api/workspace/index.d.ts.map +1 -0
  235. package/dist/errors/codes.d.ts +34 -0
  236. package/dist/errors/codes.d.ts.map +1 -0
  237. package/dist/errors/envelope.d.ts +56 -0
  238. package/dist/errors/envelope.d.ts.map +1 -0
  239. package/dist/errors/index.d.ts +6 -0
  240. package/dist/errors/index.d.ts.map +1 -0
  241. package/dist/errors/plugin-error.d.ts +69 -0
  242. package/dist/errors/plugin-error.d.ts.map +1 -0
  243. package/dist/handles.d.ts +229 -0
  244. package/dist/handles.d.ts.map +1 -0
  245. package/dist/host-utils.d.ts +47 -0
  246. package/dist/host-utils.d.ts.map +1 -0
  247. package/dist/index.cjs +8836 -0
  248. package/dist/index.cjs.map +1 -0
  249. package/dist/index.d.ts +6 -0
  250. package/dist/index.d.ts.map +1 -0
  251. package/dist/index.js +7568 -0
  252. package/dist/index.js.map +1 -0
  253. package/dist/types.d.ts +16 -0
  254. package/dist/types.d.ts.map +1 -0
  255. package/package.json +41 -0
  256. package/scripts/generate-manifest.mjs +238 -0
  257. package/scripts/generate-manifest.test.mjs +292 -0
  258. package/src/api/analysis/daylight.ts +470 -0
  259. package/src/api/analysis/heatmaps.ts +683 -0
  260. package/src/api/analysis/illuminance.ts +155 -0
  261. package/src/api/analysis/index.ts +61 -0
  262. package/src/api/analysis/shadows.ts +183 -0
  263. package/src/api/analysis/solar.ts +237 -0
  264. package/src/api/analysis/sunlightHours.ts +211 -0
  265. package/src/api/analysis/sunpath.ts +83 -0
  266. package/src/api/analysis/weather.ts +179 -0
  267. package/src/api/core/buildings.ts +485 -0
  268. package/src/api/core/camera/index.ts +268 -0
  269. package/src/api/core/comment/index.ts +376 -0
  270. package/src/api/core/geom/create/index.ts +1204 -0
  271. package/src/api/core/geom/delete/index.ts +84 -0
  272. package/src/api/core/geom/index.ts +35 -0
  273. package/src/api/core/geom/query/arc.ts +169 -0
  274. package/src/api/core/geom/query/brep.ts +563 -0
  275. package/src/api/core/geom/query/circle.ts +404 -0
  276. package/src/api/core/geom/query/contour.ts +540 -0
  277. package/src/api/core/geom/query/curve.ts +1078 -0
  278. package/src/api/core/geom/query/edge.ts +130 -0
  279. package/src/api/core/geom/query/face.ts +403 -0
  280. package/src/api/core/geom/query/halfedge.ts +210 -0
  281. package/src/api/core/geom/query/index.ts +63 -0
  282. package/src/api/core/geom/query/profile.ts +473 -0
  283. package/src/api/core/geom/query/vertex.ts +205 -0
  284. package/src/api/core/geom/update/contour.ts +315 -0
  285. package/src/api/core/geom/update/curve.ts +209 -0
  286. package/src/api/core/geom/update/index.ts +29 -0
  287. package/src/api/core/geom/update/profile.ts +377 -0
  288. package/src/api/core/groups.ts +521 -0
  289. package/src/api/core/handles/index.ts +233 -0
  290. package/src/api/core/history/index.ts +84 -0
  291. package/src/api/core/index.ts +99 -0
  292. package/src/api/core/io/export/index.ts +126 -0
  293. package/src/api/core/io/import/index.ts +504 -0
  294. package/src/api/core/io/index.ts +42 -0
  295. package/src/api/core/io/job/index.ts +140 -0
  296. package/src/api/core/io/query/index.ts +71 -0
  297. package/src/api/core/io/terrain/index.ts +360 -0
  298. package/src/api/core/io/underlay/index.ts +705 -0
  299. package/src/api/core/layers.ts +333 -0
  300. package/src/api/core/math/index.ts +20 -0
  301. package/src/api/core/math/quat.ts +172 -0
  302. package/src/api/core/math/vec3.ts +179 -0
  303. package/src/api/core/mode/index.ts +108 -0
  304. package/src/api/core/project/index.ts +479 -0
  305. package/src/api/core/proposals/index.ts +569 -0
  306. package/src/api/core/storeys/index.ts +294 -0
  307. package/src/api/core/tags.ts +911 -0
  308. package/src/api/core/units/index.ts +164 -0
  309. package/src/api/core/user.ts +46 -0
  310. package/src/api/core/zoom/index.ts +51 -0
  311. package/src/api/design/boolean/index.ts +179 -0
  312. package/src/api/design/create/bulk-items.ts +186 -0
  313. package/src/api/design/create/grids.ts +137 -0
  314. package/src/api/design/create/index.ts +1954 -0
  315. package/src/api/design/create/opening-fields.ts +37 -0
  316. package/src/api/design/delete/index.ts +74 -0
  317. package/src/api/design/dimensions.ts +453 -0
  318. package/src/api/design/doors/index.ts +500 -0
  319. package/src/api/design/edit/index.ts +54 -0
  320. package/src/api/design/erase/index.ts +151 -0
  321. package/src/api/design/family.ts +646 -0
  322. package/src/api/design/furniture/index.ts +319 -0
  323. package/src/api/design/grids.ts +237 -0
  324. package/src/api/design/index.ts +274 -0
  325. package/src/api/design/lock.ts +69 -0
  326. package/src/api/design/materials/index.ts +608 -0
  327. package/src/api/design/query/geometry/index.ts +288 -0
  328. package/src/api/design/query/grids.ts +197 -0
  329. package/src/api/design/query/index.ts +1176 -0
  330. package/src/api/design/query/referenceLines.ts +52 -0
  331. package/src/api/design/query/spaces.ts +275 -0
  332. package/src/api/design/selection/index.ts +273 -0
  333. package/src/api/design/shared.ts +40 -0
  334. package/src/api/design/transform/index.ts +254 -0
  335. package/src/api/design/types/index.ts +156 -0
  336. package/src/api/design/update/index.ts +798 -0
  337. package/src/api/design/visibility.ts +143 -0
  338. package/src/api/design/windows/index.ts +333 -0
  339. package/src/api/entity/buildableEnvelope.ts +322 -0
  340. package/src/api/entity/department.ts +0 -0
  341. package/src/api/entity/index.ts +30 -0
  342. package/src/api/entity/referenceLine.ts +235 -0
  343. package/src/api/entity/space.ts +612 -0
  344. package/src/api/entity/story.ts +517 -0
  345. package/src/api/index.ts +47 -0
  346. package/src/api/presentation/aiInspiration.ts +1116 -0
  347. package/src/api/presentation/annotate.ts +417 -0
  348. package/src/api/presentation/diagrams.ts +194 -0
  349. package/src/api/presentation/drawings.ts +529 -0
  350. package/src/api/presentation/export.ts +133 -0
  351. package/src/api/presentation/import.ts +159 -0
  352. package/src/api/presentation/index.ts +129 -0
  353. package/src/api/presentation/placedViews.ts +1203 -0
  354. package/src/api/presentation/shapes.ts +274 -0
  355. package/src/api/presentation/sheets.ts +616 -0
  356. package/src/api/presentation/slideshow.ts +134 -0
  357. package/src/api/presentation/tables.ts +84 -0
  358. package/src/api/presentation/viewPresets.ts +83 -0
  359. package/src/api/presentation/views.ts +698 -0
  360. package/src/api/program/adjacency.ts +164 -0
  361. package/src/api/program/areas.ts +408 -0
  362. package/src/api/program/classification.ts +138 -0
  363. package/src/api/program/cores.ts +83 -0
  364. package/src/api/program/departments.ts +517 -0
  365. package/src/api/program/index.ts +73 -0
  366. package/src/api/program/labels.ts +332 -0
  367. package/src/api/program/layout.ts +422 -0
  368. package/src/api/program/metadata.ts +364 -0
  369. package/src/api/program/metrics.ts +120 -0
  370. package/src/api/program/site.ts +748 -0
  371. package/src/api/program/spreadsheet.ts +2698 -0
  372. package/src/api/workspace/index.ts +612 -0
  373. package/src/errors/codes.ts +136 -0
  374. package/src/errors/envelope.ts +75 -0
  375. package/src/errors/index.ts +21 -0
  376. package/src/errors/plugin-error.ts +134 -0
  377. package/src/handles.ts +282 -0
  378. package/src/host-utils.ts +68 -0
  379. package/src/index.ts +5 -0
  380. package/src/types.ts +16 -0
  381. package/test/errors.test.mjs +184 -0
  382. package/tsconfig.json +22 -0
  383. package/tsup.config.ts +12 -0
@@ -0,0 +1,1954 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../../types"
3
+ import {
4
+ BrepHandle,
5
+ ComponentHandle,
6
+ ContourHandle,
7
+ CurveHandle,
8
+ ProfileHandle,
9
+ Vec3Handle,
10
+ } from "../../../handles"
11
+ import { PluginGridStyleOptions } from "./grids"
12
+ import {
13
+ PluginSpaceType,
14
+ PluginMassType,
15
+ PluginDepartmentId,
16
+ } from "../../entity/space"
17
+ import {
18
+ PluginBuildableEnvelopePolygonVertex,
19
+ PluginBuildableEnvelopeSetbackTier,
20
+ PluginBuildableEnvelopeVerticalCap,
21
+ PluginBuildableEnvelopeCreateResult,
22
+ } from "../../entity/buildableEnvelope"
23
+ import { PluginOpeningBaseOptions } from "./opening-fields"
24
+ import type {
25
+ PluginCreateDoorItem,
26
+ PluginCreateFloorItem,
27
+ PluginCreateFurnitureItem,
28
+ PluginCreateWallRunItem,
29
+ PluginCreateWindowItem,
30
+ } from "./bulk-items"
31
+
32
+ /**
33
+ * `design.create.*` — author new scene-committed BIM entities.
34
+ *
35
+ * Every creator takes geometry handles + scalars and returns a
36
+ * {@linkcode ComponentHandle} (or `ComponentHandle[]` for plural creators;
37
+ * `wallRuns` returns one `ComponentHandle[]` per run) — the
38
+ * `Component.id` of the created entity, resolvable across the rest of the
39
+ * `design.*` surface. Creation is an undoable host call; it **throws** on failure
40
+ * (no `Result` wrapper — consistent with `core.geom.create.*`).
41
+ *
42
+ * Footprint objects take a {@linkcode ContourHandle} (outer profile + holes);
43
+ * build one with `snaptrude.core.geom.create.contourFromProfile(s)`.
44
+ *
45
+ * `door`/`window` place a catalog item into a host wall (the world point is
46
+ * projected onto the wall face to locate the opening; the wall is re-cut in one
47
+ * undo entry) and throw if the point projects outside the wall. `smartLayout` is
48
+ * the one creator returning a grouped {@linkcode PluginSmartLayoutResult} rather
49
+ * than a handle — it clones an in-scene template into one or more target spaces,
50
+ * merging every target into a single undo batch (see its JSDoc).
51
+ *
52
+ * Accessed via `snaptrude.design.create`.
53
+ */
54
+ export abstract class PluginDesignCreateApi {
55
+ constructor() {}
56
+
57
+ /**
58
+ * Create a **space** (a room / mass) by extruding a footprint contour upward.
59
+ *
60
+ * The `contour` is the bottom footprint (outer profile + optional holes); it
61
+ * is extruded by `height` along +Y. The space is placed on the active story
62
+ * and assigned a default department unless overridden.
63
+ *
64
+ * @param contour - Bottom footprint (outer + holes)
65
+ * @param height - Extrusion height (Snaptrude units, > 0)
66
+ * @param label - Room label (maps to the space's `room_type`)
67
+ * @param position - Offset from origin (default origin)
68
+ * @param spaceType - Space-type classification (default `Room`)
69
+ * @param massType - Mass-type classification (default `Room`)
70
+ * @param departmentId - Department assignment (default department)
71
+ * @param storey - Target storey number to place the space on — the same integer
72
+ * `entity.story` uses (`1` ground, `2` first floor, `-1` basement). Default:
73
+ * the active storey. Folds a `core.storeys.setActive` call into the create,
74
+ * placing the space at that storey's floor elevation (any `position` offset is
75
+ * applied on top). Throws if no storey has that value.
76
+ * @returns the {@linkcode ComponentHandle} of the created space
77
+ * @throws if the contour is invalid, the height is not positive, or the target
78
+ * storey does not exist
79
+ *
80
+ * @examplePrompt Create a room called Living Room that's 3m tall from this outline
81
+ * @examplePrompt Add a new space on the current storey using this footprint
82
+ * @examplePrompt Make a bedroom here and assign it to the Residential department
83
+ * @examplePrompt Extrude this closed outline into a 10 foot high room
84
+ * @examplePrompt Can you create a Kitchen space from the sketch I just drew?
85
+ * @examplePrompt Create a bedroom on the second floor from this outline
86
+ *
87
+ * @performance For MORE THAN ONE space, call `design.create.spaces(items[])` — the whole
88
+ * batch is one host round-trip. Looping this single-space creator is N round-trips (slow,
89
+ * and a large loop can trip the plugin rate limit).
90
+ *
91
+ * # Example
92
+ * ```ts
93
+ * const v = snaptrude.core.math.vec3
94
+ * const outer = await snaptrude.core.geom.create.profileFromLinePoints([
95
+ * await v.new(0, 0, 0),
96
+ * await v.new(10, 0, 0),
97
+ * await v.new(10, 0, 8),
98
+ * await v.new(0, 0, 8),
99
+ * ])
100
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(outer)
101
+ * const space = await snaptrude.design.create.space(contour, 3, "Living")
102
+ * // …place one directly on the second floor (no setActive dance):
103
+ * const upstairs = await snaptrude.design.create.space(
104
+ * contour, 3, "Bedroom", undefined, undefined, undefined, undefined, 2,
105
+ * )
106
+ * ```
107
+ */
108
+ public abstract space(
109
+ contour: ContourHandle,
110
+ height: number,
111
+ label?: string,
112
+ position?: Vec3Handle,
113
+ spaceType?: PluginSpaceType,
114
+ massType?: PluginMassType,
115
+ departmentId?: PluginDepartmentId,
116
+ storey?: number,
117
+ ): PluginApiReturn<ComponentHandle>
118
+
119
+ /**
120
+ * Create a **mass** — a generic extruded prism (default `massType` "Generic mass").
121
+ * Same footprint-extrude path as {@linkcode PluginDesignCreateApi.space}.
122
+ *
123
+ * @param contour - Footprint (outer + holes)
124
+ * @param height - Extrusion height (> 0)
125
+ * @param label - Label (maps to `room_type`)
126
+ * @param position - Offset from origin
127
+ * @param massType - Mass type (default `Generic mass`)
128
+ * @returns the {@linkcode ComponentHandle} of the created mass
129
+ * @throws if the contour is invalid or the height is not positive
130
+ *
131
+ * @examplePrompt Create a generic mass 30m tall from this footprint
132
+ * @examplePrompt Block out a conceptual massing volume for the site
133
+ * @examplePrompt Extrude this shape into a building mass
134
+ * @examplePrompt Add a simple study-model volume at the origin
135
+ *
136
+ * # Example
137
+ * ```ts
138
+ * const rect = await snaptrude.core.geom.create.profileRect(20, 15)
139
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
140
+ * const tower = await snaptrude.design.create.mass(contour, 30, "Tower A", undefined, "Building")
141
+ * ```
142
+ */
143
+ public abstract mass(
144
+ contour: ContourHandle,
145
+ height: number,
146
+ label?: string,
147
+ position?: Vec3Handle,
148
+ massType?: PluginMassType,
149
+ ): PluginApiReturn<ComponentHandle>
150
+
151
+ /**
152
+ * Create a **mass** from a custom solid built with a `core.geom.create` brep
153
+ * constructor (`brepFromFaces`, `brepFromExtrusion`, `brepFromLoft`,
154
+ * `brepFromMesh`, or a brep boolean) — the free-form counterpart of
155
+ * {@linkcode PluginDesignCreateApi.mass}, for solids that are not simple
156
+ * footprint extrusions (pyramids, wedges, faceted volumes).
157
+ *
158
+ * Only accepts breps **minted by a `core.geom.create` brep constructor** —
159
+ * scene-derived breps from `design.query.geometry.getBrep` are read-only and
160
+ * throw. The mass is created as a generic mass (`massType` "Generic mass") at
161
+ * the exact coordinates the solid was authored in, committed as a single
162
+ * undo step, and synced to collaborators like any other creator.
163
+ *
164
+ * @param brep - A solid from a `core.geom.create` brep constructor
165
+ * @param label - Label (maps to `room_type`)
166
+ * @returns the {@linkcode ComponentHandle} of the created mass
167
+ * @throws if the brep handle is invalid, or the brep was not created by a
168
+ * `core.geom.create` brep constructor
169
+ *
170
+ * @examplePrompt Create a mass from these faces
171
+ * @examplePrompt Turn this custom brep into a scene mass
172
+ * @examplePrompt Add a pyramid-shaped mass to the model
173
+ *
174
+ * # Example
175
+ * ```ts
176
+ * const apex = { x: 0, y: 4, z: 0 }
177
+ * const a = { x: -2, y: 0, z: -2 }
178
+ * const b = { x: 2, y: 0, z: -2 }
179
+ * const c = { x: 2, y: 0, z: 2 }
180
+ * const d = { x: -2, y: 0, z: 2 }
181
+ * const brep = await snaptrude.core.geom.create.brepFromFaces([
182
+ * [a, d, c, b],
183
+ * [a, b, apex],
184
+ * [b, c, apex],
185
+ * [c, d, apex],
186
+ * [d, a, apex],
187
+ * ])
188
+ * const pyramid = await snaptrude.design.create.massFromBrep(brep, "Pavilion")
189
+ * ```
190
+ */
191
+ public abstract massFromBrep(
192
+ brep: BrepHandle,
193
+ label?: string,
194
+ ): PluginApiReturn<ComponentHandle>
195
+
196
+ /**
197
+ * Create a **slab** by extruding a footprint contour by `thickness`
198
+ * (default direction: down).
199
+ *
200
+ * @param contour - Footprint (outer + holes)
201
+ * @param thickness - Slab thickness (> 0)
202
+ * @param direction - Extrusion direction (default `"down"`)
203
+ * @param slabType - Slab-type classification
204
+ * @returns the {@linkcode ComponentHandle} of the created slab
205
+ * @throws if the contour is invalid or the thickness is not positive
206
+ *
207
+ * @examplePrompt Add a 150mm thick slab under this footprint
208
+ * @examplePrompt Create a floor slab from this outline
209
+ * @examplePrompt Pour a plinth slab over the building footprint
210
+ * @examplePrompt Make a basement slab that extrudes downward
211
+ * @examplePrompt Give this room outline a 6 inch slab
212
+ *
213
+ * # Example
214
+ * ```ts
215
+ * const rect = await snaptrude.core.geom.create.profileRect(12, 10)
216
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
217
+ * const slab = await snaptrude.design.create.slab(contour, 0.15, "down", "Plinth")
218
+ * ```
219
+ */
220
+ public abstract slab(
221
+ contour: ContourHandle,
222
+ thickness: number,
223
+ direction?: "up" | "down",
224
+ slabType?: PluginSlabType,
225
+ ): PluginApiReturn<ComponentHandle>
226
+
227
+ /**
228
+ * Create a **floor** by extruding a footprint contour by `thickness`
229
+ * (extruded upward).
230
+ *
231
+ * @param contour - Footprint (outer + holes)
232
+ * @param thickness - Floor thickness (> 0)
233
+ * @param position - Offset from origin
234
+ * @returns the {@linkcode ComponentHandle} of the created floor
235
+ * @throws if the contour is invalid or the thickness is not positive
236
+ *
237
+ * @examplePrompt Create a floor from this room outline
238
+ * @examplePrompt Add a 100mm thick floor over the footprint
239
+ * @examplePrompt Lay flooring across the selected outline
240
+ * @examplePrompt Put a floor at this position with 150mm thickness
241
+ *
242
+ * # Example
243
+ * ```ts
244
+ * const rect = await snaptrude.core.geom.create.profileRect(5, 4)
245
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
246
+ * const floor = await snaptrude.design.create.floor(contour, 0.1)
247
+ * ```
248
+ *
249
+ * @performance For MORE THAN ONE floor, call `design.create.floors(items[])` — one
250
+ * host round-trip and ONE undo entry for the whole batch. Looping this single-floor
251
+ * creator is N round-trips and N undo entries.
252
+ */
253
+ public abstract floor(
254
+ contour: ContourHandle,
255
+ thickness: number,
256
+ position?: Vec3Handle,
257
+ ): PluginApiReturn<ComponentHandle>
258
+
259
+ /**
260
+ * Create **many floors** in one undoable operation (bulk plural of
261
+ * {@linkcode floor}). Each item extrudes its own footprint contour (outer
262
+ * profile + holes) upward by its own `thickness`, at its own optional
263
+ * position offset. Validate-all-or-throw; one command.
264
+ *
265
+ * @param items - One {@linkcode PluginCreateFloorItem} per floor to create
266
+ * (≥1, ≤1000)
267
+ * @returns the created floors as {@linkcode ComponentHandle}`[]`, in input order
268
+ * @throws `VALIDATION` if the items fail the schema (empty array, more than
269
+ * 1000 items, a non-positive thickness) or a contour is degenerate;
270
+ * `HANDLE_INVALID` if a `contour` or `position` handle is unknown or
271
+ * released; `OPERATION_FAILED` if extrusion fails (nothing is created —
272
+ * `details.itemIndex` is the failing item); `METHOD_NOT_PERMITTED` if the
273
+ * plugin may not write.
274
+ *
275
+ * @examplePrompt Create floors for all these room outlines at once
276
+ * @examplePrompt Add a floor to every space in one operation
277
+ * @examplePrompt Bulk create the floor plates for this building
278
+ * @examplePrompt Lay 100mm floors across these five footprints in one undo step
279
+ * @examplePrompt Create the ground and first floor slabs together
280
+ *
281
+ * @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
282
+ * entry. Always prefer this over calling `design.create.floor` in a loop: build the
283
+ * full `items[]` array first (all contours and offsets up front), then make one call.
284
+ *
285
+ * # Example
286
+ * ```ts
287
+ * const rect = await snaptrude.core.geom.create.profileRect(5, 4)
288
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
289
+ * const [ground, upper] = await snaptrude.design.create.floors([
290
+ * { contour, thickness: 0.1 },
291
+ * { contour, thickness: 0.1, position: await snaptrude.core.math.vec3.new(0, 3, 0) },
292
+ * ])
293
+ * ```
294
+ */
295
+ public abstract floors(
296
+ items: PluginCreateFloorItem[],
297
+ ): PluginApiReturn<ComponentHandle[]>
298
+
299
+ /**
300
+ * Create a **roof** by extruding a footprint contour by `thickness`. Created
301
+ * flat (extruded downward); pitch/slope is a separate post-creation edit.
302
+ *
303
+ * @param contour - Footprint (outer + holes)
304
+ * @param thickness - Roof-slab thickness (> 0)
305
+ * @returns the {@linkcode ComponentHandle} of the created roof
306
+ * @throws if the contour is invalid or the thickness is not positive
307
+ *
308
+ * @examplePrompt Add a flat roof over the building footprint
309
+ * @examplePrompt Create a roof 200mm thick from this outline
310
+ * @examplePrompt Cover the top storey with a roof slab
311
+ * @examplePrompt Put a roof on this building
312
+ *
313
+ * # Example
314
+ * ```ts
315
+ * const rect = await snaptrude.core.geom.create.profileRect(12, 10)
316
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
317
+ * const roof = await snaptrude.design.create.roof(contour, 0.2)
318
+ * ```
319
+ */
320
+ public abstract roof(
321
+ contour: ContourHandle,
322
+ thickness: number,
323
+ ): PluginApiReturn<ComponentHandle>
324
+
325
+ /**
326
+ * Create a **ceiling** by extruding a footprint contour by `thickness`, lifted
327
+ * `heightFromFloor` above the floor.
328
+ *
329
+ * @param contour - Footprint (outer + holes)
330
+ * @param thickness - Ceiling thickness (> 0)
331
+ * @param heightFromFloor - Lift above the floor (default 0)
332
+ * @returns the {@linkcode ComponentHandle} of the created ceiling
333
+ * @throws if the contour is invalid or the thickness is not positive
334
+ *
335
+ * @examplePrompt Add a false ceiling 2.7m above the floor
336
+ * @examplePrompt Create a ceiling over this room footprint
337
+ * @examplePrompt Put a dropped ceiling in the living room at 3 metres
338
+ * @examplePrompt Add a 50mm thick ceiling lifted 2800mm from floor level
339
+ *
340
+ * # Example
341
+ * ```ts
342
+ * const rect = await snaptrude.core.geom.create.profileRect(5, 4)
343
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
344
+ * const ceiling = await snaptrude.design.create.ceiling(contour, 0.05, 2.8)
345
+ * ```
346
+ */
347
+ public abstract ceiling(
348
+ contour: ContourHandle,
349
+ thickness: number,
350
+ heightFromFloor?: number,
351
+ ): PluginApiReturn<ComponentHandle>
352
+
353
+ /**
354
+ * Create a **column** by extruding a cross-section contour upward by `height`
355
+ * from a base `position`. The column is built to EXACTLY `height` — unlike
356
+ * the interactive draw tool, no slab-thickness deduction is applied.
357
+ *
358
+ * @param position - Base point
359
+ * @param crossSection - Column cross-section footprint
360
+ * @param height - Column height (> 0), built exactly
361
+ * @param directionUp - Up axis (default world up); normalized by the host, so
362
+ * magnitude does not scale the height
363
+ * @returns the {@linkcode ComponentHandle} of the created column
364
+ * @throws if the cross-section is invalid, the height is not positive, or the
365
+ * direction is zero / lies in the cross-section plane (degenerate extrusion)
366
+ *
367
+ * @examplePrompt Add a 3m tall column at this point
368
+ * @examplePrompt Place a column at the grid intersection
369
+ * @examplePrompt Create a 450mm square concrete column 4 metres high
370
+ * @examplePrompt Stand a column up from this base point
371
+ *
372
+ * # Example
373
+ * ```ts
374
+ * const rect = await snaptrude.core.geom.create.profileRect(0.45, 0.45)
375
+ * const crossSection = await snaptrude.core.geom.create.contourFromProfile(rect)
376
+ * const base = await snaptrude.core.math.vec3.new(4, 0, 4)
377
+ * const column = await snaptrude.design.create.column(base, crossSection, 3)
378
+ * ```
379
+ */
380
+ public abstract column(
381
+ position: Vec3Handle,
382
+ crossSection: ContourHandle,
383
+ height: number,
384
+ directionUp?: Vec3Handle,
385
+ ): PluginApiReturn<ComponentHandle>
386
+
387
+ /**
388
+ * Create a **beam** by extruding a cross-section contour along `direction` by
389
+ * `length`. Matches the Snaptrude beam tool's semantics: the beam body hangs
390
+ * BELOW the plane the section is authored on.
391
+ *
392
+ * For a **horizontal** `direction` (the common spanning beam), author the
393
+ * section as an axis-aligned plan rectangle: its X extent is the beam's
394
+ * width, its Z extent is the beam's depth (the vertical drop). The beam runs
395
+ * `length` along `direction` starting at the section's centre, hanging below
396
+ * the authoring plane by its depth — exactly like an interactively drawn
397
+ * beam. Only axis-aligned rectangular sections are supported horizontally.
398
+ *
399
+ * For a **vertical** `direction` (the default), the section itself is
400
+ * extruded by `length`, again hanging below the authoring plane. Diagonal
401
+ * directions are rejected.
402
+ *
403
+ * @param section - Beam cross-section, an axis-aligned rectangle in plan
404
+ * (X extent = width, Z extent = depth)
405
+ * @param length - Beam length along `direction` (> 0); direction is
406
+ * normalized by the host, so magnitude does not scale the length
407
+ * @param direction - Beam axis: horizontal for a spanning beam, or vertical
408
+ * (default world up). Diagonal directions throw.
409
+ * @returns the {@linkcode ComponentHandle} of the created beam
410
+ * @throws if the section is invalid (horizontal beams: not an axis-aligned
411
+ * plan rectangle), the length is not positive, or the direction is zero or
412
+ * diagonal
413
+ *
414
+ * @examplePrompt Add a beam spanning 6 metres between the columns
415
+ * @examplePrompt Create a horizontal beam along the X axis
416
+ * @examplePrompt Run a 300x600 beam across the room
417
+ * @examplePrompt Extrude this cross-section into a 5m long beam
418
+ *
419
+ * # Example
420
+ * ```ts
421
+ * const rect = await snaptrude.core.geom.create.profileRect(0.3, 0.6)
422
+ * const section = await snaptrude.core.geom.create.contourFromProfile(rect)
423
+ * const alongX = await snaptrude.core.math.vec3.new(1, 0, 0)
424
+ * const beam = await snaptrude.design.create.beam(section, 6, alongX)
425
+ * ```
426
+ */
427
+ public abstract beam(
428
+ section: ContourHandle,
429
+ length: number,
430
+ direction?: Vec3Handle,
431
+ ): PluginApiReturn<ComponentHandle>
432
+
433
+ /**
434
+ * Create a connected run of **walls** from a profile — one wall per curve in
435
+ * the profile's chain, with mitred corners at shared endpoints.
436
+ *
437
+ * @param profile - Ordered curve chain (wall centerlines)
438
+ * @param height - Wall height (default engine default)
439
+ * @param thickness - Wall thickness (default: the `wallType`'s total layer
440
+ * thickness when `wallType` is given, else the engine default)
441
+ * @param wallType - Wall type to build with — the same searchable list the
442
+ * Draw tab's Wall Type dropdown offers. Pass a name from
443
+ * `design.types.list("wall")` (the summary's `label`, or its `"wall:…"` id).
444
+ * Drives the wall's construction layers and default material, and — when
445
+ * `thickness` is omitted — its total layer thickness. Default: the engine's
446
+ * generic wall.
447
+ * @param storey - Target storey (integer: `1` ground, `2` first floor, `-1`
448
+ * basement — same convention as `design.create.space`). The walls are
449
+ * assigned to it and lifted to its base elevation, all inside the same
450
+ * single undo entry. The storey must already exist
451
+ * (`core.storeys.create` first). Default: geometry-derived — a profile
452
+ * drawn at y = 0 lands on storey 1; the ACTIVE storey is NOT consulted.
453
+ * @returns a {@linkcode ComponentHandle}`[]` (one per wall), in profile order
454
+ * @throws if the profile is empty, `wallType` names no wall type in the
455
+ * project, `storey` does not exist, or wall creation fails
456
+ *
457
+ * @examplePrompt Draw walls along this centerline
458
+ * @examplePrompt Create 3m high, 200mm thick walls from these points
459
+ * @examplePrompt Build a wall run around the room outline
460
+ * @examplePrompt Turn this polyline sketch into walls
461
+ * @examplePrompt Add walls with mitred corners along the path
462
+ * @examplePrompt Draw brick walls with plaster along this outline
463
+ * @examplePrompt Build the perimeter in exposed concrete walls
464
+ *
465
+ * # Example
466
+ * ```ts
467
+ * const v = snaptrude.core.math.vec3
468
+ * const centerlines = await snaptrude.core.geom.create.profileFromLinePoints([
469
+ * await v.new(0, 0, 0),
470
+ * await v.new(8, 0, 0),
471
+ * await v.new(8, 0, 6),
472
+ * ])
473
+ * const walls = await snaptrude.design.create.walls(centerlines, 3, 0.2)
474
+ * // …built as a specific wall type (layers/material/thickness from the type):
475
+ * const [brick] = await snaptrude.design.types.list("wall")
476
+ * const brickWalls = await snaptrude.design.create.walls(
477
+ * centerlines, 3, undefined, brick.label,
478
+ * )
479
+ * ```
480
+ *
481
+ * @performance For MORE THAN ONE run, call `design.create.wallRuns(items[])` — one
482
+ * host round-trip and ONE undo entry for every run in the batch. Looping this
483
+ * single-run creator is N round-trips and N undo entries.
484
+ */
485
+ public abstract walls(
486
+ profile: ProfileHandle,
487
+ height?: number,
488
+ thickness?: number,
489
+ wallType?: string,
490
+ storey?: number,
491
+ ): PluginApiReturn<ComponentHandle[]>
492
+
493
+ /**
494
+ * Create **many wall runs** in one undoable operation (bulk plural of
495
+ * {@linkcode walls}). Each item is one full run — a wall per curve in that
496
+ * item's profile chain, mitred at shared endpoints. Junctions resolve within a
497
+ * run, not between runs. Each item carries its own
498
+ * dimensions, `wallType` and `storey`, so a single call can build a whole
499
+ * floor plate or several storeys at once. Validate-all-or-throw; one command.
500
+ *
501
+ * @param items - One {@linkcode PluginCreateWallRunItem} per run to create
502
+ * (≥1, ≤1000)
503
+ * @returns one {@linkcode ComponentHandle}`[]` per item, in input order —
504
+ * each inner array holding that run's walls in profile-curve order
505
+ * @throws `VALIDATION` if the items fail the schema (empty array, more than
506
+ * 1000 items, a non-positive height or thickness, a zero-length curve);
507
+ * `HANDLE_INVALID` if a `profile` handle is unknown or released;
508
+ * `PRECONDITION_FAILED` if a profile has no curves, `wallType` names no
509
+ * wall type in the project, or `storey` does not exist;
510
+ * `OPERATION_FAILED` if wall creation fails (nothing is created —
511
+ * `details.itemIndex` is the failing item); `METHOD_NOT_PERMITTED` if the
512
+ * plugin may not write.
513
+ *
514
+ * @examplePrompt Draw all the walls of this floor plan at once
515
+ * @examplePrompt Build every room's perimeter in one operation
516
+ * @examplePrompt Bulk create wall runs from these centerlines
517
+ * @examplePrompt Create the walls for both storeys in a single undo step
518
+ * @examplePrompt Turn these polylines into 200mm brick walls together
519
+ *
520
+ * @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
521
+ * entry. Always prefer this over calling `design.create.walls` in a loop: build the
522
+ * full `items[]` array first (all profiles up front), then make one call.
523
+ *
524
+ * # Example
525
+ * ```ts
526
+ * const v = snaptrude.core.math.vec3
527
+ * const ground = await snaptrude.core.geom.create.profileFromLinePoints([
528
+ * await v.new(0, 0, 0),
529
+ * await v.new(8, 0, 0),
530
+ * await v.new(8, 0, 6),
531
+ * ])
532
+ * const upper = await snaptrude.core.geom.create.profileFromLinePoints([
533
+ * await v.new(0, 0, 0),
534
+ * await v.new(8, 0, 0),
535
+ * ])
536
+ * const [groundWalls, upperWalls] = await snaptrude.design.create.wallRuns([
537
+ * { profile: ground, height: 3, thickness: 0.2 },
538
+ * { profile: upper, height: 3, storey: 2 },
539
+ * ])
540
+ * console.log(groundWalls.length, "walls on the ground floor")
541
+ * ```
542
+ */
543
+ public abstract wallRuns(
544
+ items: PluginCreateWallRunItem[],
545
+ ): PluginApiReturn<ComponentHandle[][]>
546
+
547
+ /**
548
+ * Create a **staircase** from a parametric preset, placed at a point.
549
+ *
550
+ * Geometry is procedurally generated from the chosen `preset`; there is no
551
+ * footprint input. Placed on the active structure/story unless overridden.
552
+ * The promise resolves only after the staircase's asynchronous geometry union
553
+ * and creation-command capture settle; a union failure rejects the call.
554
+ *
555
+ * @param preset - The parametric preset to generate
556
+ * @param position - Placement point
557
+ * @param label - Optional label
558
+ * @param structureId - Target structure (default active)
559
+ * @param level - Target level name (default active/`"01"`)
560
+ * @param dimensions - Optional positive dimension overrides in Snaptrude engine
561
+ * units, plus a placement angle in 90-degree increments. Overrides are
562
+ * applied to the staircase parameters before the creation command runs.
563
+ * @returns the {@linkcode ComponentHandle} of the created staircase
564
+ * @throws if the preset is unknown or placement fails
565
+ *
566
+ * @examplePrompt Add a dog-legged staircase at this location
567
+ * @examplePrompt Place a straight stair on level 01
568
+ * @examplePrompt Create an L-shaped staircase in the lobby
569
+ * @examplePrompt Insert a staircase near the entrance
570
+ * @examplePrompt Put amphitheatre steps at these coordinates
571
+ *
572
+ * # Example
573
+ * ```ts
574
+ * const stair = await snaptrude.design.create.staircase(
575
+ * "dogLegged",
576
+ * await snaptrude.core.math.vec3.new(5, 0, 5),
577
+ * )
578
+ * ```
579
+ */
580
+ public abstract staircase(
581
+ preset: PluginStaircasePreset,
582
+ position: Vec3Handle,
583
+ label?: string,
584
+ structureId?: string,
585
+ level?: string,
586
+ dimensions?: PluginStaircaseDimensions,
587
+ ): PluginApiReturn<ComponentHandle>
588
+
589
+ /**
590
+ * Create **reference lines** from a profile — one reference line per curve in
591
+ * the profile's ordered chain. Returns a handle per created line.
592
+ *
593
+ * Optional style (`color`, `thickness`, `style`, `gridTag`) applies to
594
+ * every created line.
595
+ *
596
+ * @param profile - Ordered curve chain (centerlines)
597
+ * @param color - Hex color `"#RRGGBB"` (default white)
598
+ * @param thickness - Line thickness (default 1)
599
+ * @param style - Line style (default `SOLID`)
600
+ * @param gridTag - Grid tag label (default `"A"`)
601
+ * @returns a {@linkcode ComponentHandle}`[]` (one per curve), in profile order
602
+ * @throws if the profile is empty or creation fails
603
+ *
604
+ * @examplePrompt Draw a reference line between these two points
605
+ * @examplePrompt Add dashed guide lines along this path
606
+ * @examplePrompt Create grid lines tagged A through the plan
607
+ * @examplePrompt Set up construction lines for the column grid
608
+ * @examplePrompt Mark a red reference line across the site
609
+ *
610
+ * # Example
611
+ * ```ts
612
+ * const v = snaptrude.core.math.vec3
613
+ * const profile = await snaptrude.core.geom.create.profileFromLinePoints([
614
+ * await v.new(0, 0, 0),
615
+ * await v.new(10, 0, 0),
616
+ * ])
617
+ * const lines = await snaptrude.design.create.referenceLines(
618
+ * profile,
619
+ * undefined,
620
+ * undefined,
621
+ * "DASHED",
622
+ * )
623
+ * ```
624
+ */
625
+ public abstract referenceLines(
626
+ profile: ProfileHandle,
627
+ color?: string,
628
+ thickness?: number,
629
+ style?: PluginReferenceLineStyle,
630
+ gridTag?: string,
631
+ ): PluginApiReturn<ComponentHandle[]>
632
+
633
+ /**
634
+ * Create a free rectangular **structural grid** — one grid group with two
635
+ * perpendicular line families (`linesX` lines spaced `spacingX` apart, and
636
+ * `linesY` lines spaced `spacingY` apart) on the active storey. One undoable
637
+ * creation.
638
+ *
639
+ * Units: spacings in Snaptrude units; `angle` in degrees (CCW about +Y,
640
+ * default 0). Without `center` the grid is centred on the current viewport
641
+ * (the native tool's behavior) — pass `center` for deterministic placement.
642
+ *
643
+ * @param linesX - Line count of the first family (integer ≥ 1)
644
+ * @param linesY - Line count of the second family (integer ≥ 1)
645
+ * @param spacingX - First-family spacing (Snaptrude units, > 0)
646
+ * @param spacingY - Second-family spacing (Snaptrude units, > 0)
647
+ * @param options - `angle`, `center`, and {@linkcode PluginGridStyleOptions}
648
+ * @returns the created grid group's {@linkcode ComponentHandle}
649
+ *
650
+ * @examplePrompt Create a 5 by 8 structural grid with 6 metre spacing
651
+ * @examplePrompt Add a column grid rotated 30 degrees
652
+ * @examplePrompt Set up a structural grid at the site origin
653
+ *
654
+ * # Example
655
+ * ```ts
656
+ * const centre = await snaptrude.core.math.vec3.new(0, 0, 0)
657
+ * const grid = await snaptrude.design.create.grid(5, 8, 6, 6, { center: centre })
658
+ * ```
659
+ */
660
+ public abstract grid(
661
+ linesX: number,
662
+ linesY: number,
663
+ spacingX: number,
664
+ spacingY: number,
665
+ options?: {
666
+ angle?: number
667
+ center?: Vec3Handle
668
+ } & PluginGridStyleOptions,
669
+ ): PluginApiReturn<ComponentHandle>
670
+
671
+ /**
672
+ * Create a **structural grid from a single curve** — one grid group holding
673
+ * one wing with one line (the draw tool's output). The curve may be a line
674
+ * or an arc; circles are rejected with `VALIDATION`. Undoable.
675
+ *
676
+ * @param curve - The grid line's geometry ({@linkcode CurveHandle}, world space)
677
+ * @param options - `tag` (defaults to the draw tool's next tag) and
678
+ * {@linkcode PluginGridStyleOptions}
679
+ * @returns the created grid group's {@linkcode ComponentHandle}
680
+ *
681
+ * @examplePrompt Draw a grid line from A to B
682
+ * @examplePrompt Add a curved grid line through these points
683
+ * @examplePrompt Create grid line "C" along this wall
684
+ *
685
+ * # Example
686
+ * ```ts
687
+ * const { vec3 } = snaptrude.core.math
688
+ * const from = await vec3.new(0, 0, 0)
689
+ * const to = await vec3.new(30, 0, 0)
690
+ * const curve = await snaptrude.core.geom.create.line(from, to)
691
+ * const grid = await snaptrude.design.create.gridFromCurve(curve, { tag: "A" })
692
+ * ```
693
+ */
694
+ public abstract gridFromCurve(
695
+ curve: CurveHandle,
696
+ options?: {
697
+ tag?: string
698
+ } & PluginGridStyleOptions,
699
+ ): PluginApiReturn<ComponentHandle>
700
+
701
+ /**
702
+ * Generate **structural grids fitted to mass footprints** — one grid group
703
+ * per footprint cluster, with counts and orientation derived from each
704
+ * footprint's geometry and the given spacings. All created groups commit as
705
+ * ONE undoable unit.
706
+ *
707
+ * Lenient like the native tool: masses without an extractable footprint
708
+ * (no B-rep, degenerate top face) are skipped; throws `VALIDATION` only when
709
+ * NONE of the given masses yields a footprint.
710
+ *
711
+ * @param masses - Masses whose footprints seat the grids
712
+ * @param spacingX - First-family spacing (Snaptrude units, > 0)
713
+ * @param spacingY - Second-family spacing (Snaptrude units, > 0)
714
+ * @param options - {@linkcode PluginGridStyleOptions}
715
+ * @returns the created grid groups' {@linkcode ComponentHandle}`[]`
716
+ *
717
+ * @examplePrompt Generate grids for the selected masses
718
+ * @examplePrompt Auto-generate a 6m structural grid on this building
719
+ * @examplePrompt Fit column grids to every mass on this storey
720
+ *
721
+ * # Example
722
+ * ```ts
723
+ * const masses = await snaptrude.design.query.listMasses({ storeys: [1] })
724
+ * const grids = await snaptrude.design.create.gridsFromMasses(masses, 6, 6)
725
+ * ```
726
+ */
727
+ public abstract gridsFromMasses(
728
+ masses: ComponentHandle[],
729
+ spacingX: number,
730
+ spacingY: number,
731
+ options?: PluginGridStyleOptions,
732
+ ): PluginApiReturn<ComponentHandle[]>
733
+
734
+ /**
735
+ * Create **columns at every grid-line intersection** of the given grid
736
+ * groups, sized `width` × `depth` and oriented to the grid axes, on the
737
+ * grids' storey. All columns commit as ONE undoable unit.
738
+ *
739
+ * @param grids - Grid groups whose intersections seat the columns
740
+ * @param width - Column width (Snaptrude units, > 0)
741
+ * @param depth - Column depth (Snaptrude units, > 0)
742
+ * @returns the created columns' {@linkcode ComponentHandle}`[]`
743
+ * @throws `VALIDATION` when an id does not resolve to a grid group;
744
+ * `OPERATION_FAILED` when the grids have no line intersections
745
+ *
746
+ * @examplePrompt Generate columns on this grid
747
+ * @examplePrompt Place 450mm square columns at every grid intersection
748
+ *
749
+ * # Example
750
+ * ```ts
751
+ * const grids = await snaptrude.design.query.listGrids()
752
+ * const columns = await snaptrude.design.create.columnsFromGrids(grids, 0.45, 0.45)
753
+ * ```
754
+ */
755
+ public abstract columnsFromGrids(
756
+ grids: ComponentHandle[],
757
+ width: number,
758
+ depth: number,
759
+ ): PluginApiReturn<ComponentHandle[]>
760
+
761
+ /**
762
+ * Place a **furniture** item from the project library at a world position.
763
+ *
764
+ * Identified by a **catalog (library) id** — the team object's stable `_id` for
765
+ * project uploads, or the item's `fullName` for the general library. Discover ids
766
+ * with {@linkcode PluginDesignFurnitureApi.listCatalog}. Placement is asynchronous
767
+ * (the source mesh is fetched if not cached) and creates one undo entry.
768
+ *
769
+ * Placed at the item's default rotation unless `angleInDegrees` is given, which
770
+ * rotates it about the vertical axis at creation time (baked into the same undo
771
+ * entry). To rotate an existing instance instead, use `design.transform.rotate`.
772
+ *
773
+ * @param catalogId - Library id: team `_id` or general `fullName`
774
+ * @param position - Absolute world placement point. `position.y` is the REST
775
+ * elevation: the item is grounded so its bounding-box base sits exactly at
776
+ * `position.y` (the same surface-flush contract as interactive drag-drop) —
777
+ * pass the floor/storey elevation to stand furniture on it; never add half
778
+ * the item's height yourself.
779
+ * @param options - Optional placement options: `label` — instance name and
780
+ * readable label (`design.query.getLabel`; default auto `${name}Ins${n}`);
781
+ * `createNewSourceMesh` — legacy flag, kept for compatibility. The host owns
782
+ * source-mesh persistence: a catalog source is recorded exactly once, by the
783
+ * first placement that brings it in, and this flag cannot skip that record.
784
+ * @param angleInDegrees - Optional signed rotation about the vertical axis, in
785
+ * degrees (same convention as {@linkcode PluginDesignTransformApi.rotate}).
786
+ * Applied at creation time so it is part of the placement's single undo entry.
787
+ * Default: the item's own (unrotated) orientation.
788
+ * @returns the {@linkcode ComponentHandle} of the placed furniture instance
789
+ * @throws if the catalog id is unknown, the source mesh fails to load, or placement fails;
790
+ * `PRECONDITION_FAILED` (`details.engineCode: "TOOL_ACTIVE"`) while the interactive
791
+ * furniture tool is active — finish or cancel it first
792
+ *
793
+ * @examplePrompt Place a chair from the library at this spot
794
+ * @examplePrompt Add a sofa from the furniture catalog to the living room
795
+ * @examplePrompt Drop a desk into the scene at 3, 0, 5
796
+ * @examplePrompt Insert the uploaded bed model in the bedroom
797
+ * @examplePrompt Put a table from my project library here and name it Table-01
798
+ * @examplePrompt Place a chair here rotated 90 degrees
799
+ *
800
+ * # Example
801
+ * ```ts
802
+ * const chair = await snaptrude.design.create.furniture(
803
+ * "6620f1a…", // from design.furniture.listCatalog()
804
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
805
+ * { label: "Chair-01" },
806
+ * )
807
+ * // …placed already turned 90° about the vertical axis:
808
+ * const turned = await snaptrude.design.create.furniture(
809
+ * "6620f1a…",
810
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
811
+ * undefined,
812
+ * 90,
813
+ * )
814
+ * ```
815
+ *
816
+ * @performance For MORE THAN ONE item, call `design.create.furnitureItems(items[])` —
817
+ * one host round-trip and ONE undo entry, and a catalog source shared by several
818
+ * items is fetched once. Looping this single-item creator is N round-trips.
819
+ */
820
+ public abstract furniture(
821
+ catalogId: string,
822
+ position: Vec3Handle,
823
+ options?: { label?: string; createNewSourceMesh?: boolean },
824
+ angleInDegrees?: number,
825
+ ): PluginApiReturn<ComponentHandle>
826
+
827
+ /**
828
+ * Place **many furniture items** in one undoable operation (bulk plural of
829
+ * {@linkcode furniture}). Each item names a catalog id and an absolute world
830
+ * position (`position.y` is the REST elevation — the same grounding contract
831
+ * as the singular creator), with optional label and rotation. A catalog
832
+ * source shared by several items is fetched and recorded once for the whole
833
+ * batch, so the host — not the caller — owns source persistence (there is no
834
+ * per-item `createNewSourceMesh`). Validate-all-or-throw; one command.
835
+ *
836
+ * @param items - One {@linkcode PluginCreateFurnitureItem} per instance to
837
+ * place (≥1, ≤1000)
838
+ * @returns the placed instances as {@linkcode ComponentHandle}`[]`, in input order
839
+ * @throws `VALIDATION` if the items fail the schema (empty array, more than
840
+ * 1000 items); `HANDLE_INVALID` if a `position` handle is unknown or
841
+ * released; `PRECONDITION_FAILED` if a catalog id is unknown, a furniture
842
+ * tool is active, or a parametric group is active (exit it first, or place
843
+ * items one at a time with `furniture`); `OPERATION_FAILED` if a source
844
+ * mesh fails to load or placement fails (nothing is created —
845
+ * `details.itemIndex` is the failing item); `METHOD_NOT_PERMITTED` if the plugin may not write.
846
+ *
847
+ * @examplePrompt Place all the desks for this office at once
848
+ * @examplePrompt Furnish every bedroom in one operation
849
+ * @examplePrompt Bulk place these chairs around the table
850
+ * @examplePrompt Add the whole furniture layout in a single undo step
851
+ * @examplePrompt Drop twenty copies of this chair at these positions
852
+ *
853
+ * @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
854
+ * entry, and each distinct catalog source loads once. Always prefer this over
855
+ * calling `design.create.furniture` in a loop: build the full `items[]` array
856
+ * first (all positions and angles up front), then make one call.
857
+ *
858
+ * # Example
859
+ * ```ts
860
+ * const v = snaptrude.core.math.vec3
861
+ * const [chair] = await snaptrude.design.furniture.listCatalog()
862
+ * const placed = await snaptrude.design.create.furnitureItems([
863
+ * { catalogId: chair.id, position: await v.new(3, 0, 5), label: "Chair-01" },
864
+ * { catalogId: chair.id, position: await v.new(4, 0, 5), angleInDegrees: 90 },
865
+ * { catalogId: chair.id, position: await v.new(5, 0, 5), angleInDegrees: 180 },
866
+ * ])
867
+ * ```
868
+ */
869
+ public abstract furnitureItems(
870
+ items: PluginCreateFurnitureItem[],
871
+ ): PluginApiReturn<ComponentHandle[]>
872
+
873
+ /**
874
+ * Place a **door** from the catalog into a host wall.
875
+ *
876
+ * Identified by a **catalog (library) id** — the team object's stable `_id`
877
+ * or the general library's `fullName`. Discover ids with
878
+ * {@linkcode PluginDesignDoorsApi.listCatalog}. The world `position` is
879
+ * projected onto the host wall's face to locate the opening; the wall is
880
+ * re-cut and the door hosted in a single undo entry. Placement is
881
+ * asynchronous (the source mesh is fetched if not cached).
882
+ *
883
+ * @param catalogId - Library id: team `_id` or general `fullName`
884
+ * @param hostWall - The wall to host the door
885
+ * @param position - World point projected onto the wall to locate the opening
886
+ * @param options - Optional placement options: `label` — instance name;
887
+ * `hinge` — world point near the jamb the door is hinged on (the door is
888
+ * reflected along the wall so its hinged jamb is the one nearer this
889
+ * point; default the catalog item's authored hinge side)
890
+ * @param facing - World point on the side of the wall the door swings open
891
+ * to (the room it opens into — where the plan symbol draws the swing arc).
892
+ * Any point clearly on that side works (e.g. the room's center). Default:
893
+ * the engine picks a side (nondeterministic when `position` sits on the
894
+ * wall centerline).
895
+ * @returns the {@linkcode ComponentHandle} of the placed door
896
+ * @throws if the catalog id is unknown, the host is not a wall, the source
897
+ * mesh fails to load, or the projected point falls **outside** the host wall
898
+ *
899
+ * @examplePrompt Add a door to this wall here
900
+ * @examplePrompt Place a sliding door on the selected wall
901
+ * @examplePrompt Put a door from the catalog at this point on the wall
902
+ * @examplePrompt Insert the entrance door into this wall
903
+ * @examplePrompt Add a door to the wall and call it Entry-01
904
+ * @examplePrompt Add a door that opens into the living room
905
+ * @examplePrompt Put a door here hinged on the north jamb
906
+ *
907
+ * # Example
908
+ * ```ts
909
+ * const [wall] = await snaptrude.design.query.listWalls({ isSelected: true })
910
+ * const [entry] = await snaptrude.design.doors.listCatalog()
911
+ * const door = await snaptrude.design.create.door(
912
+ * entry.id,
913
+ * wall,
914
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
915
+ * { label: "Entry-01" },
916
+ * )
917
+ * // …facing a specific side of the wall (pass a point inside that room):
918
+ * const intoKitchen = await snaptrude.design.create.door(
919
+ * entry.id,
920
+ * wall,
921
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
922
+ * undefined,
923
+ * await snaptrude.core.math.vec3.new(3, 0, 9),
924
+ * )
925
+ * // …and hinged on the jamb nearest a point (here the +x end of the opening):
926
+ * const hingedRight = await snaptrude.design.create.door(
927
+ * entry.id,
928
+ * wall,
929
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
930
+ * { hinge: await snaptrude.core.math.vec3.new(3.5, 0, 5) },
931
+ * await snaptrude.core.math.vec3.new(3, 0, 9),
932
+ * )
933
+ * ```
934
+ *
935
+ * @performance For MORE THAN ONE door, call `design.create.doors(items[])` — one host
936
+ * round-trip and ONE undo entry, with each host wall re-cut once per opening inside
937
+ * that single call. Looping this single-door creator is N round-trips.
938
+ */
939
+ public abstract door(
940
+ catalogId: string,
941
+ hostWall: ComponentHandle,
942
+ position: Vec3Handle,
943
+ options?: { label?: string; hinge?: Vec3Handle },
944
+ facing?: Vec3Handle,
945
+ ): PluginApiReturn<ComponentHandle>
946
+
947
+ /**
948
+ * Place **many doors** into host walls in one undoable operation (bulk plural
949
+ * of {@linkcode door}). Each item carries its own catalog id, host wall,
950
+ * world position, and optional `facing`, `label`, `width` and `height` — the
951
+ * same fields as a `"door"` {@linkcode PluginDesignCreateOpeningOptions}.
952
+ * Validate-all-or-throw; one command.
953
+ *
954
+ * As with the singular creator, placing an opening **re-cuts its host wall**:
955
+ * the wall you passed as `hostWall` stops resolving once the call returns.
956
+ * Several items MAY name the same original wall handle in one call — the host
957
+ * chains the re-cuts internally — but after the call recover the surviving
958
+ * wall with `design.query.getHost(opening)`, never by reusing the handle you
959
+ * passed in.
960
+ *
961
+ * @param items - One {@linkcode PluginCreateDoorItem} per door to place
962
+ * (≥1, ≤1000)
963
+ * @returns the placed doors as {@linkcode ComponentHandle}`[]`, in input order
964
+ * @throws `VALIDATION` if the items fail the schema (empty array, more than
965
+ * 1000 items, unknown fields, a non-positive `width`/`height`);
966
+ * `HANDLE_INVALID` if a `position`, `facing` or `hinge` handle is unknown
967
+ * or released; `PRECONDITION_FAILED` if a catalog id is unknown, a `hostWall`
968
+ * is not a wall / is locked / is not in the active proposal, the projected
969
+ * point falls outside its host wall, or a door tool is active;
970
+ * `OPERATION_FAILED` if a source mesh fails to load or placement fails
971
+ * (nothing is created — `details.itemIndex` is the failing item);
972
+ * `METHOD_NOT_PERMITTED` if the plugin may not write.
973
+ *
974
+ * @examplePrompt Add doors to all of these walls at once
975
+ * @examplePrompt Place a door in every room in one operation
976
+ * @examplePrompt Bulk add the entrance doors from this schedule
977
+ * @examplePrompt Put three doors on this wall in a single undo step
978
+ * @examplePrompt Add all the doors for this floor plan together
979
+ *
980
+ * @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
981
+ * entry, and each distinct catalog source loads once. Always prefer this over
982
+ * calling `design.create.door` in a loop: build the full `items[]` array first
983
+ * (all host walls and points up front), then make one call.
984
+ *
985
+ * # Example
986
+ * ```ts
987
+ * const v = snaptrude.core.math.vec3
988
+ * const [wall] = await snaptrude.design.query.listWalls({ isSelected: true })
989
+ * const [entry] = await snaptrude.design.doors.listCatalog()
990
+ * const [front, side] = await snaptrude.design.create.doors([
991
+ * { catalogId: entry.id, hostWall: wall, position: await v.new(2, 0, 5), label: "D-01" },
992
+ * { catalogId: entry.id, hostWall: wall, position: await v.new(6, 0, 5), width: 1.2 },
993
+ * ])
994
+ * // `wall` was re-cut twice and no longer resolves — ask the opening for its host:
995
+ * const currentWall = await snaptrude.design.query.getHost(front)
996
+ * ```
997
+ */
998
+ public abstract doors(
999
+ items: PluginCreateDoorItem[],
1000
+ ): PluginApiReturn<ComponentHandle[]>
1001
+
1002
+ /**
1003
+ * Place a **window** from the catalog into a host wall.
1004
+ *
1005
+ * Identified by a **catalog (library) id** — the team object's stable `_id`
1006
+ * or the general library's `fullName`. Discover ids with
1007
+ * {@linkcode PluginDesignWindowsApi.listCatalog}. The world `position` is
1008
+ * projected onto the host wall's face to locate the opening; the wall is
1009
+ * re-cut and the window hosted in a single undo entry. Placement is
1010
+ * asynchronous (the source mesh is fetched if not cached).
1011
+ *
1012
+ * @param catalogId - Library id: team `_id` or general `fullName`
1013
+ * @param hostWall - The wall to host the window
1014
+ * @param position - World point projected onto the wall to locate the opening
1015
+ * @param options - Optional placement options: `label` — instance name;
1016
+ * `hinge` — world point near the jamb the window is hinged on (same rule
1017
+ * as {@linkcode PluginDesignCreateApi.door}; default the catalog item's
1018
+ * authored side)
1019
+ * @param facing - World point on the side of the wall the window opens to
1020
+ * (matters for asymmetric windows, e.g. casement swing) — same convention
1021
+ * as {@linkcode PluginDesignCreateApi.door}. Default: the engine picks a
1022
+ * side (nondeterministic when `position` sits on the centerline).
1023
+ * @returns the {@linkcode ComponentHandle} of the placed window
1024
+ * @throws if the catalog id is unknown, the host is not a wall, the source
1025
+ * mesh fails to load, or the projected point falls **outside** the host wall
1026
+ *
1027
+ * @examplePrompt Add a window to this wall here
1028
+ * @examplePrompt Place a casement window on the selected wall
1029
+ * @examplePrompt Put a window from the catalog at this point on the wall
1030
+ * @examplePrompt Insert a window into the living room wall
1031
+ * @examplePrompt Add a window to the wall and name it Win-01
1032
+ * @examplePrompt Add a casement window opening toward the garden side
1033
+ *
1034
+ * # Example
1035
+ * ```ts
1036
+ * const [wall] = await snaptrude.design.query.listWalls({ isSelected: true })
1037
+ * const [entry] = await snaptrude.design.windows.listCatalog()
1038
+ * const window = await snaptrude.design.create.window(
1039
+ * entry.id,
1040
+ * wall,
1041
+ * await snaptrude.core.math.vec3.new(3, 0, 5),
1042
+ * { label: "Win-01" },
1043
+ * )
1044
+ * ```
1045
+ *
1046
+ * @performance For MORE THAN ONE window, call `design.create.windows(items[])` — one
1047
+ * host round-trip and ONE undo entry, with each host wall re-cut once per opening
1048
+ * inside that single call. Looping this single-window creator is N round-trips.
1049
+ */
1050
+ public abstract window(
1051
+ catalogId: string,
1052
+ hostWall: ComponentHandle,
1053
+ position: Vec3Handle,
1054
+ options?: { label?: string; hinge?: Vec3Handle },
1055
+ facing?: Vec3Handle,
1056
+ ): PluginApiReturn<ComponentHandle>
1057
+
1058
+ /**
1059
+ * Place **many windows** into host walls in one undoable operation (bulk
1060
+ * plural of {@linkcode window}). Each item carries its own catalog id, host
1061
+ * wall, world position, and optional `facing`, `label`, `width`, `height` and
1062
+ * `sillHeight` — the same fields as a `"window"`
1063
+ * {@linkcode PluginDesignCreateOpeningOptions}. `sillHeight` is measured from
1064
+ * the host wall base to the BOTTOM of the window. Validate-all-or-throw; one
1065
+ * command.
1066
+ *
1067
+ * As with the singular creator, placing an opening **re-cuts its host wall**:
1068
+ * the wall you passed as `hostWall` stops resolving once the call returns.
1069
+ * Several items MAY name the same original wall handle in one call — the host
1070
+ * chains the re-cuts internally — but after the call recover the surviving
1071
+ * wall with `design.query.getHost(opening)`, never by reusing the handle you
1072
+ * passed in.
1073
+ *
1074
+ * @param items - One {@linkcode PluginCreateWindowItem} per window to place
1075
+ * (≥1, ≤1000)
1076
+ * @returns the placed windows as {@linkcode ComponentHandle}`[]`, in input order
1077
+ * @throws `VALIDATION` if the items fail the schema (empty array, more than
1078
+ * 1000 items, unknown fields, a non-positive `width`/`height`, a negative
1079
+ * `sillHeight`); `HANDLE_INVALID` if a `position`, `facing` or `hinge`
1080
+ * handle is unknown or released; `PRECONDITION_FAILED` if a catalog id is unknown, a
1081
+ * `hostWall` is not a wall / is locked / is not in the active proposal, the
1082
+ * projected point falls outside its host wall, or a window tool is active;
1083
+ * `OPERATION_FAILED` if a source mesh fails to load or placement fails
1084
+ * (nothing is created — `details.itemIndex` is the failing item);
1085
+ * `METHOD_NOT_PERMITTED` if the plugin may not write.
1086
+ *
1087
+ * @examplePrompt Add windows along this whole facade at once
1088
+ * @examplePrompt Place a window in every bedroom in one operation
1089
+ * @examplePrompt Bulk add the windows from this schedule
1090
+ * @examplePrompt Put four windows on this wall in a single undo step
1091
+ * @examplePrompt Add all the windows with a 0.9m sill height together
1092
+ *
1093
+ * @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
1094
+ * entry, and each distinct catalog source loads once. Always prefer this over
1095
+ * calling `design.create.window` in a loop: build the full `items[]` array first
1096
+ * (all host walls and points up front), then make one call.
1097
+ *
1098
+ * # Example
1099
+ * ```ts
1100
+ * const v = snaptrude.core.math.vec3
1101
+ * const [wall] = await snaptrude.design.query.listWalls({ isSelected: true })
1102
+ * const [casement] = await snaptrude.design.windows.listCatalog()
1103
+ * const placed = await snaptrude.design.create.windows([
1104
+ * { catalogId: casement.id, hostWall: wall, position: await v.new(2, 0, 5), sillHeight: 0.9 },
1105
+ * { catalogId: casement.id, hostWall: wall, position: await v.new(5, 0, 5), sillHeight: 0.9 },
1106
+ * ])
1107
+ * const currentWall = await snaptrude.design.query.getHost(placed[0])
1108
+ * ```
1109
+ */
1110
+ public abstract windows(
1111
+ items: PluginCreateWindowItem[],
1112
+ ): PluginApiReturn<ComponentHandle[]>
1113
+
1114
+ /**
1115
+ * Place a catalog **door or window** into a host wall with optional size overrides.
1116
+ *
1117
+ * The world `position` is projected onto the host wall to locate the opening.
1118
+ * All supplied dimensions use Snaptrude engine units. Window `sillHeight` is
1119
+ * measured from the host wall base to the bottom of the window, not to
1120
+ * its center. Placement is asynchronous and committed as one undoable creation.
1121
+ *
1122
+ * @param options - Opening kind, catalog and host references, placement, and
1123
+ * optional facing (swing side), hinge (hinged jamb), label, and dimensions
1124
+ * @returns the {@linkcode ComponentHandle} of the placed door or window
1125
+ * @throws if the options are invalid, the catalog id is unknown, the host is
1126
+ * not a wall, loading fails, or the opening cannot be placed on the host
1127
+ *
1128
+ * @examplePrompt Add a 1m wide door to this wall here
1129
+ * @examplePrompt Place a window with a 0.9m sill height on the selected wall
1130
+ *
1131
+ * @performance Single-opening creator — use it for one hosted opening. For MORE
1132
+ * THAN ONE, call `design.create.doors(items[])` / `design.create.windows(items[])`:
1133
+ * the same per-item fields, one host round-trip, ONE undo entry.
1134
+ *
1135
+ * # Example
1136
+ * ```ts
1137
+ * const opening = await snaptrude.design.create.opening({
1138
+ * kind: "window",
1139
+ * catalogId: windowType.id,
1140
+ * hostWall: wall,
1141
+ * position: await snaptrude.core.math.vec3.new(3, 0, 5),
1142
+ * width: 1.2,
1143
+ * height: 1.5,
1144
+ * sillHeight: 0.9,
1145
+ * })
1146
+ * ```
1147
+ */
1148
+ public abstract opening(
1149
+ options: PluginDesignCreateOpeningOptions,
1150
+ ): PluginApiReturn<ComponentHandle>
1151
+
1152
+ /**
1153
+ * Place a **smart layout** — clone an in-scene template cluster (walls,
1154
+ * furniture, doors, windows, floors) into one or more target ROOM/DEPARTMENT
1155
+ * spaces, adapting orientation and fit to each target.
1156
+ *
1157
+ * Supply the template as **exactly one** of `templateGroup` (a group **id**
1158
+ * from `snaptrude.core.groups.list` — groups are string-id entities, not
1159
+ * component handles) or
1160
+ * `templateComponents` (an explicit component set); every target in `targets`
1161
+ * (≥1) receives its own placement. By default the target spaces are hidden
1162
+ * after placement (`hideTargets`, mirroring the product) — pass `false` to keep
1163
+ * them visible.
1164
+ *
1165
+ * The whole operation — every wall/opening/furniture/floor across every target,
1166
+ * plus the target-hide — is committed as a **single undo step**. Because all
1167
+ * targets merge into one creation batch, the created entities are returned
1168
+ * **flat, grouped by kind** ({@linkcode PluginSmartLayoutResult}), NOT attributed
1169
+ * per target (per-target attribution would break the single-undo guarantee).
1170
+ * `skippedWalls` is the interior-optimizer's best-candidate count of walls it
1171
+ * could not place. Synchronous and heavy — many targets can jank the main thread.
1172
+ *
1173
+ * @param options - {@linkcode PluginSmartLayoutArgs}: template source, targets, and `hideTargets`
1174
+ * @returns a {@linkcode PluginSmartLayoutResult} — created entities grouped by kind + `skippedWalls`
1175
+ * @throws if smart layout is not enabled, the template group is invalid, there
1176
+ * is no template / no targets / no valid mappings, or component creation fails
1177
+ *
1178
+ * @examplePrompt Copy this room's layout into the selected rooms
1179
+ * @examplePrompt Apply this furniture arrangement to the other offices
1180
+ * @examplePrompt Replicate this template into these two spaces
1181
+ * @examplePrompt Place this desk cluster into every meeting room
1182
+ * @examplePrompt Use this room as a template for the rooms I selected but keep them visible
1183
+ *
1184
+ * # Example
1185
+ * ```ts
1186
+ * const [templateRoom, ...targets] = await snaptrude.design.query.listSpaces({ isSelected: true })
1187
+ * const result = await snaptrude.design.create.smartLayout({
1188
+ * templateComponents: [templateRoom],
1189
+ * targets,
1190
+ * })
1191
+ * console.log("placed walls:", result.created.walls.length, "skipped:", result.skippedWalls)
1192
+ *
1193
+ * // …or clone a saved group by its id (from core.groups.list)
1194
+ * const { groups } = await snaptrude.core.groups.list()
1195
+ * await snaptrude.design.create.smartLayout({ templateGroup: groups[0].id, targets })
1196
+ * ```
1197
+ */
1198
+ public abstract smartLayout(
1199
+ options: PluginSmartLayoutArgs,
1200
+ ): PluginApiReturn<PluginSmartLayoutResult>
1201
+
1202
+ /**
1203
+ * **Copy** existing entities, offsetting each copy by `displacement * i` (i = 1…count),
1204
+ * source positions preserved. Migrated from the removed `tools.copy`. In `"instance"`
1205
+ * mode copies stay in the source's instance family where possible; `"unique"` makes
1206
+ * independent geometry. The created copies become the active selection. Undoable.
1207
+ *
1208
+ * Runs on the engine's array-copy tool, so its semantics carry over: an
1209
+ * `"instance"` copy of a source that is not yet an instance **replaces that
1210
+ * source** with a fresh instance component — the handle you passed in stops
1211
+ * resolving after the call. Re-query (e.g. `design.query.listSpaces`) to pick
1212
+ * up the replacement before operating on that entity again; copying the stale
1213
+ * handle throws. `"unique"` mode never replaces sources.
1214
+ *
1215
+ * @param components - Entities to copy (≥1)
1216
+ * @param displacement - Per-copy offset as a {@linkcode Vec3Handle} (copy `i` at `displacement * i`)
1217
+ * @param options - `count` (copies per component, default 1), `mode` (`"instance"` | `"unique"`, default `"instance"`)
1218
+ * @returns the created copies as {@linkcode ComponentHandle}`[]`
1219
+ * @throws if a component handle is unknown or stale (replaced by an earlier
1220
+ * `"instance"` copy), `count` is not a positive integer, or the engine fails
1221
+ *
1222
+ * @examplePrompt Copy this room 3 times spaced 6m apart
1223
+ * @examplePrompt Duplicate the selected furniture along the X axis
1224
+ * @examplePrompt Make 5 copies of this column at 4 metre intervals
1225
+ * @examplePrompt Array these walls with a 3m offset
1226
+ * @examplePrompt Clone the desk as a unique copy, not an instance
1227
+ *
1228
+ * @performance To place N repeats of the same geometry, bulk-create the seed(s) once then
1229
+ * call this ONCE with `{ count: N - 1 }` — one host round-trip for all copies. Never
1230
+ * reproduce geometry by looping `design.create.*` N times. Copy only after the create
1231
+ * that mints the seed ids.
1232
+ *
1233
+ * # Example
1234
+ * ```ts
1235
+ * const { vec3 } = snaptrude.core.math
1236
+ * const copies = await snaptrude.design.create.copy(["space-id"], vec3.new(6, 0, 0), { count: 3 })
1237
+ * ```
1238
+ */
1239
+ public abstract copy(
1240
+ components: ComponentHandle[],
1241
+ displacement: Vec3Handle,
1242
+ options?: { count?: number; mode?: PluginCopyMode },
1243
+ ): PluginApiReturn<ComponentHandle[]>
1244
+
1245
+ /**
1246
+ * Create **many spaces** in one undoable operation (bulk plural of {@linkcode space}).
1247
+ * Migrated from the removed `entity.space.bulkCreate`. Each item extrudes a contour
1248
+ * footprint up `height`. Validate-all-or-throw; one command. For a rectangular
1249
+ * (box) space, build the footprint with `core.geom.create.profileRect` →
1250
+ * `contourFromProfile`, then pass it as an item. Each item may carry its own
1251
+ * `storey` (see {@linkcode PluginCreateSpaceItem}) so a single call can populate
1252
+ * several floors at once.
1253
+ *
1254
+ * @param items - One {@linkcode PluginCreateSpaceItem} per space to create (≥1)
1255
+ * @returns the created spaces as {@linkcode ComponentHandle}`[]`, in input order
1256
+ * @throws if any item's contour is invalid, its height is not positive, or its
1257
+ * target `storey` does not exist (all-or-nothing — nothing is created)
1258
+ *
1259
+ * @examplePrompt Create several rooms at once from these footprints
1260
+ * @examplePrompt Generate all the bedrooms in one operation
1261
+ * @examplePrompt Bulk create the spaces for this floor plan
1262
+ * @examplePrompt Add three rooms with different heights in a single undo step
1263
+ * @examplePrompt Create one room on the ground floor and one on the first floor
1264
+ *
1265
+ * @performance Bulk creator — the whole batch is ONE host round-trip. Always prefer this
1266
+ * over calling `design.create.space` in a loop: build the full `items[]` array first
1267
+ * (all per-item math and geometry up front), then make one call.
1268
+ *
1269
+ * # Example
1270
+ * ```ts
1271
+ * const rect = await snaptrude.core.geom.create.profileRect(4, 3)
1272
+ * const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
1273
+ * const [a, b] = await snaptrude.design.create.spaces([
1274
+ * { contour, height: 3, label: "R1" },
1275
+ * { contour, height: 4, label: "R2", position: await vec3.new(10, 0, 0) },
1276
+ * ])
1277
+ * ```
1278
+ */
1279
+ public abstract spaces(
1280
+ items: PluginCreateSpaceItem[],
1281
+ ): PluginApiReturn<ComponentHandle[]>
1282
+
1283
+ /**
1284
+ * Create a new parametric buildable envelope — the zoning-regulated volume a
1285
+ * building may occupy — generated from a site polygon, tiered setbacks, a
1286
+ * height or floor-count cap, and optional FAR and lot-coverage limits. The host
1287
+ * mints the envelope id and returns it. Canonical home of the create formerly
1288
+ * at `entity.buildableEnvelope.create` (now deprecated).
1289
+ *
1290
+ * @param sitePolygon - Site polygon vertices in `lengthUnit`; minimum 3 vertices.
1291
+ * @param lengthUnit - Unit used by all length fields (`"ft" | "m"`).
1292
+ * @param setbacks - Setback profile, ground tier first; minimum 1 tier.
1293
+ * @param verticalCap - Maximum height or floor count.
1294
+ * @param floorToFloor - Required floor-to-floor height in `lengthUnit`.
1295
+ * @param farRatio - Optional FAR value, positive when provided.
1296
+ * @param lotCoverageMaxPct - Optional lot coverage cap, `0..100`.
1297
+ * @returns A {@linkcode PluginBuildableEnvelopeCreateResult} with the
1298
+ * `buildableEnvelopeId` of the created envelope.
1299
+ * @throws If validation fails or generation produces no renderable geometry.
1300
+ *
1301
+ * @examplePrompt Create a buildable envelope for my site
1302
+ * @examplePrompt Generate the zoning envelope with 10ft front setbacks
1303
+ * @examplePrompt Show the maximum buildable volume with a 150ft height limit
1304
+ * @examplePrompt Create a zoning envelope capped at 12 floors with FAR 3
1305
+ *
1306
+ * # Example
1307
+ * ```ts
1308
+ * const { buildableEnvelopeId } = await snaptrude.design.create.buildableEnvelope(
1309
+ * [
1310
+ * { x: 0, z: 0 },
1311
+ * { x: 100, z: 0 },
1312
+ * { x: 100, z: 80 },
1313
+ * { x: 0, z: 80 },
1314
+ * ],
1315
+ * "ft",
1316
+ * [
1317
+ * { aboveHeight: 0, front: 10, side: 5, rear: 10 },
1318
+ * { aboveHeight: 100, front: 20, side: 10, rear: 20 },
1319
+ * ],
1320
+ * { kind: "max_height", maxHeight: 150 },
1321
+ * 12,
1322
+ * )
1323
+ * ```
1324
+ */
1325
+ public abstract buildableEnvelope(
1326
+ sitePolygon: PluginBuildableEnvelopePolygonVertex[],
1327
+ lengthUnit: "ft" | "m",
1328
+ setbacks: PluginBuildableEnvelopeSetbackTier[],
1329
+ verticalCap: PluginBuildableEnvelopeVerticalCap,
1330
+ floorToFloor: number,
1331
+ farRatio?: number,
1332
+ lotCoverageMaxPct?: number,
1333
+ ): PluginApiReturn<PluginBuildableEnvelopeCreateResult>
1334
+ }
1335
+
1336
+ // ---------------------------------------------------------------------------
1337
+ // Enums
1338
+ // ---------------------------------------------------------------------------
1339
+
1340
+ /**
1341
+ * Line style of a reference line (mirrors the engine `ReferenceLineMode` verbatim).
1342
+ *
1343
+ * | Value | Description |
1344
+ * |---|---|
1345
+ * | `"SOLID"` | Solid line (default) |
1346
+ * | `"DASHED"` | Dashed line |
1347
+ * | `"DOT_DASH"` | Dot-dash line |
1348
+ */
1349
+ export const PluginReferenceLineStyle = z.enum(["SOLID", "DASHED", "DOT_DASH"])
1350
+ export type PluginReferenceLineStyle = z.infer<typeof PluginReferenceLineStyle>
1351
+
1352
+ /**
1353
+ * Slab type (mirrors the engine `SLAB_TYPES` values verbatim).
1354
+ *
1355
+ * | Value | Description |
1356
+ * |---|---|
1357
+ * | `"Intermediate Slab"` | Intermediate floor slab (default) |
1358
+ * | `"Basement Slab"` | Basement slab |
1359
+ * | `"Plinth"` | Plinth slab |
1360
+ * | `"Roof"` | Roof slab |
1361
+ */
1362
+ export const PluginSlabType = z.enum([
1363
+ "Intermediate Slab",
1364
+ "Basement Slab",
1365
+ "Plinth",
1366
+ "Roof",
1367
+ ])
1368
+ export type PluginSlabType = z.infer<typeof PluginSlabType>
1369
+
1370
+ /**
1371
+ * A staircase preset — a base type or a named parametric preset. Mirrors the
1372
+ * engine `STAIRCASE_PRESETS` / `StaircaseType`. Use the value that matches the
1373
+ * shape you want (e.g. `"straight"`, `"dogLegged"`, `"lShaped"`).
1374
+ */
1375
+ export const PluginStaircasePreset = z.enum([
1376
+ "straight",
1377
+ "straightWoLanding",
1378
+ "straightFlightWoMidLanding",
1379
+ "dogLegged",
1380
+ "openWell",
1381
+ "lShaped",
1382
+ "3StepLShaped",
1383
+ "square",
1384
+ "singleStep",
1385
+ "plinthLevel",
1386
+ "amphitheatre",
1387
+ "connectingStepsToAmphitheatre",
1388
+ "mezzanineFloorStraight",
1389
+ "mezzanineFloorDogLegged",
1390
+ "mezzanineFloorLShaped",
1391
+ "custom",
1392
+ ])
1393
+ export type PluginStaircasePreset = z.infer<typeof PluginStaircasePreset>
1394
+
1395
+ /**
1396
+ * Optional staircase dimension overrides. Lengths use Snaptrude engine units
1397
+ * and must be positive. `angleInDegrees` controls placement about the vertical
1398
+ * axis and must be a multiple of 90 degrees.
1399
+ */
1400
+ export const PluginStaircaseDimensions = z
1401
+ .object({
1402
+ width: z.number().finite().positive().optional(),
1403
+ tread: z.number().finite().positive().optional(),
1404
+ riser: z.number().finite().positive().optional(),
1405
+ landingWidth: z.number().finite().positive().optional(),
1406
+ angleInDegrees: z.number().finite().multipleOf(90).optional(),
1407
+ })
1408
+ .strict()
1409
+ export type PluginStaircaseDimensions = z.infer<
1410
+ typeof PluginStaircaseDimensions
1411
+ >
1412
+
1413
+ // ---------------------------------------------------------------------------
1414
+ // space
1415
+ // ---------------------------------------------------------------------------
1416
+
1417
+ /**
1418
+ * Arguments for {@linkcode PluginDesignCreateApi.space}.
1419
+ *
1420
+ * | Property | Type | Description |
1421
+ * |---|---|---|
1422
+ * | `contour` | {@linkcode ContourHandle} | Bottom footprint (outer + holes) |
1423
+ * | `height` | `number` | Extrusion height (Snaptrude units, > 0) |
1424
+ * | `label` | `string`? | Room label (maps to the space's `room_type`) |
1425
+ * | `position` | {@linkcode Vec3Handle}? | Offset from origin (default origin) |
1426
+ * | `spaceType` | {@linkcode PluginSpaceType}? | Space-type classification (default `Room`) |
1427
+ * | `massType` | {@linkcode PluginMassType}? | Mass-type classification (default `Room`) |
1428
+ * | `departmentId` | {@linkcode PluginDepartmentId}? | Department assignment (default department) |
1429
+ * | `storey` | `number`? (int) | Target storey number (default active storey) |
1430
+ */
1431
+ export const PluginDesignCreateSpaceArgs = z.object({
1432
+ contour: ContourHandle,
1433
+ height: z.number(),
1434
+ label: z.string().optional(),
1435
+ position: Vec3Handle.optional(),
1436
+ spaceType: PluginSpaceType.optional(),
1437
+ massType: PluginMassType.optional(),
1438
+ departmentId: PluginDepartmentId.optional(),
1439
+ storey: z.number().int().optional(),
1440
+ })
1441
+ export type PluginDesignCreateSpaceArgs = z.infer<
1442
+ typeof PluginDesignCreateSpaceArgs
1443
+ >
1444
+ // TRANSPORT: positional signature shipped — storey is the trailing 8th arg:
1445
+ // space(contour, height, label?, position?, spaceType?, massType?, departmentId?, storey?)
1446
+
1447
+ // ---------------------------------------------------------------------------
1448
+ // mass
1449
+ // ---------------------------------------------------------------------------
1450
+
1451
+ /**
1452
+ * Arguments for {@linkcode PluginDesignCreateApi.mass}.
1453
+ *
1454
+ * | Property | Type | Description |
1455
+ * |---|---|---|
1456
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
1457
+ * | `height` | `number` | Extrusion height (> 0) |
1458
+ * | `label` | `string`? | Label (maps to `room_type`) |
1459
+ * | `position` | {@linkcode Vec3Handle}? | Offset from origin |
1460
+ * | `massType` | {@linkcode PluginMassType}? | Mass type (default `Generic mass`) |
1461
+ */
1462
+ export const PluginDesignCreateMassArgs = z.object({
1463
+ contour: ContourHandle,
1464
+ height: z.number(),
1465
+ label: z.string().optional(),
1466
+ position: Vec3Handle.optional(),
1467
+ massType: PluginMassType.optional(),
1468
+ })
1469
+ export type PluginDesignCreateMassArgs = z.infer<
1470
+ typeof PluginDesignCreateMassArgs
1471
+ >
1472
+
1473
+ // ---------------------------------------------------------------------------
1474
+ // massFromBrep
1475
+ // ---------------------------------------------------------------------------
1476
+
1477
+ /**
1478
+ * Arguments for {@linkcode PluginDesignCreateApi.massFromBrep}.
1479
+ *
1480
+ * | Property | Type | Description |
1481
+ * |---|---|---|
1482
+ * | `brep` | {@linkcode BrepHandle} | A solid from a `core.geom.create` brep constructor |
1483
+ * | `label` | `string`? | Label (maps to `room_type`) |
1484
+ */
1485
+ export const PluginDesignCreateMassFromBrepArgs = z.object({
1486
+ brep: BrepHandle,
1487
+ label: z.string().optional(),
1488
+ })
1489
+ export type PluginDesignCreateMassFromBrepArgs = z.infer<
1490
+ typeof PluginDesignCreateMassFromBrepArgs
1491
+ >
1492
+
1493
+ // ---------------------------------------------------------------------------
1494
+ // slab
1495
+ // ---------------------------------------------------------------------------
1496
+
1497
+ /**
1498
+ * Arguments for {@linkcode PluginDesignCreateApi.slab}.
1499
+ *
1500
+ * | Property | Type | Description |
1501
+ * |---|---|---|
1502
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
1503
+ * | `thickness` | `number` | Slab thickness (> 0) |
1504
+ * | `direction` | `"up" \| "down"`? | Extrusion direction (default `"down"`) |
1505
+ * | `slabType` | {@linkcode PluginSlabType}? | Slab-type classification |
1506
+ */
1507
+ export const PluginDesignCreateSlabArgs = z.object({
1508
+ contour: ContourHandle,
1509
+ thickness: z.number(),
1510
+ direction: z.enum(["up", "down"]).optional(),
1511
+ slabType: PluginSlabType.optional(),
1512
+ })
1513
+ export type PluginDesignCreateSlabArgs = z.infer<
1514
+ typeof PluginDesignCreateSlabArgs
1515
+ >
1516
+
1517
+ // ---------------------------------------------------------------------------
1518
+ // floor
1519
+ // ---------------------------------------------------------------------------
1520
+
1521
+ /**
1522
+ * Arguments for {@linkcode PluginDesignCreateApi.floor}.
1523
+ *
1524
+ * | Property | Type | Description |
1525
+ * |---|---|---|
1526
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
1527
+ * | `thickness` | `number` | Floor thickness (> 0) |
1528
+ * | `position` | {@linkcode Vec3Handle}? | Offset from origin |
1529
+ */
1530
+ export const PluginDesignCreateFloorArgs = z.object({
1531
+ contour: ContourHandle,
1532
+ thickness: z.number(),
1533
+ position: Vec3Handle.optional(),
1534
+ })
1535
+ export type PluginDesignCreateFloorArgs = z.infer<
1536
+ typeof PluginDesignCreateFloorArgs
1537
+ >
1538
+
1539
+ // ---------------------------------------------------------------------------
1540
+ // roof
1541
+ // ---------------------------------------------------------------------------
1542
+
1543
+ /**
1544
+ * Arguments for {@linkcode PluginDesignCreateApi.roof}.
1545
+ *
1546
+ * | Property | Type | Description |
1547
+ * |---|---|---|
1548
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
1549
+ * | `thickness` | `number` | Roof-slab thickness (> 0) |
1550
+ */
1551
+ export const PluginDesignCreateRoofArgs = z.object({
1552
+ contour: ContourHandle,
1553
+ thickness: z.number(),
1554
+ })
1555
+ export type PluginDesignCreateRoofArgs = z.infer<
1556
+ typeof PluginDesignCreateRoofArgs
1557
+ >
1558
+
1559
+ // ---------------------------------------------------------------------------
1560
+ // ceiling
1561
+ // ---------------------------------------------------------------------------
1562
+
1563
+ /**
1564
+ * Arguments for {@linkcode PluginDesignCreateApi.ceiling}.
1565
+ *
1566
+ * | Property | Type | Description |
1567
+ * |---|---|---|
1568
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer + holes) |
1569
+ * | `thickness` | `number` | Ceiling thickness (> 0) |
1570
+ * | `heightFromFloor` | `number`? | Lift above the floor (default 0) |
1571
+ */
1572
+ export const PluginDesignCreateCeilingArgs = z.object({
1573
+ contour: ContourHandle,
1574
+ thickness: z.number(),
1575
+ heightFromFloor: z.number().optional(),
1576
+ })
1577
+ export type PluginDesignCreateCeilingArgs = z.infer<
1578
+ typeof PluginDesignCreateCeilingArgs
1579
+ >
1580
+
1581
+ // ---------------------------------------------------------------------------
1582
+ // column
1583
+ // ---------------------------------------------------------------------------
1584
+
1585
+ /**
1586
+ * Arguments for {@linkcode PluginDesignCreateApi.column}.
1587
+ *
1588
+ * | Property | Type | Description |
1589
+ * |---|---|---|
1590
+ * | `position` | {@linkcode Vec3Handle} | Base point |
1591
+ * | `crossSection` | {@linkcode ContourHandle} | Column cross-section footprint |
1592
+ * | `height` | `number` | Column height (> 0) |
1593
+ * | `directionUp` | {@linkcode Vec3Handle}? | Up axis (default world up) |
1594
+ */
1595
+ export const PluginDesignCreateColumnArgs = z.object({
1596
+ position: Vec3Handle,
1597
+ crossSection: ContourHandle,
1598
+ height: z.number(),
1599
+ directionUp: Vec3Handle.optional(),
1600
+ })
1601
+ export type PluginDesignCreateColumnArgs = z.infer<
1602
+ typeof PluginDesignCreateColumnArgs
1603
+ >
1604
+
1605
+ // ---------------------------------------------------------------------------
1606
+ // beam
1607
+ // ---------------------------------------------------------------------------
1608
+
1609
+ /**
1610
+ * Arguments for {@linkcode PluginDesignCreateApi.beam}.
1611
+ *
1612
+ * | Property | Type | Description |
1613
+ * |---|---|---|
1614
+ * | `section` | {@linkcode ContourHandle} | Beam cross-section footprint |
1615
+ * | `length` | `number` | Beam length along `direction` (> 0) |
1616
+ * | `direction` | {@linkcode Vec3Handle}? | Extrusion axis (default world up) |
1617
+ */
1618
+ export const PluginDesignCreateBeamArgs = z.object({
1619
+ section: ContourHandle,
1620
+ length: z.number(),
1621
+ direction: Vec3Handle.optional(),
1622
+ })
1623
+ export type PluginDesignCreateBeamArgs = z.infer<
1624
+ typeof PluginDesignCreateBeamArgs
1625
+ >
1626
+
1627
+ // ---------------------------------------------------------------------------
1628
+ // walls
1629
+ // ---------------------------------------------------------------------------
1630
+
1631
+ /**
1632
+ * Arguments for {@linkcode PluginDesignCreateApi.walls}.
1633
+ *
1634
+ * | Property | Type | Description |
1635
+ * |---|---|---|
1636
+ * | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (wall centerlines) |
1637
+ * | `height` | `number`? | Wall height (default engine default) |
1638
+ * | `thickness` | `number`? | Wall thickness (default: `wallType`'s total layer thickness when given, else engine default) |
1639
+ * | `wallType` | `string`? | Wall type name from `design.types.list("wall")` — layers/material/thickness defaults (default generic) |
1640
+ * | `storey` | `number`? | Target storey (integer, must exist) — walls assigned + lifted to its base in the same undo entry (default: geometry-derived) |
1641
+ */
1642
+ export const PluginDesignCreateWallsArgs = z.object({
1643
+ profile: ProfileHandle,
1644
+ height: z.number().optional(),
1645
+ thickness: z.number().optional(),
1646
+ wallType: z.string().min(1).optional(),
1647
+ storey: z.number().int().optional(),
1648
+ })
1649
+ export type PluginDesignCreateWallsArgs = z.infer<
1650
+ typeof PluginDesignCreateWallsArgs
1651
+ >
1652
+ // TRANSPORT: positional signature shipped — storey is the trailing 5th arg:
1653
+ // walls(profile: ProfileHandle, height?: number, thickness?: number, wallType?: string, storey?: number)
1654
+
1655
+ // ---------------------------------------------------------------------------
1656
+ // staircase
1657
+ // ---------------------------------------------------------------------------
1658
+
1659
+ /**
1660
+ * Arguments for {@linkcode PluginDesignCreateApi.staircase}.
1661
+ *
1662
+ * | Property | Type | Description |
1663
+ * |---|---|---|
1664
+ * | `preset` | {@linkcode PluginStaircasePreset} | The parametric preset to generate |
1665
+ * | `position` | {@linkcode Vec3Handle} | Placement point |
1666
+ * | `label` | `string`? | Optional label |
1667
+ * | `structureId` | `string`? | Target structure (default active) |
1668
+ * | `level` | `string`? | Target level name (default active/`"01"`) |
1669
+ * | `dimensions` | {@linkcode PluginStaircaseDimensions}? | Positive dimension overrides in engine units, applied before creation |
1670
+ */
1671
+ export const PluginDesignCreateStaircaseArgs = z.object({
1672
+ preset: PluginStaircasePreset,
1673
+ position: Vec3Handle,
1674
+ label: z.string().optional(),
1675
+ structureId: z.string().optional(),
1676
+ level: z.string().optional(),
1677
+ dimensions: PluginStaircaseDimensions.optional(),
1678
+ })
1679
+ export type PluginDesignCreateStaircaseArgs = z.infer<
1680
+ typeof PluginDesignCreateStaircaseArgs
1681
+ >
1682
+
1683
+ // ---------------------------------------------------------------------------
1684
+ // furniture
1685
+ // ---------------------------------------------------------------------------
1686
+
1687
+ /**
1688
+ * Arguments for {@linkcode PluginDesignCreateApi.furniture}.
1689
+ *
1690
+ * | Property | Type | Description |
1691
+ * |---|---|---|
1692
+ * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
1693
+ * | `position` | {@linkcode Vec3Handle} | Absolute world placement point |
1694
+ * | `label` | `string`? | Instance name (default auto `${name}Ins${n}`) |
1695
+ * | `createNewSourceMesh` | `boolean`? | Legacy, kept for compatibility; the host records a catalog source exactly once and this flag cannot skip it |
1696
+ * | `angleInDegrees` | `number`? | Rotation about the vertical axis, in degrees (default unrotated) |
1697
+ */
1698
+ export const PluginDesignCreateFurnitureArgs = z.object({
1699
+ catalogId: z.string().min(1),
1700
+ position: Vec3Handle,
1701
+ label: z.string().optional(),
1702
+ createNewSourceMesh: z.boolean().optional(),
1703
+ angleInDegrees: z.number().optional(),
1704
+ })
1705
+ export type PluginDesignCreateFurnitureArgs = z.infer<
1706
+ typeof PluginDesignCreateFurnitureArgs
1707
+ >
1708
+ // TRANSPORT: positional signature shipped — angleInDegrees is the trailing 4th arg:
1709
+ // furniture(catalogId: string, position: Vec3Handle, options?: { label?, createNewSourceMesh? }, angleInDegrees?: number)
1710
+
1711
+ // ---------------------------------------------------------------------------
1712
+ // door
1713
+ // ---------------------------------------------------------------------------
1714
+
1715
+ /**
1716
+ * Arguments for {@linkcode PluginDesignCreateApi.door}.
1717
+ *
1718
+ * | Property | Type | Description |
1719
+ * |---|---|---|
1720
+ * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
1721
+ * | `hostWall` | {@linkcode ComponentHandle} | The wall to host the door |
1722
+ * | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
1723
+ * | `label` | `string`? | Instance name (optional) |
1724
+ * | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the door swings open to (default engine-chosen) |
1725
+ * | `hinge` | {@linkcode Vec3Handle}? | World point near the jamb the door is hinged on (default the catalog item's authored side) |
1726
+ */
1727
+ export const PluginDesignCreateDoorArgs = z.object({
1728
+ catalogId: z.string().min(1),
1729
+ hostWall: ComponentHandle,
1730
+ position: Vec3Handle,
1731
+ label: z.string().optional(),
1732
+ facing: Vec3Handle.optional(),
1733
+ hinge: Vec3Handle.optional(),
1734
+ })
1735
+ export type PluginDesignCreateDoorArgs = z.infer<
1736
+ typeof PluginDesignCreateDoorArgs
1737
+ >
1738
+ // TRANSPORT: positional signature shipped — facing is the trailing 5th arg, hinge rides in options:
1739
+ // door(catalogId: string, hostWall: ComponentHandle, position: Vec3Handle, options?: { label?, hinge? }, facing?: Vec3Handle)
1740
+
1741
+ // ---------------------------------------------------------------------------
1742
+ // window
1743
+ // ---------------------------------------------------------------------------
1744
+
1745
+ /**
1746
+ * Arguments for {@linkcode PluginDesignCreateApi.window}.
1747
+ *
1748
+ * | Property | Type | Description |
1749
+ * |---|---|---|
1750
+ * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
1751
+ * | `hostWall` | {@linkcode ComponentHandle} | The wall to host the window |
1752
+ * | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
1753
+ * | `label` | `string`? | Instance name (optional) |
1754
+ * | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the window opens to (default engine-chosen) |
1755
+ * | `hinge` | {@linkcode Vec3Handle}? | World point near the jamb the window is hinged on (default the catalog item's authored side) |
1756
+ */
1757
+ export const PluginDesignCreateWindowArgs = z.object({
1758
+ catalogId: z.string().min(1),
1759
+ hostWall: ComponentHandle,
1760
+ position: Vec3Handle,
1761
+ label: z.string().optional(),
1762
+ facing: Vec3Handle.optional(),
1763
+ hinge: Vec3Handle.optional(),
1764
+ })
1765
+ export type PluginDesignCreateWindowArgs = z.infer<
1766
+ typeof PluginDesignCreateWindowArgs
1767
+ >
1768
+ // TRANSPORT: positional signature shipped — facing is the trailing 5th arg, hinge rides in options:
1769
+ // window(catalogId: string, hostWall: ComponentHandle, position: Vec3Handle, options?: { label?, hinge? }, facing?: Vec3Handle)
1770
+
1771
+ // ---------------------------------------------------------------------------
1772
+ // opening
1773
+ // ---------------------------------------------------------------------------
1774
+
1775
+ /**
1776
+ * Options for {@linkcode PluginDesignCreateApi.opening}, discriminated by
1777
+ * `kind`. Width and height are positive Snaptrude engine-unit values.
1778
+ * `sillHeight` is available only for windows, is nonnegative, and is precisely
1779
+ * the distance from the host wall base to the bottom of the window.
1780
+ */
1781
+ export const PluginDesignCreateOpeningOptions = z.discriminatedUnion("kind", [
1782
+ z
1783
+ .object({
1784
+ kind: z.literal("door"),
1785
+ ...PluginOpeningBaseOptions,
1786
+ })
1787
+ .strict(),
1788
+ z
1789
+ .object({
1790
+ kind: z.literal("window"),
1791
+ ...PluginOpeningBaseOptions,
1792
+ sillHeight: z.number().finite().nonnegative().optional(),
1793
+ })
1794
+ .strict(),
1795
+ ])
1796
+ export type PluginDesignCreateOpeningOptions = z.infer<
1797
+ typeof PluginDesignCreateOpeningOptions
1798
+ >
1799
+
1800
+ // ---------------------------------------------------------------------------
1801
+ // smartLayout
1802
+ // ---------------------------------------------------------------------------
1803
+
1804
+ /**
1805
+ * Arguments for {@linkcode PluginDesignCreateApi.smartLayout}. Provide **exactly
1806
+ * one** template source: `templateGroup` or a non-empty `templateComponents`.
1807
+ *
1808
+ * | Property | Type | Description |
1809
+ * |---|---|---|
1810
+ * | `templateGroup` | `string`? | Id of the group to clone as the template (a group id from `snaptrude.core.groups.list`, NOT a component handle) |
1811
+ * | `templateComponents` | {@linkcode ComponentHandle}`[]`? | Explicit component set to clone as the template |
1812
+ * | `targets` | {@linkcode ComponentHandle}`[]` | ROOM/DEPARTMENT spaces to place into (≥1) |
1813
+ * | `hideTargets` | `boolean`? | Hide the target spaces after placement (default `true`) |
1814
+ */
1815
+ export const PluginSmartLayoutArgs = z
1816
+ .object({
1817
+ templateGroup: z.string().min(1).optional(),
1818
+ templateComponents: z.array(ComponentHandle).optional(),
1819
+ targets: z.array(ComponentHandle).min(1),
1820
+ hideTargets: z.boolean().optional(),
1821
+ })
1822
+ .refine(
1823
+ (v) =>
1824
+ (v.templateGroup != null) !== (v.templateComponents?.length ?? 0) > 0,
1825
+ {
1826
+ message:
1827
+ "Provide exactly one template source: templateGroup or a non-empty templateComponents",
1828
+ },
1829
+ )
1830
+ export type PluginSmartLayoutArgs = z.infer<typeof PluginSmartLayoutArgs>
1831
+
1832
+ /**
1833
+ * Result of {@linkcode PluginDesignCreateApi.smartLayout} — the entities the run
1834
+ * created, grouped by kind (flat across all targets; see the method JSDoc for why
1835
+ * this is not attributed per target).
1836
+ *
1837
+ * | Property | Type | Description |
1838
+ * |---|---|---|
1839
+ * | `created.walls` | {@linkcode ComponentHandle}`[]` | Created walls |
1840
+ * | `created.furniture` | {@linkcode ComponentHandle}`[]` | Created furniture |
1841
+ * | `created.doors` | {@linkcode ComponentHandle}`[]` | Created doors |
1842
+ * | `created.windows` | {@linkcode ComponentHandle}`[]` | Created windows |
1843
+ * | `created.floors` | {@linkcode ComponentHandle}`[]` | Created floors |
1844
+ * | `skippedWalls` | `number` | Walls the interior optimizer could not place |
1845
+ */
1846
+ export const PluginSmartLayoutResult = z.object({
1847
+ created: z.object({
1848
+ walls: z.array(ComponentHandle),
1849
+ furniture: z.array(ComponentHandle),
1850
+ doors: z.array(ComponentHandle),
1851
+ windows: z.array(ComponentHandle),
1852
+ floors: z.array(ComponentHandle),
1853
+ }),
1854
+ skippedWalls: z.number(),
1855
+ })
1856
+ export type PluginSmartLayoutResult = z.infer<typeof PluginSmartLayoutResult>
1857
+
1858
+ // ---------------------------------------------------------------------------
1859
+ // referenceLines
1860
+ // ---------------------------------------------------------------------------
1861
+
1862
+ /**
1863
+ * Arguments for {@linkcode PluginDesignCreateApi.referenceLines}.
1864
+ *
1865
+ * | Property | Type | Description |
1866
+ * |---|---|---|
1867
+ * | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (centerlines) |
1868
+ * | `color` | `string`? | Hex color `"#RRGGBB"` (default white) |
1869
+ * | `thickness` | `number`? | Line thickness (default 1) |
1870
+ * | `style` | {@linkcode PluginReferenceLineStyle}? | Line style (default `SOLID`) |
1871
+ * | `gridTag` | `string`? | Grid tag label (default `"A"`) |
1872
+ */
1873
+ export const PluginDesignCreateReferenceLinesArgs = z.object({
1874
+ profile: ProfileHandle,
1875
+ color: z.string().optional(),
1876
+ thickness: z.number().optional(),
1877
+ style: PluginReferenceLineStyle.optional(),
1878
+ gridTag: z.string().optional(),
1879
+ })
1880
+ export type PluginDesignCreateReferenceLinesArgs = z.infer<
1881
+ typeof PluginDesignCreateReferenceLinesArgs
1882
+ >
1883
+
1884
+ // ---------------------------------------------------------------------------
1885
+ // copy
1886
+ // ---------------------------------------------------------------------------
1887
+
1888
+ /**
1889
+ * Copy mode for {@linkcode PluginDesignCreateApi.copy}.
1890
+ *
1891
+ * | Value | Description |
1892
+ * |---|---|
1893
+ * | `"instance"` | Keep copies in the source's instance family where possible |
1894
+ * | `"unique"` | Independent geometry copies |
1895
+ */
1896
+ export const PluginCopyMode = z.enum(["instance", "unique"])
1897
+ export type PluginCopyMode = z.infer<typeof PluginCopyMode>
1898
+
1899
+ /**
1900
+ * Arguments for {@linkcode PluginDesignCreateApi.copy} (options flattened).
1901
+ *
1902
+ * | Property | Type | Description |
1903
+ * |---|---|---|
1904
+ * | `components` | {@linkcode ComponentHandle}`[]` | Entities to copy (≥1) |
1905
+ * | `displacement` | {@linkcode Vec3Handle} | Per-copy offset (copy `i` at `displacement * i`) |
1906
+ * | `count` | `number`? | Copies per component (default 1) |
1907
+ * | `mode` | {@linkcode PluginCopyMode}? | `"instance"` (default) or `"unique"` |
1908
+ */
1909
+ export const PluginDesignCreateCopyArgs = z.object({
1910
+ components: z.array(ComponentHandle).min(1),
1911
+ displacement: Vec3Handle,
1912
+ count: z.number().int().positive().optional(),
1913
+ mode: PluginCopyMode.optional(),
1914
+ })
1915
+ export type PluginDesignCreateCopyArgs = z.infer<
1916
+ typeof PluginDesignCreateCopyArgs
1917
+ >
1918
+ // TRANSPORT: positional signature shipped —
1919
+ // copy(components: ComponentHandle[], displacement: Vec3Handle, options?: { count?, mode? })
1920
+
1921
+ // ---------------------------------------------------------------------------
1922
+ // spaces (bulk)
1923
+ // ---------------------------------------------------------------------------
1924
+
1925
+ /**
1926
+ * One space to create via {@linkcode PluginDesignCreateApi.spaces} — the same
1927
+ * footprint-extrude inputs as {@linkcode PluginDesignCreateApi.space}.
1928
+ *
1929
+ * | Property | Type | Description |
1930
+ * |---|---|---|
1931
+ * | `contour` | {@linkcode ContourHandle} | Footprint (outer profile + holes) |
1932
+ * | `height` | `number` | Extrude height |
1933
+ * | `label` | `string`? | Room label |
1934
+ * | `position` | {@linkcode Vec3Handle}? | Placement offset |
1935
+ * | `spaceType` | `PluginSpaceType`? | Space type |
1936
+ * | `massType` | `PluginMassType`? | Mass type |
1937
+ * | `departmentId` | `PluginDepartmentId`? | Department |
1938
+ * | `storey` | `number`? (int) | Target storey number (default active storey) |
1939
+ */
1940
+ export const PluginCreateSpaceItem = z.object({
1941
+ contour: ContourHandle,
1942
+ height: z.number(),
1943
+ label: z.string().optional(),
1944
+ position: Vec3Handle.optional(),
1945
+ spaceType: PluginSpaceType.optional(),
1946
+ massType: PluginMassType.optional(),
1947
+ departmentId: PluginDepartmentId.optional(),
1948
+ storey: z.number().int().optional(),
1949
+ })
1950
+ export type PluginCreateSpaceItem = z.infer<typeof PluginCreateSpaceItem>
1951
+
1952
+ export * from "./opening-fields"
1953
+ export * from "./bulk-items"
1954
+ export * from "./grids"