@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,157 @@
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 { roomConvexHull as convexHull } from './room-footprint-native.js';
5
+ export { roomConvexHull as convexHull } from './room-footprint-native.js';
6
+ const WALL_TYPES = new Set(['IfcWall', 'IfcWallStandardCase']);
7
+ /** OBB filter: drop slivers and anything too thick to be a wall (a mis-typed
8
+ * slab/footing caught in the band). */
9
+ const MIN_LEN = 0.3;
10
+ const MIN_THICK = 0.02;
11
+ const MAX_THICK = 2.5;
12
+ /** A wall is "on" a storey when its height range overlaps the band interior. */
13
+ const BAND_MARGIN = 0.2;
14
+ /**
15
+ * The render → room-frame plan offsets: `ifcX = renderX + cx`,
16
+ * `ifcY = cy − renderZ`.
17
+ *
18
+ * The room frame is the MODEL'S OWN IFC frame — `ifcLocal = renderLocal +
19
+ * shift` with the Y-up→Z-up swap — NOT the georeferenced survey frame.
20
+ * `wasmRtcOffset` is what the WASM mesh path subtracted when it resolved a
21
+ * site placement that anchors the building to a survey grid; folding it back
22
+ * in here would put the room frame a whole survey offset away from the
23
+ * rendered walls and from the storey band below (see the module docstring
24
+ * for the LV95 measurement that showed this). The anchor is carried by
25
+ * {@link roomFrameToModelWorld} instead, for the one consumer that needs the
26
+ * file's own placement-chain coordinates.
27
+ *
28
+ * Exported because this is where the room frame is DEFINED, and the bake needs
29
+ * to know which frame that is — see {@link roomFrameToModelWorld}.
30
+ */
31
+ export function roomFramePlanOffsets(coord) {
32
+ const shift = coord?.originShift ?? { x: 0, y: 0, z: 0 };
33
+ return { cx: shift.x, cy: -shift.z };
34
+ }
35
+ /**
36
+ * The plan offset that takes a room-frame point into the MODEL'S OWN WORLD
37
+ * FRAME — the coordinates the STEP file's placement chains resolve to, which
38
+ * is the frame `storeyPlanFrame` reads the storey out of.
39
+ *
40
+ * Exactly the survey anchor {@link roomFramePlanOffsets} leaves out: the
41
+ * canonical reconstruction is worldYup = renderLocal + shift + rtcYup with
42
+ * The viewer-axis conversion lives in `coordinate-frame.ts`; in IFC-plan axes, ifcX gains `rtc.x` and
43
+ * ifcY gains `rtc.y` on top of the room frame. Zero for any model within
44
+ * ~10 km of the origin (rtc is null there). Anything that changes which
45
+ * terms `roomFramePlanOffsets` carries changes this one too;
46
+ * `wall-rects-from-meshes.test.ts` pins the two together.
47
+ */
48
+ export function roomFrameToModelWorld(coord) {
49
+ const rtc = coord?.wasmRtcOffset ?? { x: 0, y: 0, z: 0 };
50
+ return { dx: rtc.x, dy: rtc.y };
51
+ }
52
+ /**
53
+ * MINIMUM-AREA bounding rectangle of a thin plan point cloud (rotating calipers
54
+ * on the convex hull) → its 4 CCW corners (long edge first), length, thickness.
55
+ *
56
+ * NOT PCA. PCA orients by minimizing variance, so on a wall whose mesh has uneven
57
+ * vertex density (short structural stubs especially) the principal axis tilts by
58
+ * several degrees even though the wall is axis-aligned — which skews the room into
59
+ * a parallelogram. The min-area rectangle depends only on the footprint OUTLINE
60
+ * (the hull), so it returns the true rectangle: measured 0.000° skew / 0 m off the
61
+ * rendered faces on the storeys where PCA produced ~5° skew.
62
+ */
63
+ export function footprintOBB(pts) {
64
+ const h = convexHull(pts);
65
+ if (h.length < 3)
66
+ return null;
67
+ let best = null;
68
+ // The min-area rectangle is collinear with one hull edge — try them all.
69
+ for (let i = 0; i < h.length; i++) {
70
+ const a = h[i], b = h[(i + 1) % h.length];
71
+ let ex = b[0] - a[0], ey = b[1] - a[1];
72
+ const L = Math.hypot(ex, ey);
73
+ if (L < 1e-9)
74
+ continue;
75
+ ex /= L;
76
+ ey /= L;
77
+ const nx = -ey, ny = ex; // +90° (CCW) of the edge dir
78
+ let umin = Infinity, umax = -Infinity, vmin = Infinity, vmax = -Infinity;
79
+ for (const q of h) {
80
+ const du = (q[0] - a[0]) * ex + (q[1] - a[1]) * ey;
81
+ const dv = (q[0] - a[0]) * nx + (q[1] - a[1]) * ny;
82
+ if (du < umin)
83
+ umin = du;
84
+ if (du > umax)
85
+ umax = du;
86
+ if (dv < vmin)
87
+ vmin = dv;
88
+ if (dv > vmax)
89
+ vmax = dv;
90
+ }
91
+ const ulen = umax - umin, vlen = vmax - vmin;
92
+ const area = ulen * vlen;
93
+ if (best && area >= best.area)
94
+ continue;
95
+ const P = (du, dv) => [a[0] + ex * du + nx * dv, a[1] + ey * du + ny * dv];
96
+ // CCW corners; rotate so corners[0]→corners[1] is the LONG (length) axis,
97
+ // which `wallRectsFromMeshes` relies on to take the centreline.
98
+ let corners = [P(umin, vmin), P(umax, vmin), P(umax, vmax), P(umin, vmax)];
99
+ if (ulen < vlen)
100
+ corners = [corners[1], corners[2], corners[3], corners[0]];
101
+ best = { area, corners, length: Math.max(ulen, vlen), thickness: Math.min(ulen, vlen) };
102
+ }
103
+ return best;
104
+ }
105
+ /**
106
+ * Per-wall footprint rectangles (4 CCW corners, room frame) for the walls whose
107
+ * height range overlaps the storey band `[floorElevation, floorElevation +
108
+ * floorToFloor]`. Aggregates all mesh fragments of one wall (a void-cut wall
109
+ * renders as several) by `expressId` before taking the OBB.
110
+ */
111
+ export function wallRectsFromMeshes(meshes, coord, floorElevation, floorToFloor) {
112
+ const shift = coord?.originShift ?? { x: 0, y: 0, z: 0 };
113
+ // Render → the model's own IFC frame (no rtc term — see roomFramePlanOffsets).
114
+ const { cx, cy } = roomFramePlanOffsets(coord);
115
+ // Storey band in render-Y (height): renderY = ifcZ − shift.y. `floorElevation`
116
+ // is the storey's own local Elevation, the frame the rendered geometry is in.
117
+ const lo = floorElevation - shift.y;
118
+ const hi = floorElevation + floorToFloor - shift.y;
119
+ const walls = new Map();
120
+ for (const m of meshes) {
121
+ if (!m.ifcType || !WALL_TYPES.has(m.ifcType))
122
+ continue;
123
+ const pos = m.positions;
124
+ const o = m.origin ?? [0, 0, 0];
125
+ let w = walls.get(m.expressId);
126
+ if (!w) {
127
+ w = { pts: [], ymin: Infinity, ymax: -Infinity };
128
+ walls.set(m.expressId, w);
129
+ }
130
+ for (let i = 0; i + 2 < pos.length; i += 3) {
131
+ const rx = o[0] + pos[i], ry = o[1] + pos[i + 1], rz = o[2] + pos[i + 2];
132
+ w.pts.push([rx + cx, cy - rz]);
133
+ if (ry < w.ymin)
134
+ w.ymin = ry;
135
+ if (ry > w.ymax)
136
+ w.ymax = ry;
137
+ }
138
+ }
139
+ const out = [];
140
+ for (const w of walls.values()) {
141
+ if (!(w.ymax > lo + BAND_MARGIN && w.ymin < hi - BAND_MARGIN))
142
+ continue; // not on this storey
143
+ if (w.pts.length < 6)
144
+ continue;
145
+ const o = footprintOBB(w.pts);
146
+ if (!o || o.length <= MIN_LEN || o.thickness <= MIN_THICK || o.thickness >= MAX_THICK)
147
+ continue;
148
+ const [c0, c1, c2, c3] = o.corners;
149
+ // Centreline = the mid-thickness line along the long axis (mid of each short
150
+ // edge). c0→c1 and c3→c2 are the long (face) edges.
151
+ const a = [(c0[0] + c3[0]) / 2, (c0[1] + c3[1]) / 2];
152
+ const b = [(c1[0] + c2[0]) / 2, (c1[1] + c2[1]) / 2];
153
+ out.push({ corners: o.corners, centreline: [a, b], thickness: o.thickness });
154
+ }
155
+ return out;
156
+ }
157
+ //# sourceMappingURL=room-wall-rects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room-wall-rects.js","sourceRoot":"","sources":["../../src/in-store/room-wall-rects.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiD/D,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAY1E,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAE/D;wCACwC;AACxC,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,SA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,GAAG,CAAC,CAAC,CAAC;QACzD,MAAM,CAAC,GAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -14,15 +14,20 @@
14
14
  * attribute unless it is an enumeration, which defaults to `NOTDEFINED` when
