@ifc-lite/create 3.2.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. package/README.md +43 -0
  2. package/dist/in-store/align-boxes.d.ts +38 -0
  3. package/dist/in-store/align-boxes.d.ts.map +1 -0
  4. package/dist/in-store/align-boxes.js +97 -0
  5. package/dist/in-store/align-boxes.js.map +1 -0
  6. package/dist/in-store/anchor.d.ts.map +1 -1
  7. package/dist/in-store/anchor.js +13 -2
  8. package/dist/in-store/anchor.js.map +1 -1
  9. package/dist/in-store/auto-space-detect.d.ts +1 -1
  10. package/dist/in-store/auto-space-detect.js +1 -1
  11. package/dist/in-store/beam.d.ts +10 -1
  12. package/dist/in-store/beam.d.ts.map +1 -1
  13. package/dist/in-store/beam.js +17 -35
  14. package/dist/in-store/beam.js.map +1 -1
  15. package/dist/in-store/column.d.ts +10 -1
  16. package/dist/in-store/column.d.ts.map +1 -1
  17. package/dist/in-store/column.js +23 -22
  18. package/dist/in-store/column.js.map +1 -1
  19. package/dist/in-store/copy-array.d.ts +17 -0
  20. package/dist/in-store/copy-array.d.ts.map +1 -0
  21. package/dist/in-store/copy-array.js +47 -0
  22. package/dist/in-store/copy-array.js.map +1 -0
  23. package/dist/in-store/copy-batch.d.ts +27 -0
  24. package/dist/in-store/copy-batch.d.ts.map +1 -0
  25. package/dist/in-store/copy-batch.js +101 -0
  26. package/dist/in-store/copy-batch.js.map +1 -0
  27. package/dist/in-store/copy-dependent-walk.d.ts +27 -0
  28. package/dist/in-store/copy-dependent-walk.d.ts.map +1 -0
  29. package/dist/in-store/copy-dependent-walk.js +61 -0
  30. package/dist/in-store/copy-dependent-walk.js.map +1 -0
  31. package/dist/in-store/copy-frame.d.ts +53 -0
  32. package/dist/in-store/copy-frame.d.ts.map +1 -0
  33. package/dist/in-store/copy-frame.js +112 -0
  34. package/dist/in-store/copy-frame.js.map +1 -0
  35. package/dist/in-store/copy-product.d.ts +76 -0
  36. package/dist/in-store/copy-product.d.ts.map +1 -0
  37. package/dist/in-store/copy-product.js +318 -0
  38. package/dist/in-store/copy-product.js.map +1 -0
  39. package/dist/in-store/curtain-wall.d.ts +87 -0
  40. package/dist/in-store/curtain-wall.d.ts.map +1 -0
  41. package/dist/in-store/curtain-wall.js +237 -0
  42. package/dist/in-store/curtain-wall.js.map +1 -0
  43. package/dist/in-store/edit/effective-mutation-view.d.ts +6 -0
  44. package/dist/in-store/edit/effective-mutation-view.d.ts.map +1 -0
  45. package/dist/in-store/edit/effective-mutation-view.js +45 -0
  46. package/dist/in-store/edit/effective-mutation-view.js.map +1 -0
  47. package/dist/in-store/edit/effective-storey.d.ts +13 -0
  48. package/dist/in-store/edit/effective-storey.d.ts.map +1 -0
  49. package/dist/in-store/edit/effective-storey.js +36 -0
  50. package/dist/in-store/edit/effective-storey.js.map +1 -0
  51. package/dist/in-store/edit/effective-storeys.d.ts +9 -0
  52. package/dist/in-store/edit/effective-storeys.d.ts.map +1 -0
  53. package/dist/in-store/edit/effective-storeys.js +16 -0
  54. package/dist/in-store/edit/effective-storeys.js.map +1 -0
  55. package/dist/in-store/edit/hosted-opening-refit.d.ts +29 -0
  56. package/dist/in-store/edit/hosted-opening-refit.d.ts.map +1 -0
  57. package/dist/in-store/edit/hosted-opening-refit.js +168 -0
  58. package/dist/in-store/edit/hosted-opening-refit.js.map +1 -0
  59. package/dist/in-store/edit/length-unit-scale.d.ts +24 -0
  60. package/dist/in-store/edit/length-unit-scale.d.ts.map +1 -0
  61. package/dist/in-store/edit/length-unit-scale.js +37 -0
  62. package/dist/in-store/edit/length-unit-scale.js.map +1 -0
  63. package/dist/in-store/edit/linear-element-edit.d.ts +131 -0
  64. package/dist/in-store/edit/linear-element-edit.d.ts.map +1 -0
  65. package/dist/in-store/edit/linear-element-edit.js +259 -0
  66. package/dist/in-store/edit/linear-element-edit.js.map +1 -0
  67. package/dist/in-store/edit/metadata-clone-effective.d.ts +5 -0
  68. package/dist/in-store/edit/metadata-clone-effective.d.ts.map +1 -0
  69. package/dist/in-store/edit/metadata-clone-effective.js +47 -0
  70. package/dist/in-store/edit/metadata-clone-effective.js.map +1 -0
  71. package/dist/in-store/edit/metadata-clone.d.ts +40 -0
  72. package/dist/in-store/edit/metadata-clone.d.ts.map +1 -0
  73. package/dist/in-store/edit/metadata-clone.js +107 -0
  74. package/dist/in-store/edit/metadata-clone.js.map +1 -0
  75. package/dist/in-store/edit/placement-core.d.ts +140 -0
  76. package/dist/in-store/edit/placement-core.d.ts.map +1 -0
  77. package/dist/in-store/edit/placement-core.js +317 -0
  78. package/dist/in-store/edit/placement-core.js.map +1 -0
  79. package/dist/in-store/edit/polygon-clip.d.ts +58 -0
  80. package/dist/in-store/edit/polygon-clip.d.ts.map +1 -0
  81. package/dist/in-store/edit/polygon-clip.js +153 -0
  82. package/dist/in-store/edit/polygon-clip.js.map +1 -0
  83. package/dist/in-store/edit/read-profile.d.ts +6 -0
  84. package/dist/in-store/edit/read-profile.d.ts.map +1 -0
  85. package/dist/in-store/edit/read-profile.js +95 -0
  86. package/dist/in-store/edit/read-profile.js.map +1 -0
  87. package/dist/in-store/edit/slab-edit-frame.d.ts +40 -0
  88. package/dist/in-store/edit/slab-edit-frame.d.ts.map +1 -0
  89. package/dist/in-store/edit/slab-edit-frame.js +146 -0
  90. package/dist/in-store/edit/slab-edit-frame.js.map +1 -0
  91. package/dist/in-store/edit/slab-edit.d.ts +112 -0
  92. package/dist/in-store/edit/slab-edit.d.ts.map +1 -0
  93. package/dist/in-store/edit/slab-edit.js +275 -0
  94. package/dist/in-store/edit/slab-edit.js.map +1 -0
  95. package/dist/in-store/edit/slab-opening-carry.d.ts +10 -0
  96. package/dist/in-store/edit/slab-opening-carry.d.ts.map +1 -0
  97. package/dist/in-store/edit/slab-opening-carry.js +65 -0
  98. package/dist/in-store/edit/slab-opening-carry.js.map +1 -0
  99. package/dist/in-store/edit/split-guid.d.ts +29 -0
  100. package/dist/in-store/edit/split-guid.d.ts.map +1 -0
  101. package/dist/in-store/edit/split-guid.js +64 -0
  102. package/dist/in-store/edit/split-guid.js.map +1 -0
  103. package/dist/in-store/edit/split-target.d.ts +90 -0
  104. package/dist/in-store/edit/split-target.d.ts.map +1 -0
  105. package/dist/in-store/edit/split-target.js +116 -0
  106. package/dist/in-store/edit/split-target.js.map +1 -0
  107. package/dist/in-store/edit/target.d.ts +8 -0
  108. package/dist/in-store/edit/target.d.ts.map +1 -0
  109. package/dist/in-store/edit/target.js +5 -0
  110. package/dist/in-store/edit/target.js.map +1 -0
  111. package/dist/in-store/edit/trim-extend-geometry.d.ts +99 -0
  112. package/dist/in-store/edit/trim-extend-geometry.d.ts.map +1 -0
  113. package/dist/in-store/edit/trim-extend-geometry.js +105 -0
  114. package/dist/in-store/edit/trim-extend-geometry.js.map +1 -0
  115. package/dist/in-store/edit/wall-axis-edit.d.ts +16 -0
  116. package/dist/in-store/edit/wall-axis-edit.d.ts.map +1 -0
  117. package/dist/in-store/edit/wall-axis-edit.js +40 -0
  118. package/dist/in-store/edit/wall-axis-edit.js.map +1 -0
  119. package/dist/in-store/edit/wall-edit.d.ts +157 -0
  120. package/dist/in-store/edit/wall-edit.d.ts.map +1 -0
  121. package/dist/in-store/edit/wall-edit.js +276 -0
  122. package/dist/in-store/edit/wall-edit.js.map +1 -0
  123. package/dist/in-store/edit/wall-hosted-cuts.d.ts +35 -0
  124. package/dist/in-store/edit/wall-hosted-cuts.d.ts.map +1 -0
  125. package/dist/in-store/edit/wall-hosted-cuts.js +27 -0
  126. package/dist/in-store/edit/wall-hosted-cuts.js.map +1 -0
  127. package/dist/in-store/edit/wall-opening-reassign.d.ts +18 -0
  128. package/dist/in-store/edit/wall-opening-reassign.d.ts.map +1 -0
  129. package/dist/in-store/edit/wall-opening-reassign.js +50 -0
  130. package/dist/in-store/edit/wall-opening-reassign.js.map +1 -0
  131. package/dist/in-store/element-align.d.ts +13 -0
  132. package/dist/in-store/element-align.d.ts.map +1 -0
  133. package/dist/in-store/element-align.js +90 -0
  134. package/dist/in-store/element-align.js.map +1 -0
  135. package/dist/in-store/element-replacement.d.ts +26 -0
  136. package/dist/in-store/element-replacement.d.ts.map +1 -0
  137. package/dist/in-store/element-replacement.js +68 -0
  138. package/dist/in-store/element-replacement.js.map +1 -0
  139. package/dist/in-store/element-size-edit.d.ts +40 -0
  140. package/dist/in-store/element-size-edit.d.ts.map +1 -0
  141. package/dist/in-store/element-size-edit.js +103 -0
  142. package/dist/in-store/element-size-edit.js.map +1 -0
  143. package/dist/in-store/element-split-axis.d.ts +6 -0
  144. package/dist/in-store/element-split-axis.d.ts.map +1 -0
  145. package/dist/in-store/element-split-axis.js +87 -0
  146. package/dist/in-store/element-split-axis.js.map +1 -0
  147. package/dist/in-store/element-split-joined.d.ts +13 -0
  148. package/dist/in-store/element-split-joined.d.ts.map +1 -0
  149. package/dist/in-store/element-split-joined.js +74 -0
  150. package/dist/in-store/element-split-joined.js.map +1 -0
  151. package/dist/in-store/element-split-placement.d.ts +19 -0
  152. package/dist/in-store/element-split-placement.d.ts.map +1 -0
  153. package/dist/in-store/element-split-placement.js +48 -0
  154. package/dist/in-store/element-split-placement.js.map +1 -0
  155. package/dist/in-store/element-split-slab.d.ts +19 -0
  156. package/dist/in-store/element-split-slab.d.ts.map +1 -0
  157. package/dist/in-store/element-split-slab.js +86 -0
  158. package/dist/in-store/element-split-slab.js.map +1 -0
  159. package/dist/in-store/element-split.d.ts +49 -0
  160. package/dist/in-store/element-split.d.ts.map +1 -0
  161. package/dist/in-store/element-split.js +52 -0
  162. package/dist/in-store/element-split.js.map +1 -0
  163. package/dist/in-store/element-transform-edit.d.ts +33 -0
  164. package/dist/in-store/element-transform-edit.d.ts.map +1 -0
  165. package/dist/in-store/element-transform-edit.js +97 -0
  166. package/dist/in-store/element-transform-edit.js.map +1 -0
  167. package/dist/in-store/element-transform-frames.d.ts +58 -0
  168. package/dist/in-store/element-transform-frames.d.ts.map +1 -0
  169. package/dist/in-store/element-transform-frames.js +110 -0
  170. package/dist/in-store/element-transform-frames.js.map +1 -0
  171. package/dist/in-store/element-transform-joins.d.ts +4 -0
  172. package/dist/in-store/element-transform-joins.d.ts.map +1 -0
  173. package/dist/in-store/element-transform-joins.js +62 -0
  174. package/dist/in-store/element-transform-joins.js.map +1 -0
  175. package/dist/in-store/element-transform-plan.d.ts +38 -0
  176. package/dist/in-store/element-transform-plan.d.ts.map +1 -0
  177. package/dist/in-store/element-transform-plan.js +115 -0
  178. package/dist/in-store/element-transform-plan.js.map +1 -0
  179. package/dist/in-store/element-trim-extend.d.ts +25 -0
  180. package/dist/in-store/element-trim-extend.d.ts.map +1 -0
  181. package/dist/in-store/element-trim-extend.js +97 -0
  182. package/dist/in-store/element-trim-extend.js.map +1 -0
  183. package/dist/in-store/extract-grids.d.ts +36 -0
  184. package/dist/in-store/extract-grids.d.ts.map +1 -0
  185. package/dist/in-store/extract-grids.js +220 -0
  186. package/dist/in-store/extract-grids.js.map +1 -0
  187. package/dist/in-store/extract-walls.d.ts +12 -23
  188. package/dist/in-store/extract-walls.d.ts.map +1 -1
  189. package/dist/in-store/extract-walls.js +6 -69
  190. package/dist/in-store/extract-walls.js.map +1 -1
  191. package/dist/in-store/generate-spaces.d.ts +1 -1
  192. package/dist/in-store/grid-column.d.ts +23 -0
  193. package/dist/in-store/grid-column.d.ts.map +1 -0
  194. package/dist/in-store/grid-column.js +73 -0
  195. package/dist/in-store/grid-column.js.map +1 -0
  196. package/dist/in-store/grid-intersection-read.d.ts +10 -0
  197. package/dist/in-store/grid-intersection-read.d.ts.map +1 -0
  198. package/dist/in-store/grid-intersection-read.js +45 -0
  199. package/dist/in-store/grid-intersection-read.js.map +1 -0
  200. package/dist/in-store/grid.d.ts +124 -0
  201. package/dist/in-store/grid.d.ts.map +1 -0
  202. package/dist/in-store/grid.js +204 -0
  203. package/dist/in-store/grid.js.map +1 -0
  204. package/dist/in-store/group-evidence.d.ts +49 -0
  205. package/dist/in-store/group-evidence.d.ts.map +1 -0
  206. package/dist/in-store/group-evidence.js +111 -0
  207. package/dist/in-store/group-evidence.js.map +1 -0
  208. package/dist/in-store/group-graph.d.ts +51 -0
  209. package/dist/in-store/group-graph.d.ts.map +1 -0
  210. package/dist/in-store/group-graph.js +213 -0
  211. package/dist/in-store/group-graph.js.map +1 -0
  212. package/dist/in-store/group.d.ts +34 -0
  213. package/dist/in-store/group.d.ts.map +1 -0
  214. package/dist/in-store/group.js +181 -0
  215. package/dist/in-store/group.js.map +1 -0
  216. package/dist/in-store/host-geometry-frame.d.ts +48 -0
  217. package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
  218. package/dist/in-store/host-geometry-frame.js +190 -0
  219. package/dist/in-store/host-geometry-frame.js.map +1 -0
  220. package/dist/in-store/hosted-element-edit.d.ts +29 -0
  221. package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
  222. package/dist/in-store/hosted-element-edit.js +120 -0
  223. package/dist/in-store/hosted-element-edit.js.map +1 -0
  224. package/dist/in-store/hosted-element.d.ts +41 -0
  225. package/dist/in-store/hosted-element.d.ts.map +1 -0
  226. package/dist/in-store/hosted-element.js +124 -0
  227. package/dist/in-store/hosted-element.js.map +1 -0
  228. package/dist/in-store/hosted-fill-read.d.ts +56 -0
  229. package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
  230. package/dist/in-store/hosted-fill-read.js +197 -0
  231. package/dist/in-store/hosted-fill-read.js.map +1 -0
  232. package/dist/in-store/hosted-global-id.d.ts +8 -0
  233. package/dist/in-store/hosted-global-id.d.ts.map +1 -0
  234. package/dist/in-store/hosted-global-id.js +53 -0
  235. package/dist/in-store/hosted-global-id.js.map +1 -0
  236. package/dist/in-store/hosted-placement-edit.d.ts +30 -0
  237. package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
  238. package/dist/in-store/hosted-placement-edit.js +123 -0
  239. package/dist/in-store/hosted-placement-edit.js.map +1 -0
  240. package/dist/in-store/hosted-scale-chain.d.ts +12 -0
  241. package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
  242. package/dist/in-store/hosted-scale-chain.js +74 -0
  243. package/dist/in-store/hosted-scale-chain.js.map +1 -0
  244. package/dist/in-store/hosted-shape-edit.d.ts +9 -0
  245. package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
  246. package/dist/in-store/hosted-shape-edit.js +79 -0
  247. package/dist/in-store/hosted-shape-edit.js.map +1 -0
  248. package/dist/in-store/index.d.ts +66 -0
  249. package/dist/in-store/index.d.ts.map +1 -0
  250. package/dist/in-store/index.js +71 -0
  251. package/dist/in-store/index.js.map +1 -0
  252. package/dist/in-store/linear-profile-frame.d.ts +10 -0
  253. package/dist/in-store/linear-profile-frame.d.ts.map +1 -0
  254. package/dist/in-store/linear-profile-frame.js +17 -0
  255. package/dist/in-store/linear-profile-frame.js.map +1 -0
  256. package/dist/in-store/material.d.ts.map +1 -1
  257. package/dist/in-store/material.js +17 -6
  258. package/dist/in-store/material.js.map +1 -1
  259. package/dist/in-store/member.d.ts +8 -2
  260. package/dist/in-store/member.d.ts.map +1 -1
  261. package/dist/in-store/member.js +15 -21
  262. package/dist/in-store/member.js.map +1 -1
  263. package/dist/in-store/ordinary-element.d.ts +47 -0
  264. package/dist/in-store/ordinary-element.d.ts.map +1 -0
  265. package/dist/in-store/ordinary-element.js +38 -0
  266. package/dist/in-store/ordinary-element.js.map +1 -0
  267. package/dist/in-store/placement-frame.d.ts +15 -5
  268. package/dist/in-store/placement-frame.d.ts.map +1 -1
  269. package/dist/in-store/placement-frame.js +25 -36
  270. package/dist/in-store/placement-frame.js.map +1 -1
  271. package/dist/in-store/profile.d.ts +141 -0
  272. package/dist/in-store/profile.d.ts.map +1 -0
  273. package/dist/in-store/profile.js +174 -0
  274. package/dist/in-store/profile.js.map +1 -0
  275. package/dist/in-store/railing.d.ts +65 -0
  276. package/dist/in-store/railing.d.ts.map +1 -0
  277. package/dist/in-store/railing.js +112 -0
  278. package/dist/in-store/railing.js.map +1 -0
  279. package/dist/in-store/rel-connects-path.d.ts +43 -0
  280. package/dist/in-store/rel-connects-path.d.ts.map +1 -0
  281. package/dist/in-store/rel-connects-path.js +65 -0
  282. package/dist/in-store/rel-connects-path.js.map +1 -0
  283. package/dist/in-store/resolve-anchor.d.ts +3 -2
  284. package/dist/in-store/resolve-anchor.d.ts.map +1 -1
  285. package/dist/in-store/resolve-anchor.js +7 -5
  286. package/dist/in-store/resolve-anchor.js.map +1 -1
  287. package/dist/in-store/resolve-host.d.ts +12 -1
  288. package/dist/in-store/resolve-host.d.ts.map +1 -1
  289. package/dist/in-store/resolve-host.js +169 -85
  290. package/dist/in-store/resolve-host.js.map +1 -1
  291. package/dist/in-store/resolve-relations.d.ts +3 -1
  292. package/dist/in-store/resolve-relations.d.ts.map +1 -1
  293. package/dist/in-store/resolve-relations.js +8 -3
  294. package/dist/in-store/resolve-relations.js.map +1 -1
  295. package/dist/in-store/resolve-source.d.ts.map +1 -1
  296. package/dist/in-store/resolve-source.js +39 -59
  297. package/dist/in-store/resolve-source.js.map +1 -1
  298. package/dist/in-store/room-candidates.d.ts +58 -0
  299. package/dist/in-store/room-candidates.d.ts.map +1 -0
  300. package/dist/in-store/room-candidates.js +135 -0
  301. package/dist/in-store/room-candidates.js.map +1 -0
  302. package/dist/in-store/room-creation-plan.d.ts +16 -0
  303. package/dist/in-store/room-creation-plan.d.ts.map +1 -0
  304. package/dist/in-store/room-creation-plan.js +28 -0
  305. package/dist/in-store/room-creation-plan.js.map +1 -0
  306. package/dist/in-store/room-floor-height.d.ts +24 -0
  307. package/dist/in-store/room-floor-height.d.ts.map +1 -0
  308. package/dist/in-store/room-floor-height.js +32 -0
  309. package/dist/in-store/room-floor-height.js.map +1 -0
  310. package/dist/in-store/room-footprint-native.d.ts +19 -0
  311. package/dist/in-store/room-footprint-native.d.ts.map +1 -0
  312. package/dist/in-store/room-footprint-native.js +117 -0
  313. package/dist/in-store/room-footprint-native.js.map +1 -0
  314. package/dist/in-store/room-layout-cache.d.ts +23 -0
  315. package/dist/in-store/room-layout-cache.d.ts.map +1 -0
  316. package/dist/in-store/room-layout-cache.js +84 -0
  317. package/dist/in-store/room-layout-cache.js.map +1 -0
  318. package/dist/in-store/room-layout-core.d.ts +68 -0
  319. package/dist/in-store/room-layout-core.d.ts.map +1 -0
  320. package/dist/in-store/room-layout-core.js +153 -0
  321. package/dist/in-store/room-layout-core.js.map +1 -0
  322. package/dist/in-store/room-population.d.ts +5 -0
  323. package/dist/in-store/room-population.d.ts.map +1 -0
  324. package/dist/in-store/room-population.js +28 -0
  325. package/dist/in-store/room-population.js.map +1 -0
  326. package/dist/in-store/room-space-meshes.d.ts +15 -0
  327. package/dist/in-store/room-space-meshes.d.ts.map +1 -0
  328. package/dist/in-store/room-space-meshes.js +38 -0
  329. package/dist/in-store/room-space-meshes.js.map +1 -0
  330. package/dist/in-store/room-store.d.ts +55 -0
  331. package/dist/in-store/room-store.d.ts.map +1 -0
  332. package/dist/in-store/room-store.js +173 -0
  333. package/dist/in-store/room-store.js.map +1 -0
  334. package/dist/in-store/room-storey-elevation.d.ts +5 -0
  335. package/dist/in-store/room-storey-elevation.d.ts.map +1 -0
  336. package/dist/in-store/room-storey-elevation.js +42 -0
  337. package/dist/in-store/room-storey-elevation.js.map +1 -0
  338. package/dist/in-store/room-storey-frame.d.ts +47 -0
  339. package/dist/in-store/room-storey-frame.d.ts.map +1 -0
  340. package/dist/in-store/room-storey-frame.js +48 -0
  341. package/dist/in-store/room-storey-frame.js.map +1 -0
  342. package/dist/in-store/room-wall-rects.d.ts +117 -0
  343. package/dist/in-store/room-wall-rects.d.ts.map +1 -0
  344. package/dist/in-store/room-wall-rects.js +157 -0
  345. package/dist/in-store/room-wall-rects.js.map +1 -0
  346. package/dist/in-store/schema-attributes.d.ts +8 -3
  347. package/dist/in-store/schema-attributes.d.ts.map +1 -1
  348. package/dist/in-store/schema-attributes.js +18 -9
  349. package/dist/in-store/schema-attributes.js.map +1 -1
  350. package/dist/in-store/slab.d.ts.map +1 -1
  351. package/dist/in-store/slab.js +1 -4
  352. package/dist/in-store/slab.js.map +1 -1
  353. package/dist/in-store/space-footprints.d.ts +55 -0
  354. package/dist/in-store/space-footprints.d.ts.map +1 -0
  355. package/dist/in-store/space-footprints.js +260 -0
  356. package/dist/in-store/space-footprints.js.map +1 -0
  357. package/dist/in-store/space.d.ts.map +1 -1
  358. package/dist/in-store/space.js +15 -3
  359. package/dist/in-store/space.js.map +1 -1
  360. package/dist/in-store/spatial-children.d.ts +1 -1
  361. package/dist/in-store/spatial-children.js +1 -1
  362. package/dist/in-store/stair-edit.d.ts +24 -0
  363. package/dist/in-store/stair-edit.d.ts.map +1 -0
  364. package/dist/in-store/stair-edit.js +190 -0
  365. package/dist/in-store/stair-edit.js.map +1 -0
  366. package/dist/in-store/stair-removal.d.ts +17 -0
  367. package/dist/in-store/stair-removal.d.ts.map +1 -0
  368. package/dist/in-store/stair-removal.js +134 -0
  369. package/dist/in-store/stair-removal.js.map +1 -0
  370. package/dist/in-store/stair.d.ts +58 -0
  371. package/dist/in-store/stair.d.ts.map +1 -0
  372. package/dist/in-store/stair.js +156 -0
  373. package/dist/in-store/stair.js.map +1 -0
  374. package/dist/in-store/storey-plan-frame.d.ts +2 -1
  375. package/dist/in-store/storey-plan-frame.d.ts.map +1 -1
  376. package/dist/in-store/storey-plan-frame.js +20 -11
  377. package/dist/in-store/storey-plan-frame.js.map +1 -1
  378. package/dist/in-store/storey-reassignment-plan.d.ts +53 -0
  379. package/dist/in-store/storey-reassignment-plan.d.ts.map +1 -0
  380. package/dist/in-store/storey-reassignment-plan.js +237 -0
  381. package/dist/in-store/storey-reassignment-plan.js.map +1 -0
  382. package/dist/in-store/storey-reassignment.d.ts +8 -0
  383. package/dist/in-store/storey-reassignment.d.ts.map +1 -0
  384. package/dist/in-store/storey-reassignment.js +52 -0
  385. package/dist/in-store/storey-reassignment.js.map +1 -0
  386. package/dist/in-store/trim-extend-plan.d.ts +27 -0
  387. package/dist/in-store/trim-extend-plan.d.ts.map +1 -0
  388. package/dist/in-store/trim-extend-plan.js +49 -0
  389. package/dist/in-store/trim-extend-plan.js.map +1 -0
  390. package/dist/in-store/wall-join-apply.d.ts +74 -0
  391. package/dist/in-store/wall-join-apply.d.ts.map +1 -0
  392. package/dist/in-store/wall-join-apply.js +137 -0
  393. package/dist/in-store/wall-join-apply.js.map +1 -0
  394. package/dist/in-store/wall-join-edit.d.ts +53 -0
  395. package/dist/in-store/wall-join-edit.d.ts.map +1 -0
  396. package/dist/in-store/wall-join-edit.js +251 -0
  397. package/dist/in-store/wall-join-edit.js.map +1 -0
  398. package/dist/in-store/wall-join-read.d.ts +60 -0
  399. package/dist/in-store/wall-join-read.d.ts.map +1 -0
  400. package/dist/in-store/wall-join-read.js +230 -0
  401. package/dist/in-store/wall-join-read.js.map +1 -0
  402. package/dist/in-store/wall-join.d.ts +122 -0
  403. package/dist/in-store/wall-join.d.ts.map +1 -0
  404. package/dist/in-store/wall-join.js +231 -0
  405. package/dist/in-store/wall-join.js.map +1 -0
  406. package/dist/in-store/wall-opening-fit.d.ts +11 -0
  407. package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
  408. package/dist/in-store/wall-opening-fit.js +27 -0
  409. package/dist/in-store/wall-opening-fit.js.map +1 -0
  410. package/dist/in-store/wall-section-edit.d.ts +16 -0
  411. package/dist/in-store/wall-section-edit.d.ts.map +1 -0
  412. package/dist/in-store/wall-section-edit.js +75 -0
  413. package/dist/in-store/wall-section-edit.js.map +1 -0
  414. package/dist/in-store/wall-size-edit.d.ts +29 -0
  415. package/dist/in-store/wall-size-edit.d.ts.map +1 -0
  416. package/dist/in-store/wall-size-edit.js +65 -0
  417. package/dist/in-store/wall-size-edit.js.map +1 -0
  418. package/dist/in-store/wall.d.ts +32 -0
  419. package/dist/in-store/wall.d.ts.map +1 -1
  420. package/dist/in-store/wall.js +77 -13
  421. package/dist/in-store/wall.js.map +1 -1
  422. package/dist/index.d.ts +25 -38
  423. package/dist/index.d.ts.map +1 -1
  424. package/dist/index.js +25 -40
  425. package/dist/index.js.map +1 -1
  426. package/package.json +9 -8
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Anchored builder for a design grid (#6232): an IfcGrid contained in the
3
+ * storey with tagged IfcGridAxis U and V axes (and optionally W), plus
4
+ * `gridIntersectionPlacement`, the IfcGridPlacement an element needs to sit
5
+ * on a grid intersection.
6
+ *
7
+ * Axes are straight lines given in the grid's own frame (metres, XY): the
8
+ * grid is placed on the storey at `Position`, turned by `Direction` about Z.
9
+ * Each axis curve is a two-point IfcPolyline, and the grid's 'FootPrint'
10
+ * representation is an IfcGeometricCurveSet of those same curves, so a viewer
11
+ * that reads either the axes or the representation draws the same lines.
12
+ * `rectangularGridAxes` makes the usual numbered / lettered orthogonal grid.
13
+ *
14
+ * Schema gating (D2): attributes are laid out from the anchor schema's
15
+ * registry. `IfcGrid.PredefinedType` exists from IFC4 on (dropped on IFC2X3);
16
+ * IFC4X3's IfcGridPlacement carries `PlacementRelTo` (the grid's placement),
17
+ * IFC2X3/IFC4 place it implicitly in the grid's frame; IFC2X3 orients a grid
18
+ * placement only by a second intersection, not a direction; IFC5 is refused.
19
+ */
20
+ import type { StoreEditor } from '@ifc-lite/mutations';
21
+ import type { IfcDataStore } from '@ifc-lite/parser';
22
+ import { type SpatialAnchor } from './anchor.js';
23
+ type Vec2 = [number, number];
24
+ export interface GridAxisInStoreParams {
25
+ /** The axis tag shown in its bubble ('1', 'A', ...). Unique within the grid. */
26
+ Tag: string;
27
+ /** Start of the axis line in the grid's frame (metres). */
28
+ Start: Vec2;
29
+ /** End of the axis line in the grid's frame (metres). */
30
+ End: Vec2;
31
+ }
32
+ export interface GridInStoreParams {
33
+ /** Grid origin, storey-local (metres). Default [0, 0, 0]. */
34
+ Position?: [number, number, number];
35
+ /** Rotation of the grid about Z, radians (0 = grid X along storey X). Default 0. */
36
+ Direction?: number;
37
+ /** At least one axis. */
38
+ UAxes: readonly GridAxisInStoreParams[];
39
+ /** At least one axis. */
40
+ VAxes: readonly GridAxisInStoreParams[];
41
+ /** Optional third family (triangular grids). */
42
+ WAxes?: readonly GridAxisInStoreParams[];
43
+ /** IfcGrid PredefinedType (IFC4+; dropped on IFC2X3). */
44
+ PredefinedType?: 'RECTANGULAR' | 'RADIAL' | 'TRIANGULAR' | 'IRREGULAR' | 'USERDEFINED' | 'NOTDEFINED';
45
+ Name?: string;
46
+ Description?: string;
47
+ ObjectType?: string;
48
+ /** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
49
+ GlobalId?: string;
50
+ }
51
+ export interface GridBuildResult {
52
+ gridId: number;
53
+ placementId: number;
54
+ /** IfcGridAxis ids, in `UAxes` order. */
55
+ uAxisIds: number[];
56
+ /** IfcGridAxis ids, in `VAxes` order. */
57
+ vAxisIds: number[];
58
+ /** IfcGridAxis ids, in `WAxes` order (empty without W axes). */
59
+ wAxisIds: number[];
60
+ shapeRepId: number;
61
+ productShapeId: number;
62
+ relContainedId: number;
63
+ }
64
+ /**
65
+ * U and V axes of an orthogonal grid, in the grid's frame (metres): U axes are
66
+ * the lines x = each of `UOffsets` (tagged 1, 2, 3, ...), V axes the lines
67
+ * y = each of `VOffsets` (tagged A, B, C, ...). Every axis runs `Overhang`
68
+ * (default 1 m) past the outermost crossing axes.
69
+ */
70
+ export declare function rectangularGridAxes(options: {
71
+ UOffsets: readonly number[];
72
+ VOffsets: readonly number[];
73
+ UTags?: readonly string[];
74
+ VTags?: readonly string[];
75
+ Overhang?: number;
76
+ }): {
77
+ UAxes: GridAxisInStoreParams[];
78
+ VAxes: GridAxisInStoreParams[];
79
+ };
80
+ export declare function addGridToStore(editor: StoreEditor, anchor: SpatialAnchor, params: GridInStoreParams): GridBuildResult;
81
+ /** Two grid axes (IfcGridAxis ids) and optional offsets from them (metres). */
82
+ export interface GridIntersectionParams {
83
+ /** The two crossing axes, e.g. a U axis and a V axis of the same grid. */
84
+ Axes: readonly [number, number];
85
+ /**
86
+ * Offsets (metres): the distance of the point from the first and from the
87
+ * second axis, measured perpendicular to each (to its left, looking along
88
+ * the axis), and an optional height above the grid plane. Default [0, 0].
89
+ */
90
+ Offsets?: readonly [number, number] | readonly [number, number, number];
91
+ }
92
+ export interface GridPlacementParams extends GridIntersectionParams {
93
+ /**
94
+ * Local +X of the placed element: a direction in the grid plane ([x, y]),
95
+ * or a second intersection it points at. Default: the grid's X axis.
96
+ * IFC2X3 accepts only an intersection.
97
+ */
98
+ RefDirection?: readonly [number, number] | GridIntersectionParams;
99
+ /**
100
+ * The grid's ObjectPlacement (`GridBuildResult.placementId`). Written as
101
+ * `PlacementRelTo` on IFC4X3; IFC2X3/IFC4 have no such attribute, their grid
102
+ * placement is implicitly in the frame of the grid the axes belong to.
103
+ */
104
+ GridPlacementId?: number;
105
+ }
106
+ export interface GridPlacementResult {
107
+ placementId: number;
108
+ intersectionId: number;
109
+ /** The IfcDirection or second IfcVirtualGridIntersection, when a RefDirection was given. */
110
+ refDirectionId: number | null;
111
+ }
112
+ /**
113
+ * Emit an IfcGridPlacement on the intersection of two grid axes, for an
114
+ * element's `ObjectPlacement` (IfcProduct attribute 5). The element's own
115
+ * geometry is then relative to the intersection, oriented by `RefDirection`.
116
+ * Both live axes must belong to different rows of one unambiguous grid.
117
+ * Curved and radial axes remain supported. For imported axes, pass the editor's source store as
118
+ * the fourth argument; its live mutation view is applied automatically.
119
+ * Overlay-only grids do not require a source context. Invalid references
120
+ * refuse before any placement or intersection entities are emitted.
121
+ */
122
+ export declare function gridIntersectionPlacement(editor: StoreEditor, anchor: Pick<SpatialAnchor, 'schema' | 'lengthUnitScale'>, params: GridPlacementParams, sourceStore?: IfcDataStore): GridPlacementResult;
123
+ export {};
124
+ //# sourceMappingURL=grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/in-store/grid.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY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AI,CAAC,aAAa,EAAE,QAAQ,GAAG,iBAAiB,CAAC,EACzD,MAAM,EAAE,mBAAmB,EAC3B,WAAW,CAAC,EAAE,YAAY,GACzB,mBAAmB,CAqDrB"}
@@ -0,0 +1,204 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { assertGridIntersectionOwner } from './grid-intersection-read.js';
5
+ import { assertFinitePoint3 } from '../ifc-creator-math.js';
6
+ import { toNativeLength, toNativePoint3 } from './anchor.js';
7
+ import { emitLocalPlacement, emitRelContainedInSpatialStructure, ownerHistoryRef, productGuid, } from './_emit-helpers.js';
8
+ import { schemaAttributes, schemaRegistry } from './schema-attributes.js';
9
+ /** Spreadsheet-style letters: 0 -> A, 25 -> Z, 26 -> AA. */
10
+ function letters(index) {
11
+ let out = '';
12
+ for (let i = index + 1; i > 0; i = Math.floor((i - 1) / 26))
13
+ out = String.fromCharCode(65 + ((i - 1) % 26)) + out;
14
+ return out;
15
+ }
16
+ /**
17
+ * U and V axes of an orthogonal grid, in the grid's frame (metres): U axes are
18
+ * the lines x = each of `UOffsets` (tagged 1, 2, 3, ...), V axes the lines
19
+ * y = each of `VOffsets` (tagged A, B, C, ...). Every axis runs `Overhang`
20
+ * (default 1 m) past the outermost crossing axes.
21
+ */
22
+ export function rectangularGridAxes(options) {
23
+ const op = 'rectangularGridAxes';
24
+ const { UOffsets, VOffsets } = options;
25
+ for (const [name, offsets] of [['UOffsets', UOffsets], ['VOffsets', VOffsets]]) {
26
+ if (!Array.isArray(offsets) || offsets.length === 0 || offsets.some((v) => !Number.isFinite(v))) {
27
+ throw new Error(`${op}: ${name} must be a non-empty array of finite numbers`);
28
+ }
29
+ }
30
+ const overhang = options.Overhang ?? 1;
31
+ if (!Number.isFinite(overhang) || overhang < 0)
32
+ throw new Error(`${op}: Overhang must be a finite, non-negative number`);
33
+ const x0 = Math.min(...UOffsets) - overhang;
34
+ const x1 = Math.max(...UOffsets) + overhang;
35
+ const y0 = Math.min(...VOffsets) - overhang;
36
+ const y1 = Math.max(...VOffsets) + overhang;
37
+ return {
38
+ UAxes: UOffsets.map((x, i) => ({ Tag: options.UTags?.[i] ?? String(i + 1), Start: [x, y0], End: [x, y1] })),
39
+ VAxes: VOffsets.map((y, i) => ({ Tag: options.VTags?.[i] ?? letters(i), Start: [x0, y], End: [x1, y] })),
40
+ };
41
+ }
42
+ function assertGridParams(params, op) {
43
+ if (params.Position !== undefined)
44
+ assertFinitePoint3({ Position: params.Position }, op);
45
+ if (params.Direction !== undefined && !Number.isFinite(params.Direction)) {
46
+ throw new Error(`${op}: Direction must be a finite number (radians)`);
47
+ }
48
+ const tags = new Set();
49
+ const families = [
50
+ ['UAxes', params.UAxes, true],
51
+ ['VAxes', params.VAxes, true],
52
+ ['WAxes', params.WAxes, false],
53
+ ];
54
+ for (const [name, axes, required] of families) {
55
+ if (axes === undefined && !required)
56
+ continue;
57
+ if (!Array.isArray(axes) || (required && axes.length === 0)) {
58
+ throw new Error(`${op}: ${name} needs at least one axis`);
59
+ }
60
+ axes.forEach((axis, i) => {
61
+ if (typeof axis?.Tag !== 'string' || axis.Tag.trim() === '')
62
+ throw new Error(`${op}: ${name}[${i}].Tag must be a non-empty string`);
63
+ if (tags.has(axis.Tag))
64
+ throw new Error(`${op}: axis tag "${axis.Tag}" is used twice`);
65
+ tags.add(axis.Tag);
66
+ const points = [axis.Start, axis.End];
67
+ if (points.some((p) => !Array.isArray(p) || p.length !== 2 || !p.every(Number.isFinite))) {
68
+ throw new Error(`${op}: ${name}[${i}] Start and End must be finite [x, y] points`);
69
+ }
70
+ if (Math.hypot(axis.End[0] - axis.Start[0], axis.End[1] - axis.Start[1]) <= 1e-9) {
71
+ throw new Error(`${op}: ${name}[${i}] Start and End must be distinct points`);
72
+ }
73
+ });
74
+ }
75
+ }
76
+ export function addGridToStore(editor, anchor, params) {
77
+ const op = 'addGridToStore';
78
+ assertGridParams(params, op);
79
+ const registry = schemaRegistry(anchor.schema, op);
80
+ const isIfc2x3 = registry.name.toUpperCase() === 'IFC2X3';
81
+ const globalId = productGuid(params, anchor.guidRandom);
82
+ const gridValues = (placement, shape, u, v, w) => ({
83
+ GlobalId: globalId,
84
+ OwnerHistory: ownerHistoryRef(anchor.ownerHistoryId),
85
+ Name: params.Name ?? 'Grid',
86
+ Description: params.Description,
87
+ ObjectType: params.ObjectType,
88
+ ObjectPlacement: placement,
89
+ Representation: shape,
90
+ UAxes: u,
91
+ VAxes: v,
92
+ WAxes: w.length > 0 ? w : null,
93
+ ...(isIfc2x3 ? {} : { PredefinedType: params.PredefinedType }),
94
+ });
95
+ // Lay the grid record out before the first emit so a bad PredefinedType or
96
+ // a missing IFC2X3 OwnerHistory refuses cleanly.
97
+ schemaAttributes(registry, 'IfcGrid', gridValues(null, null, ['#0'], ['#0'], []), op);
98
+ const direction = params.Direction ?? 0;
99
+ const placementId = emitLocalPlacement(editor, anchor.storeyPlacementId, toNativePoint3(anchor, params.Position ?? [0, 0, 0]), [0, 0, 1], [Math.cos(direction), Math.sin(direction), 0]);
100
+ const curves = [];
101
+ const emitAxes = (axes) => (axes ?? []).map((axis) => {
102
+ const points = [axis.Start, axis.End].map((p) => editor.addEntity('IfcCartesianPoint', [
103
+ [toNativeLength(anchor, p[0]), toNativeLength(anchor, p[1])],
104
+ ]).expressId);
105
+ const curve = editor.addEntity('IfcPolyline', [points.map((id) => `#${id}`)]).expressId;
106
+ curves.push(curve);
107
+ return editor.addEntity('IfcGridAxis', schemaAttributes(registry, 'IfcGridAxis', {
108
+ AxisTag: axis.Tag,
109
+ AxisCurve: `#${curve}`,
110
+ SameSense: true,
111
+ }, op)).expressId;
112
+ });
113
+ const uAxisIds = emitAxes(params.UAxes);
114
+ const vAxisIds = emitAxes(params.VAxes);
115
+ const wAxisIds = emitAxes(params.WAxes);
116
+ // 'FootPrint' GeometricCurveSet of the axis curves, in the root 3D context
117
+ // (models rarely carry a FootPrint subcontext).
118
+ const curveSet = editor.addEntity('IfcGeometricCurveSet', [curves.map((id) => `#${id}`)]).expressId;
119
+ const shapeRepId = editor.addEntity('IfcShapeRepresentation', [
120
+ `#${anchor.rootContextId ?? anchor.axisContextId}`,
121
+ 'FootPrint',
122
+ 'GeometricCurveSet',
123
+ [`#${curveSet}`],
124
+ ]).expressId;
125
+ const productShapeId = editor.addEntity('IfcProductDefinitionShape', [null, null, [`#${shapeRepId}`]]).expressId;
126
+ const refs = (ids) => ids.map((id) => `#${id}`);
127
+ const gridId = editor.addEntity('IfcGrid', schemaAttributes(registry, 'IfcGrid', gridValues(`#${placementId}`, `#${productShapeId}`, refs(uAxisIds), refs(vAxisIds), refs(wAxisIds)), op)).expressId;
128
+ const relContainedId = emitRelContainedInSpatialStructure(editor, anchor.ownerHistoryId, gridId, anchor.storeyId, anchor.guidRandom);
129
+ return { gridId, placementId, uAxisIds, vAxisIds, wAxisIds, shapeRepId, productShapeId, relContainedId };
130
+ }
131
+ function assertIntersection(editor, params, name, op) {
132
+ if (!Array.isArray(params?.Axes) || params.Axes.length !== 2 || params.Axes[0] === params.Axes[1]) {
133
+ throw new Error(`${op}: ${name}.Axes must be two different IfcGridAxis ids`);
134
+ }
135
+ for (const id of params.Axes) {
136
+ const type = editor.getEntityType(id);
137
+ if (type !== 'IfcGridAxis')
138
+ throw new Error(`${op}: #${id} is ${type ?? 'not an entity'}, not an IfcGridAxis`);
139
+ }
140
+ const offsets = params.Offsets;
141
+ if (offsets !== undefined && (!Array.isArray(offsets) || offsets.length < 2 || offsets.length > 3 || !offsets.every(Number.isFinite))) {
142
+ throw new Error(`${op}: ${name}.Offsets must be two or three finite numbers`);
143
+ }
144
+ }
145
+ /**
146
+ * Emit an IfcGridPlacement on the intersection of two grid axes, for an
147
+ * element's `ObjectPlacement` (IfcProduct attribute 5). The element's own
148
+ * geometry is then relative to the intersection, oriented by `RefDirection`.
149
+ * Both live axes must belong to different rows of one unambiguous grid.
150
+ * Curved and radial axes remain supported. For imported axes, pass the editor's source store as
151
+ * the fourth argument; its live mutation view is applied automatically.
152
+ * Overlay-only grids do not require a source context. Invalid references
153
+ * refuse before any placement or intersection entities are emitted.
154
+ */
155
+ export function gridIntersectionPlacement(editor, anchor, params, sourceStore) {
156
+ const op = 'gridIntersectionPlacement';
157
+ const registry = schemaRegistry(anchor.schema, op);
158
+ const isIfc2x3 = registry.name.toUpperCase() === 'IFC2X3';
159
+ const isIfc4x3 = registry.name.toUpperCase().startsWith('IFC4X3');
160
+ assertIntersection(editor, params, 'Location', op);
161
+ const owner = assertGridIntersectionOwner(editor, params.Axes, params.GridPlacementId, op, sourceStore);
162
+ const ref = params.RefDirection;
163
+ const refIsVector = Array.isArray(ref);
164
+ if (ref !== undefined) {
165
+ if (refIsVector) {
166
+ const [x, y] = ref;
167
+ if (ref.length !== 2 || !Number.isFinite(x) || !Number.isFinite(y) || Math.hypot(x, y) <= 1e-12) {
168
+ throw new Error(`${op}: RefDirection must be a non-zero finite [x, y] direction`);
169
+ }
170
+ if (isIfc2x3)
171
+ throw new Error(`${op}: IFC2X3 orients a grid placement only by a second intersection, not a direction`);
172
+ }
173
+ else {
174
+ assertIntersection(editor, ref, 'RefDirection', op);
175
+ const directionOwner = assertGridIntersectionOwner(editor, ref.Axes, undefined, op, sourceStore);
176
+ if (directionOwner.gridId !== owner.gridId)
177
+ throw new Error(`${op}: RefDirection axes must belong to the location's grid`);
178
+ }
179
+ }
180
+ if (params.GridPlacementId !== undefined && isIfc4x3) {
181
+ const type = editor.getEntityType(params.GridPlacementId);
182
+ if (type === undefined || !type.endsWith('Placement')) {
183
+ throw new Error(`${op}: GridPlacementId #${params.GridPlacementId} is ${type ?? 'not an entity'}, not an object placement`);
184
+ }
185
+ }
186
+ const emitIntersection = (p) => editor.addEntity('IfcVirtualGridIntersection', schemaAttributes(registry, 'IfcVirtualGridIntersection', {
187
+ IntersectingAxes: p.Axes.map((id) => `#${id}`),
188
+ OffsetDistances: (p.Offsets ?? [0, 0]).map((d) => ({ real: toNativeLength(anchor, d) })),
189
+ }, op)).expressId;
190
+ const intersectionId = emitIntersection(params);
191
+ let refDirectionId = null;
192
+ if (ref !== undefined) {
193
+ refDirectionId = refIsVector
194
+ ? editor.addEntity('IfcDirection', [[ref[0], ref[1], 0]]).expressId
195
+ : emitIntersection(ref);
196
+ }
197
+ const placementId = editor.addEntity('IfcGridPlacement', schemaAttributes(registry, 'IfcGridPlacement', {
198
+ ...(isIfc4x3 && params.GridPlacementId !== undefined ? { PlacementRelTo: `#${params.GridPlacementId}` } : {}),
199
+ PlacementLocation: `#${intersectionId}`,
200
+ PlacementRefDirection: refDirectionId === null ? null : `#${refDirectionId}`,
201
+ }, op)).expressId;
202
+ return { placementId, intersectionId, refDirectionId };
203
+ }
204
+ //# sourceMappingURL=grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/in-store/grid.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAwB/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjF,OAAO,EACL,kBAAkB,EAClB,kCAAkC,EAClC,eAAe,EACf,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAgD1E,4DAA4D;AAC5D,SAAS,OAAO,CAAC,KAAa;IAC5B,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QAAE,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,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eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7G,iBAAiB,EAAE,IAAI,cAAc,EAAE;QACvC,qBAAqB,EAAE,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,cAAc,EAAE;KAC7E,EAAE,EAAE,CAAU,CAAC,CAAC,SAAS,CAAC;IAE3B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AACzD,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { type GroupRootIdentity, type GroupSnapshot } from './group-graph.js';
2
+ import type { GroupStoreContext } from './group.js';
3
+ export interface GroupNativeEvidence {
4
+ source: {
5
+ contentKey: string;
6
+ byteLength: number;
7
+ };
8
+ selected: number[];
9
+ members: GroupRootIdentity[];
10
+ groups: GroupSnapshot[];
11
+ /** Current records for selected roots, their owned assignments and immediate incoming dependencies. */
12
+ records: Array<{
13
+ expressId: number;
14
+ type: string;
15
+ attributes: unknown[];
16
+ }>;
17
+ incoming: Array<{
18
+ target: number;
19
+ referrers: number[];
20
+ }>;
21
+ }
22
+ /** Review facts come from the lifecycle owner's same bounded current graph. */
23
+ export declare function readGroupEvidenceInStore(context: GroupStoreContext, selected: readonly number[]): GroupNativeEvidence;
24
+ /**
25
+ * Bounded facts for a selection that touches no exact generic IfcGroup (#7346):
26
+ * no selected root is an IfcGroup, and no current IfcRelAssignsToGroup naming
27
+ * an exact IfcGroup relates or is any selected root. Such a selection can only
28
+ * start a new group, so the review owner reads the complete graph itself.
29
+ * GlobalId uniqueness is not established here; review re-checks it.
30
+ */
31
+ export interface GroupCreateEvidence {
32
+ scope: 'no-group-context';
33
+ source: {
34
+ contentKey: string;
35
+ byteLength: number;
36
+ };
37
+ selected: number[];
38
+ members: GroupRootIdentity[];
39
+ }
40
+ /**
41
+ * Index-seeded alternative to the whole-model graph: decodes only the selected
42
+ * roots and every IfcRelAssignsToGroup (so its cost scales with the model's
43
+ * group-assignment count). Throws over the graph's entity budget, which review
44
+ * could never read. Returns null when the selection touches an exact generic
45
+ * IfcGroup, or when a decoded assignment is unreadable, so the complete owner
46
+ * gives the answer or its own refusal.
47
+ */
48
+ export declare function readGroupCreateEvidenceInStore(context: GroupStoreContext, selected: readonly number[], entityLimit?: number): GroupCreateEvidence | null;
49
+ //# sourceMappingURL=group-evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-evidence.d.ts","sourceRoot":"","sources":["../../src/in-store/group-evidence.ts"],"names":[],"mappings":"AAQA,OAAO,EAAwE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpJ,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,uGAAuG;IACvG,OAAO,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC,CAAC;IAC3E,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC1D;AAUD,+EAA+E;AAC/E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,mBAAmB,CA4BrH;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,EACpG,WAAW,GAAE,MAAoC,GAAG,mBAAmB,GAAG,IAAI,CAqC/E"}
@@ -0,0 +1,111 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { isValidIfcGuid } from '@ifc-lite/encoding';
5
+ import { conformsTo, schemaRegistry } from './schema-attributes.js';
6
+ import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
7
+ import { createSchemaEntityNameSnapshot } from '@ifc-lite/parser';
8
+ import { AnchorEntityReader } from './resolve-anchor.js';
9
+ import { assertGroupEntityBudget, GROUP_GRAPH_LIMITS, GroupGraph, referenceId } from './group-graph.js';
10
+ function selectionSource(context, selected) {
11
+ const contentKey = context.store.source.contentKey;
12
+ if (!contentKey || !context.store.source.byteLength)
13
+ throw new Error('Group evidence requires its current native source content identity');
14
+ if (!Array.isArray(selected) || !selected.length || selected.length > 100 || new Set(selected).size !== selected.length
15
+ || selected.some(id => !Number.isSafeInteger(id) || id < 1))
16
+ throw new Error('Group evidence requires 1–100 distinct captured native identities');
17
+ return { contentKey, source: context.store.source.byteLength };
18
+ }
19
+ /** Review facts come from the lifecycle owner's same bounded current graph. */
20
+ export function readGroupEvidenceInStore(context, selected) {
21
+ const { contentKey } = selectionSource(context, selected);
22
+ const graph = new GroupGraph(context.store, context.mutationView);
23
+ const registry = schemaRegistry(context.store.schemaVersion, 'IfcGroup');
24
+ const members = [], groups = [];
25
+ const roots = new Set();
26
+ for (const id of selected) {
27
+ const identity = graph.root(id), row = graph.entities.get(id);
28
+ if (!conformsTo(registry, row.type, 'IfcObjectDefinition', graph.schemaNames))
29
+ throw new Error('Captured group member is not an IfcObjectDefinition');
30
+ members.push(identity);
31
+ roots.add(id);
32
+ if (row.type.toUpperCase() === 'IFCGROUP') {
33
+ const snapshot = graph.snapshot(identity);
34
+ groups.push(snapshot);
35
+ for (const membership of snapshot.memberships) {
36
+ roots.add(membership.relationship.expressId);
37
+ for (const member of membership.RelatedObjects)
38
+ roots.add(member.expressId);
39
+ }
40
+ }
41
+ }
42
+ const incoming = [...roots].sort((a, b) => a - b).map(target => ({ target, referrers: [...graph.incoming.get(target) ?? []].sort((a, b) => a - b) }));
43
+ const ids = new Set([...roots, ...incoming.flatMap(row => row.referrers)]);
44
+ if (ids.size > 200)
45
+ throw new Error('Complete Group records and incoming dependencies exceed the review budget');
46
+ const records = [...ids].sort((a, b) => a - b).map(expressId => {
47
+ const record = graph.entities.get(expressId);
48
+ if (!record)
49
+ throw new Error('Group evidence has an unavailable dependency');
50
+ return { expressId, type: record.type, attributes: structuredClone(record.attributes) };
51
+ });
52
+ if (JSON.stringify(records).length > 80_000)
53
+ throw new Error('Complete Group record evidence exceeds the transport budget');
54
+ return { source: { contentKey, byteLength: context.store.source.byteLength }, selected: [...selected], members, groups, records, incoming };
55
+ }
56
+ /**
57
+ * Index-seeded alternative to the whole-model graph: decodes only the selected
58
+ * roots and every IfcRelAssignsToGroup (so its cost scales with the model's
59
+ * group-assignment count). Throws over the graph's entity budget, which review
60
+ * could never read. Returns null when the selection touches an exact generic
61
+ * IfcGroup, or when a decoded assignment is unreadable, so the complete owner
62
+ * gives the answer or its own refusal.
63
+ */
64
+ export function readGroupCreateEvidenceInStore(context, selected, entityLimit = GROUP_GRAPH_LIMITS.entities) {
65
+ const { contentKey, source } = selectionSource(context, selected);
66
+ if (context.store.schemaVersion !== 'IFC4' && context.store.schemaVersion !== 'IFC4X3')
67
+ return null;
68
+ // Review must read the complete graph, so a model over its budget is refused here, not after a round trip.
69
+ assertGroupEntityBudget(context.store, context.mutationView, entityLimit);
70
+ const registry = schemaRegistry(context.store.schemaVersion, 'IfcGroup'), names = createSchemaEntityNameSnapshot(registry);
71
+ const reader = new AnchorEntityReader(context.store, context.mutationView, names);
72
+ const wanted = new Set(selected), members = [];
73
+ for (const id of selected) {
74
+ const row = reader.entity(id);
75
+ if (!row || row.type.toUpperCase() === 'IFCGROUP')
76
+ return null;
77
+ if (!conformsTo(registry, row.type, 'IfcObjectDefinition', names))
78
+ throw new Error('Captured group member is not an IfcObjectDefinition');
79
+ const GlobalId = row.names[0] === 'GlobalId' ? row.attributes[0] : undefined;
80
+ if (typeof GlobalId !== 'string' || !isValidIfcGuid(GlobalId))
81
+ throw new Error(`Group graph #${id} is not a live valid IfcRoot`);
82
+ members.push({ expressId: id, GlobalId });
83
+ }
84
+ const generic = new Map();
85
+ // Registry keys are canonical, so their own chains name every assignment subtype.
86
+ const assignments = Object.entries(registry.entities).filter(([, row]) => row.inheritanceChain?.includes('IfcRelAssignsToGroup')).map(([name]) => name);
87
+ for (const { expressId } of iterateEffectiveEntityIds(context.store, context.mutationView, assignments)) {
88
+ const row = reader.entity(expressId);
89
+ const relating = row ? referenceId(row.attributes[row.names.indexOf('RelatingGroup')]) : null;
90
+ const related = row?.attributes[row.names.indexOf('RelatedObjects')];
91
+ if (relating === null || !Array.isArray(related))
92
+ return null;
93
+ if (!generic.has(relating)) {
94
+ const group = reader.entity(relating);
95
+ if (!group)
96
+ return null;
97
+ generic.set(relating, group.type.toUpperCase() === 'IFCGROUP');
98
+ }
99
+ if (!generic.get(relating))
100
+ continue;
101
+ if (wanted.has(expressId))
102
+ return null;
103
+ for (const value of related) {
104
+ const id = referenceId(value);
105
+ if (id === null || wanted.has(id))
106
+ return null;
107
+ }
108
+ }
109
+ return { scope: 'no-group-context', source: { contentKey, byteLength: source }, selected: [...selected], members };
110
+ }
111
+ //# sourceM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0 +1,51 @@
1
+ import { type MutablePropertyView } from '@ifc-lite/mutations';
2
+ import { type SchemaEntityNameSnapshot, type EffectiveEntityRecord, type IfcDataStore } from '@ifc-lite/parser';
3
+ /** Explicit bounds on file-controlled input; refusal never returns a partial graph. */
4
+ export declare const GROUP_GRAPH_LIMITS: {
5
+ readonly entities: 250000;
6
+ readonly recordCharacters: 4000000;
7
+ readonly totalRecordCharacters: 80000000;
8
+ readonly references: 2000000;
9
+ readonly members: 10000;
10
+ };
11
+ export type GroupGraphLimits = {
12
+ readonly [K in keyof typeof GROUP_GRAPH_LIMITS]: number;
13
+ };
14
+ export interface GroupRootIdentity {
15
+ expressId: number;
16
+ GlobalId: string;
17
+ }
18
+ export interface GroupMembershipSnapshot {
19
+ relationship: GroupRootIdentity;
20
+ RelatedObjects: GroupRootIdentity[];
21
+ }
22
+ export interface GroupSnapshot extends GroupRootIdentity {
23
+ Name: string | null;
24
+ Description: string | null;
25
+ ObjectType: string | null;
26
+ memberships: GroupMembershipSnapshot[];
27
+ }
28
+ /** Scan actual effective export records, never attribute numbers mistaken for refs. */
29
+ export declare function groupRecordReferences(text: string): number[];
30
+ /**
31
+ * The graph's whole-model entity budget without decoding a record (#7346). The
32
+ * parsed type buckets plus overlay creations bound the live population from
33
+ * above, so only a model near the budget walks the canonical iterator.
34
+ */
35
+ export declare function assertGroupEntityBudget(store: IfcDataStore, view: MutablePropertyView, limit?: number): void;
36
+ export declare class GroupGraph {
37
+ readonly store: IfcDataStore;
38
+ readonly view: MutablePropertyView;
39
+ private readonly limits;
40
+ readonly schemaNames: SchemaEntityNameSnapshot;
41
+ readonly entities: Map<number, EffectiveEntityRecord>;
42
+ readonly incoming: Map<number, Set<number>>;
43
+ private readonly roots;
44
+ /** `limits` exists so the budgets can be exercised at test scale; callers use the defaults. */
45
+ constructor(store: IfcDataStore, view: MutablePropertyView, limits?: GroupGraphLimits);
46
+ root(id: number, expected?: string): GroupRootIdentity;
47
+ availableGuid(guid: string): void;
48
+ snapshot(target: GroupRootIdentity): GroupSnapshot;
49
+ }
50
+ export declare function referenceId(value: unknown): number | null;
51
+ //# sourceMappingURL=group-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-graph.d.ts","sourceRoot":"","sources":["../../src/in-store/group-graph.ts"],"names":[],"mappings":"AAKA,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,EAAkC,KAAK,wBAAwB,EAAE,KAAK,qBAAqB,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhJ,uFAAuF;AACvF,eAAO,MAAM,kBAAkB;;;;;;CAAyI,CAAC;AACzK,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,OAAO,kBAAkB,GAAG,MAAM;CAAE,CAAC;AAE3F,MAAM,WAAW,iBAAiB;IAAG,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AAC1E,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,iBAAiB,CAAC;IAChC,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC;AACD,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,uBAAuB,EAAE,CAAC;CACxC;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CA+B5D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,GAAE,MAAoC,GAAG,IAAI,CASzI;AAED,qBAAa,UAAU;IAOT,QAAQ,CAAC,KAAK,EAAE,YAAY;IAAE,QAAQ,CAAC,IAAI,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