15
15
  * the enumeration has that value.
16
16
  */
17
- import { type SchemaRegistry } from '@ifc-lite/parser';
17
+ import { type SchemaRegistry, type SchemaEntityNameSnapshot } from '@ifc-lite/parser';
18
18
  import type { SpatialAnchorSchema } from './anchor.js';
19
+ /**
20
+ * The registry for an authoring schema (default IFC4). Refuses IFC5 / IFCX and
21
+ * anything else that is not IFC2X3, IFC4 or IFC4X3: the in-store builders write
22
+ * STEP entities, which those models do not have.
23
+ */
19
24
  export declare function schemaRegistry(schema: SpatialAnchorSchema | undefined, op: string): SchemaRegistry;
20
25
  /** The schema's canonical spelling of `type`, or null when the class does not exist in it. */
21
- export declare function canonicalEntity(registry: SchemaRegistry, type: string): string | null;
26
+ export declare function canonicalEntity(registry: SchemaRegistry, type: string, snapshot?: SchemaEntityNameSnapshot): string | null;
22
27
  /**
23
28
  * Whether `type` is an `expected` in the schema: the class itself or one of its
24
29
  * subtypes, or (transitively) a member of the `expected` SELECT.
25
30
  */
26
- export declare function conformsTo(registry: SchemaRegistry, type: string, expected: string): boolean;
31
+ export declare function conformsTo(registry: SchemaRegistry, type: string, expected: string, snapshot?: SchemaEntityNameSnapshot): boolean;
27
32
  export declare function schemaAttributes(registry: SchemaRegistry, type: string, values: Readonly<Record<string, unknown>>, op: string): unknown[];
28
33
  //# sourceMappingURL=schema-attributes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-attributes.d.ts","sourceRoot":"","sources":["../../src/in-store/schema-attributes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIvD,wBAAgB,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,cAAc,CAIlG;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGrF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAO5F;AASD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,EAAE,EAAE,MAAM,GACT,OAAO,EAAE,CAsCX"}
1
+ {"version":3,"file":"schema-attributes.d.ts","sourceRoot":"","sources":["../../src/in-store/schema-attributes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAuD,KAAK,cAAc,EAAE,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC3I,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAMvD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,cAAc,CAMlG;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,wBAAwB,GAAG,MAAM,GAAG,IAAI,CAE1H;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,wBAAwB,GAAG,OAAO,CASjI;AASD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,EAAE,EAAE,MAAM,GACT,OAAO,EAAE,CAsCX"}
@@ -17,27 +17,36 @@
17
17
  * attribute unless it is an enumeration, which defaults to `NOTDEFINED` when
18
18
  * the enumeration has that value.
19
19
  */
20
- import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
20
+ import { getSchemaRegistryForVersion, getCanonicalEntityName } from '@ifc-lite/parser';
21
+ const AUTHORING_SCHEMAS = ['IFC2X3', 'IFC4', 'IFC4X3'];
22
+ /**
23
+ * The registry for an authoring schema (default IFC4). Refuses IFC5 / IFCX and
24
+ * anything else that is not IFC2X3, IFC4 or IFC4X3: the in-store builders write
25
+ * STEP entities, which those models do not have.
26
+ */
21
27
  export function schemaRegistry(schema, op) {
22
28
  const version = schema ?? 'IFC4';
23
- if (version === 'IFC5')
24
- throw new Error(`${op}: authoring IFC5 models is not supported; use IFC2X3, IFC4 or IFC4X3`);
29
+ if (!AUTHORING_SCHEMAS.includes(version)) {
30
+ throw new Error(`${op}: authoring ${version} models is not supported; use IFC2X3, IFC4 or IFC4X3`);
31
+ }
25
32
  return getSchemaRegistryForVersion(version);
26
33
  }
27
34
  /** The schema's canonical spelling of `type`, or null when the class does not exist in it. */
28
- export function canonicalEntity(registry, type) {
29
- const upper = type.toUpperCase();
30
- return Object.keys(registry.entities).find((name) => name.toUpperCase() === upper) ?? null;
35
+ export function canonicalEntity(registry, type, snapshot) {
36
+ return getCanonicalEntityName(registry, type, snapshot) ?? null;
31
37
  }
32
38
  /**
33
39
  * Whether `type` is an `expected` in the schema: the class itself or one of its
34
40
  * subtypes, or (transitively) a member of the `expected` SELECT.
35
41
  */
36
- export function conformsTo(registry, type, expected) {
37
- const name = canonicalEntity(registry, type);
42
+ export function conformsTo(registry, type, expected, snapshot) {
43
+ const name = canonicalEntity(registry, type, snapshot);
38
44
  if (!name)
39
45
  return false;
40
- const chain = registry.entities[name].inheritanceChain ?? [name];
46
+ const definition = registry.entities[name];
47
+ if (!definition)
48
+ return false;
49
+ const chain = definition.inheritanceChain ?? [name];
41
50
  const matches = (target, depth) => chain.includes(target) || (depth < 8 && (registry.selects[target] ?? []).some((member) => matches(member, depth + 1)));
42
51
  return matches(expected, 0);
43
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schema-attributes.js","sourceRoot":"","sources":["../../src/in-store/schema-attributes.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,2BAA2B,EAAuB,MAAM,kBAAkB,CAAC;AAKpF,MAAM,UAAU,cAAc,CAAC,MAAuC,EAAE,EAAU;IAChF,MAAM,OAAO,GAAG,MAAM,IAAI,MAAM,CAAC;IACjC,IAAI,OAAO,KAAK,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,EAAE,sEAAsE,CAAC,CAAC;IACrH,OAAO,2BAA2B,CAAC,OAAiB,CAAC,CAAC;AACxD,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,eAAe,CAAC,QAAwB,EAAE,IAAY;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACjC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,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CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AA8CD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,iBAAiB,GACxB,eAAe,CAyGjB"}
@@ -127,7 +127,6 @@ export function addSlabToStore(editor, anchor, params) {
127
127
  null,
128
128
  [`#${shapeRepId}`],
129
129
  ]).expressId;
130
- // `IfcSlab.PredefinedType` only exists from IFC4 onward.
131
130
  const slabAttrs = [
132
131
  productGuid(params, anchor.guidRandom),
133
132
  ownerHistoryRef(ownerHistoryId),
@@ -137,10 +136,8 @@ export function addSlabToStore(editor, anchor, params) {
137
136
  `#${placementId}`,
138
137
  `#${productShapeId}`,
139
138
  params.Tag ?? null,
139
+ '.FLOOR.',
140
140
  ];
141
- if ((anchor.schema ?? 'IFC4') !== 'IFC2X3') {
142
- slabAttrs.push('.FLOOR.');
143
- }
144
141
  const slabId = editor.addEntity('IfcSlab', slabAttrs).expressId;
145
142
  const relContainedId = editor.addEntity('IfcRelContainedInSpatialStructure', [
146
143
  generateIfcGuid(anchor.guidRandom),
@@ -1 +1 @@
1
- {"version":3,"file":"slab.js","sourceRoot":"","sources":["../../src/in-store/slab.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,kBAA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ChB,CAAC,CAAC,SAAS,CAAC;IACb,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,2BAA2B,EAAE;QACnE,IAAI;QACJ,IAAI;QACJ,CAAC,IAAI,UAAU,EAAE,CAAC;KACnB,CAAC,CAAC,SAAS,CAAC;IAEb,MAAM,SAAS,GAAmB;QAChC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;QACtC,eAAe,CAAC,cAAc,CAAC;QAC/B,MAAM,CAAC,IAAI,IAAI,MAAM;QACrB,MAAM,CAAC,WAAW,IAAI,IAAI;QAC1B,MAAM,CAAC,UAAU,IAAI,IAAI;QACzB,IAAI,WAAW,EAAE;QACjB,IAAI,cAAc,EAAE;QACpB,MAAM,CAAC,GAAG,IAAI,IAAI;QAClB,SAAS;KACV,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,SAAoD,CAAC,CAAC,SAAS,CAAC;IAE3G,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,mCAAmC,EAAE;QAC3E,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC;QAClC,eAAe,CAAC,cAAc,CAAC;QAC/B,IAAI;QACJ,IAAI;QACJ,CAAC,IAAI,MAAM,EAAE,CAAC;QACd,IAAI,QAAQ,EAAE;KACf,CAAC,CAAC,SAAS,CAAC;IAEb,OAAO;QACL,MAAM;QACN,WAAW;QACX,SAAS;QACT,OAAO;QACP,UAAU;QACV,cAAc;QACd,cAAc;KACf,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The plan footprints of a model's existing `IfcSpace`s, per storey, as
3
+ * RINGS (charter #6232 M4): the Room tool tests "is this point already in a
4
+ * room" and links its layout faces to the rooms they are, both of which need
5
+ * a polygon, not a vertex cloud.
6
+ *
7
+ * - An extruded body's footprint is its swept profile, already a ring.
8
+ * - A faceted body (IfcTriangulatedFaceSet, IfcPolygonalFaceSet,
9
+ * IfcFacetedBrep, as AC20-FZK-Haus's rooms are) is outlined by the
10
+ * boundary of its UP-facing faces: for a volume with one floor and one
11
+ * ceiling over every plan point those faces tile the footprint exactly
12
+ * once, so the edges only one of them uses are the outline. Should that
13
+ * fail (an open shell, no up-facing face) the convex hull stands in: a
14
+ * simple polygon, never a cloud.
15
+ *
16
+ * Every footprint is storey-local metres. The body is read in the file's
17
+ * length unit, and so is a space authored this session: the in-store
18
+ * builders write native units (`resolveSpatialAnchor` carries the scale), so
19
+ * both are scaled alike.
20
+ */
21
+ import { EntityExtractor, type IfcDataStore } from '@ifc-lite/parser';
22
+ import type { Vec2 } from './auto-space-detect.js';
23
+ import { type OverlayWallReader } from './placement-frame.js';
24
+ type Vec3 = [number, number, number];
25
+ /** One existing space's footprint on its storey. */
26
+ export interface SpaceFootprint {
27
+ expressId: number;
28
+ /** Storey-local metres, a simple ring (no repeated closing vertex). */
29
+ footprint: Vec2[];
30
+ }
31
+ /**
32
+ * The plan outline of a faceted body: the boundary of its up-facing faces,
33
+ * chained into loops, the largest kept. Faces are 3D polygons in one frame.
34
+ */
35
+ export declare function facetedFootprint(faces: readonly (readonly Vec3[])[]): Vec2[] | null;
36
+ /**
37
+ * The plan footprint RING of a product's body (rep frame, native units): the
38
+ * largest ring over its body items. Null when no item gives one.
39
+ */
40
+ export declare function bodyFootprintRing(store: IfcDataStore, extractor: EntityExtractor, overlay: OverlayWallReader | undefined, representationId: number): Vec2[] | null;
41
+ /**
42
+ * Every existing IfcSpace's footprint ring, per storey expressId, with its
43
+ * id. Storeys without one are omitted. Refuses the whole store (empty map)
44
+ * when the length-unit scale can't be trusted — the same refusal
45
+ * `storeyPlanFrame` makes on the write side, so the two never disagree.
46
+ */
47
+ export declare function existingSpaceFootprintEntriesByStorey(store: IfcDataStore, overlay?: OverlayWallReader): Map<number, SpaceFootprint[]>;
48
+ /**
49
+ * Footprint rings (storey-local metres) of existing `IfcSpace` per storey,
50
+ * so generation can skip only the new rooms that overlap a present space.
51
+ * See `existingSpaceFootprintEntriesByStorey`, which also names each space.
52
+ */
53
+ export declare function existingSpaceFootprintsByStorey(store: IfcDataStore, overlay?: OverlayWallReader): Map<number, Vec2[][]>;
54
+ export {};
55
+ //# sourceMappingURL=space-footprints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"space-footprints.d.ts","sourceRoot":"","sources":["../../src/in-store/space-footprints.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAA0B,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAOL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAI9B,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAGrC,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,SAAS,EAAE,IAAI,EAAE,CAAC;CACnB;AA4BD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAoDnF;AAiDD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,EAAE,MAAM,GACvB,IAAI,EAAE,GAAG,IAAI,CA0Bf;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,YAAY,EACnB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CA+B/B;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,YAAY,EACnB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAMvB"}
@@ -0,0 +1,260 @@
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
+ /**
5
+ * The plan footprints of a model's existing `IfcSpace`s, per storey, as
6
+ * RINGS (charter #6232 M4): the Room tool tests "is this point already in a
7
+ * room" and links its layout faces to the rooms they are, both of which need
8
+ * a polygon, not a vertex cloud.
9
+ *
10
+ * - An extruded body's footprint is its swept profile, already a ring.
11
+ * - A faceted body (IfcTriangulatedFaceSet, IfcPolygonalFaceSet,
12
+ * IfcFacetedBrep, as AC20-FZK-Haus's rooms are) is outlined by the
13
+ * boundary of its UP-facing faces: for a volume with one floor and one
14
+ * ceiling over every plan point those faces tile the footprint exactly
15
+ * once, so the edges only one of them uses are the outline. Should that
16
+ * fail (an open shell, no up-facing face) the convex hull stands in: a
17
+ * simple polygon, never a cloud.
18
+ *
19
+ * Every footprint is storey-local metres. The body is read in the file's
20
+ * length unit, and so is a space authored this session: the in-store
21
+ * builders write native units (`resolveSpatialAnchor` carries the scale), so
22
+ * both are scaled alike.
23
+ */
24
+ import { EntityExtractor } from '@ifc-lite/parser';
25
+ import { safeLengthUnitScale } from './length-unit-scale.js';
26
+ import { applyFrame, frameInStoreyFrame, numericAttr, readEntity, readVec3, storeyPlacementChain, } from './placement-frame.js';
27
+ import { buildRelatingChildrenIndex, createOverlayLookup, effectiveMemberType, effectiveStoreyIds } from './spatial-children.js';
28
+ import { gatherExtrudedFootprint, resolveEntityTypeName } from './extract-walls.js';
29
+ function signedArea(ring) {
30
+ let a = 0;
31
+ for (let i = 0; i < ring.length; i++) {
32
+ const p = ring[i], q = ring[(i + 1) % ring.length];
33
+ a += p[0] * q[1] - q[0] * p[1];
34
+ }
35
+ return a / 2;
36
+ }
37
+ /** Andrew's monotone chain, CCW. */
38
+ function convexHull(points) {
39
+ const pts = [...points].sort((a, b) => a[0] - b[0] || a[1] - b[1]);
40
+ if (pts.length < 3)
41
+ return pts;
42
+ const cross = (o, a, b) => (a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0]);
43
+ const half = (list) => {
44
+ const out = [];
45
+ for (const p of list) {
46
+ while (out.length >= 2 && cross(out[out.length - 2], out[out.length - 1], p) <= 0)
47
+ out.pop();
48
+ out.push(p);
49
+ }
50
+ out.pop();
51
+ return out;
52
+ };
53
+ return [...half(pts), ...half([...pts].reverse())];
54
+ }
55
+ /**
56
+ * The plan outline of a faceted body: the boundary of its up-facing faces,
57
+ * chained into loops, the largest kept. Faces are 3D polygons in one frame.
58
+ */
59
+ export function facetedFootprint(faces) {
60
+ const key = (p) => `${p[0].toFixed(4)},${p[1].toFixed(4)}`;
61
+ const at = new Map();
62
+ const uses = new Map();
63
+ const directed = [];
64
+ const all = [];
65
+ for (const face of faces) {
66
+ for (const p of face)
67
+ all.push([p[0], p[1]]);
68
+ if (face.length < 3)
69
+ continue;
70
+ // Newell normal: its z is twice the projected signed area.
71
+ let nx = 0, ny = 0, nz = 0;
72
+ for (let i = 0; i < face.length; i++) {
73
+ const p = face[i], q = face[(i + 1) % face.length];
74
+ nx += (p[1] - q[1]) * (p[2] + q[2]);
75
+ ny += (p[2] - q[2]) * (p[0] + q[0]);
76
+ nz += (p[0] - q[0]) * (p[1] + q[1]);
77
+ }
78
+ if (nz <= 0.1 * Math.hypot(nx, ny, nz))
79
+ continue;
80
+ for (let i = 0; i < face.length; i++) {
81
+ const a = key(face[i]), b = key(face[(i + 1) % face.length]);
82
+ if (a === b)
83
+ continue;
84
+ at.set(a, [face[i][0], face[i][1]]);
85
+ directed.push([a, b]);
86
+ const undirected = a < b ? `${a}|${b}` : `${b}|${a}`;
87
+ uses.set(undirected, (uses.get(undirected) ?? 0) + 1);
88
+ }
89
+ }
90
+ const next = new Map();
91
+ for (const [a, b] of directed) {
92
+ if (uses.get(a < b ? `${a}|${b}` : `${b}|${a}`) !== 1)
93
+ continue;
94
+ (next.get(a) ?? next.set(a, []).get(a)).push(b);
95
+ }
96
+ let best = null;
97
+ let bestArea = 0;
98
+ for (const start of [...next.keys()]) {
99
+ while ((next.get(start)?.length ?? 0) > 0) {
100
+ const loop = [];
101
+ let cur = start;
102
+ for (let guard = 0; guard <= directed.length; guard++) {
103
+ const outs = next.get(cur);
104
+ if (!outs || outs.length === 0)
105
+ break;
106
+ loop.push(at.get(cur));
107
+ cur = outs.pop();
108
+ if (cur === start)
109
+ break;
110
+ }
111
+ const area = cur === start ? signedArea(loop) : 0;
112
+ if (loop.length >= 3 && Math.abs(area) > bestArea) {
113
+ bestArea = Math.abs(area);
114
+ best = loop;
115
+ }
116
+ }
117
+ }
118
+ if (best)
119
+ return signedArea(best) < 0 ? best.reverse() : best;
120
+ const hull = convexHull(all);
121
+ return hull.length >= 3 ? hull : null;
122
+ }
123
+ const list = (v) => (Array.isArray(v) ? v : []);
124
+ /** The faces of an IfcTriangulatedFaceSet / IfcPolygonalFaceSet as 3D polygons. */
125
+ function faceSetFaces(store, extractor, overlay, item, polygonal) {
126
+ const coordId = numericAttr(item.attributes[0]);
127
+ const coords = coordId === null ? null : readEntity(store, extractor, overlay, coordId);
128
+ const points = list(coords?.attributes[0]).map((p) => readVec3(p));
129
+ // PnIndex (triangulated: 4, polygonal: 3) remaps face indices into the point list.
130
+ const pn = list(item.attributes[polygonal ? 3 : 4]).map((v) => numericAttr(v));
131
+ const point = (index) => {
132
+ const i = numericAttr(index);
133
+ if (i === null)
134
+ return null;
135
+ const j = pn.length > 0 ? pn[i - 1] : i;
136
+ return j === null || j === undefined ? null : points[j - 1] ?? null;
137
+ };
138
+ const loops = polygonal
139
+ ? list(item.attributes[2]).map((ref) => {
140
+ const id = numericAttr(ref);
141
+ return list(id === null ? undefined : readEntity(store, extractor, overlay, id)?.attributes[0]);
142
+ })
143
+ : list(item.attributes[3]).map((tri) => list(tri));
144
+ return loops.map((loop) => loop.map(point)).filter((f) => f.every((p) => p !== null));
145
+ }
146
+ /** The faces of an IfcFacetedBrep (every bound's polyloop) as 3D polygons. */
147
+ function brepFaces(store, extractor, overlay, brep) {
148
+ const read = (ref) => {
149
+ const id = numericAttr(ref);
150
+ return id === null ? null : readEntity(store, extractor, overlay, id);
151
+ };
152
+ const faces = [];
153
+ for (const faceRef of list(read(brep.attributes[0])?.attributes[0])) {
154
+ for (const boundRef of list(read(faceRef)?.attributes[0])) {
155
+ const loop = read(read(boundRef)?.attributes[0]);
156
+ const pts = list(loop?.attributes[0]).map((ref) => readVec3(read(ref)?.attributes[0]));
157
+ if (pts.length >= 3 && pts.every((p) => p !== null))
158
+ faces.push(pts);
159
+ }
160
+ }
161
+ return faces;
162
+ }
163
+ /** Drop a repeated closing vertex. */
164
+ function open(ring) {
165
+ const [a, b] = [ring[0], ring[ring.length - 1]];
166
+ return ring.length > 3 && Math.abs(a[0] - b[0]) < 1e-9 && Math.abs(a[1] - b[1]) < 1e-9 ? ring.slice(0, -1) : ring;
167
+ }
168
+ /**
169
+ * The plan footprint RING of a product's body (rep frame, native units): the
170
+ * largest ring over its body items. Null when no item gives one.
171
+ */
172
+ export function bodyFootprintRing(store, extractor, overlay, representationId) {
173
+ const shape = readEntity(store, extractor, overlay, representationId);
174
+ let best = null;
175
+ for (const repRef of list(shape?.attributes[2])) {
176
+ const repId = numericAttr(repRef);
177
+ const rep = repId === null ? null : readEntity(store, extractor, overlay, repId);
178
+ if (!rep || String(rep.attributes[1] ?? '').replace(/'/g, '').toLowerCase() === 'axis')
179
+ continue;
180
+ for (const itemRef of list(rep.attributes[3])) {
181
+ const itemId = numericAttr(itemRef);
182
+ const item = itemId === null ? null : readEntity(store, extractor, overlay, itemId);
183
+ if (!item || itemId === null)
184
+ continue;
185
+ const type = resolveEntityTypeName(store, item, itemId);
186
+ let ring = null;
187
+ if (type === 'ifcextrudedareasolid') {
188
+ const pts = [];
189
+ gatherExtrudedFootprint(store, extractor, overlay, item, pts);
190
+ ring = pts.length >= 3 ? open(pts) : null;
191
+ }
192
+ else if (type === 'ifctriangulatedfaceset' || type === 'ifcpolygonalfaceset') {
193
+ ring = facetedFootprint(faceSetFaces(store, extractor, overlay, item, type === 'ifcpolygonalfaceset'));
194
+ }
195
+ else if (type === 'ifcfacetedbrep') {
196
+ ring = facetedFootprint(brepFaces(store, extractor, overlay, item));
197
+ }
198
+ if (ring && ring.length >= 3 && (!best || Math.abs(signedArea(ring)) > Math.abs(signedArea(best))))
199
+ best = ring;
200
+ }
201
+ }
202
+ return best;
203
+ }
204
+ /**
205
+ * Every existing IfcSpace's footprint ring, per storey expressId, with its
206
+ * id. Storeys without one are omitted. Refuses the whole store (empty map)
207
+ * when the length-unit scale can't be trusted — the same refusal
208
+ * `storeyPlanFrame` makes on the write side, so the two never disagree.
209
+ */
210
+ export function existingSpaceFootprintEntriesByStorey(store, overlay) {
211
+ const out = new Map();
212
+ if (!store.source)
213
+ return out;
214
+ const extractor = new EntityExtractor(store.source);
215
+ const scale = safeLengthUnitScale(store.source, store.entityIndex, 'existingSpaceFootprintsByStorey');
216
+ if (scale === null)
217
+ return out;
218
+ // Spaces authored this session count as existing (#5249).
219
+ const lookup = createOverlayLookup(overlay);
220
+ const aggregated = buildRelatingChildrenIndex(store, extractor, lookup, 'IFCRELAGGREGATES', 4, 5);
221
+ const contained = buildRelatingChildrenIndex(store, extractor, lookup, 'IFCRELCONTAINEDINSPATIALSTRUCTURE', 5, 4);
222
+ for (const storeyId of effectiveStoreyIds(store, lookup)) {
223
+ const kids = [...(aggregated.get(storeyId) ?? []), ...(contained.get(storeyId) ?? [])];
224
+ const storeyChain = storeyPlacementChain(store, extractor, overlay, storeyId);
225
+ const entries = [];
226
+ for (const id of kids) {
227
+ if ((effectiveMemberType(store, lookup, id) ?? '').toUpperCase() !== 'IFCSPACE')
228
+ continue;
229
+ const ent = readEntity(store, extractor, overlay, id);
230
+ const placementId = numericAttr(ent?.attributes[5]); // ObjectPlacement
231
+ const representationId = numericAttr(ent?.attributes[6]); // Representation
232
+ if (placementId === null || representationId === null)
233
+ continue;
234
+ const frame = frameInStoreyFrame(store, extractor, overlay, placementId, storeyChain);
235
+ const ring = bodyFootprintRing(store, extractor, overlay, representationId);
236
+ if (!frame || !ring)
237
+ continue;
238
+ entries.push({ expressId: id, footprint: ring.map((p) => {
239
+ const w = applyFrame(frame, p);
240
+ return [w[0] * scale, w[1] * scale];
241
+ }) });
242
+ }
243
+ if (entries.length)
244
+ out.set(storeyId, entries);
245
+ }
246
+ return out;
247
+ }
248
+ /**
249
+ * Footprint rings (storey-local metres) of existing `IfcSpace` per storey,
250
+ * so generation can skip only the new rooms that overlap a present space.
251
+ * See `existingSpaceFootprintEntriesByStorey`, which also names each space.
252
+ */
253
+ export function existingSpaceFootprintsByStorey(store, overlay) {
254
+ const out = new Map();
255
+ for (const [storeyId, entries] of existingSpaceFootprintEntriesByStorey(store, overlay)) {
256
+ out.set(storeyId, entries.map((e) => e.footprint));
257
+ }
258
+ return out;
259
+ }
260
+ //# sourceMappingURL=space-footprints.js.map