@ifc-lite/create 3.1.0 → 4.0.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 (208) hide show
  1. package/README.md +9 -0
  2. package/dist/ifc-creator-math.d.ts +5 -7
  3. package/dist/ifc-creator-math.d.ts.map +1 -1
  4. package/dist/ifc-creator-math.js +8 -15
  5. package/dist/ifc-creator-math.js.map +1 -1
  6. package/dist/in-store/anchor.d.ts +25 -0
  7. package/dist/in-store/anchor.d.ts.map +1 -1
  8. package/dist/in-store/auto-space-detect.d.ts +1 -1
  9. package/dist/in-store/auto-space-detect.js +1 -1
  10. package/dist/in-store/beam.d.ts +10 -1
  11. package/dist/in-store/beam.d.ts.map +1 -1
  12. package/dist/in-store/beam.js +14 -25
  13. package/dist/in-store/beam.js.map +1 -1
  14. package/dist/in-store/column.d.ts +18 -1
  15. package/dist/in-store/column.d.ts.map +1 -1
  16. package/dist/in-store/column.js +37 -29
  17. package/dist/in-store/column.js.map +1 -1
  18. package/dist/in-store/copy-frame.d.ts +52 -0
  19. package/dist/in-store/copy-frame.d.ts.map +1 -0
  20. package/dist/in-store/copy-frame.js +99 -0
  21. package/dist/in-store/copy-frame.js.map +1 -0
  22. package/dist/in-store/copy-product.d.ts +96 -0
  23. package/dist/in-store/copy-product.d.ts.map +1 -0
  24. package/dist/in-store/copy-product.js +318 -0
  25. package/dist/in-store/copy-product.js.map +1 -0
  26. package/dist/in-store/curtain-wall.d.ts +87 -0
  27. package/dist/in-store/curtain-wall.d.ts.map +1 -0
  28. package/dist/in-store/curtain-wall.js +237 -0
  29. package/dist/in-store/curtain-wall.js.map +1 -0
  30. package/dist/in-store/door.d.ts +10 -4
  31. package/dist/in-store/door.d.ts.map +1 -1
  32. package/dist/in-store/door.js +23 -17
  33. package/dist/in-store/door.js.map +1 -1
  34. package/dist/in-store/element-type.d.ts +40 -0
  35. package/dist/in-store/element-type.d.ts.map +1 -0
  36. package/dist/in-store/element-type.js +60 -0
  37. package/dist/in-store/element-type.js.map +1 -0
  38. package/dist/in-store/extract-grids.d.ts +46 -0
  39. package/dist/in-store/extract-grids.d.ts.map +1 -0
  40. package/dist/in-store/extract-grids.js +211 -0
  41. package/dist/in-store/extract-grids.js.map +1 -0
  42. package/dist/in-store/extract-walls.d.ts +12 -23
  43. package/dist/in-store/extract-walls.d.ts.map +1 -1
  44. package/dist/in-store/extract-walls.js +14 -83
  45. package/dist/in-store/extract-walls.js.map +1 -1
  46. package/dist/in-store/generate-spaces.d.ts +1 -1
  47. package/dist/in-store/grid.d.ts +118 -0
  48. package/dist/in-store/grid.d.ts.map +1 -0
  49. package/dist/in-store/grid.js +194 -0
  50. package/dist/in-store/grid.js.map +1 -0
  51. package/dist/in-store/host-geometry-frame.d.ts +44 -0
  52. package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
  53. package/dist/in-store/host-geometry-frame.js +146 -0
  54. package/dist/in-store/host-geometry-frame.js.map +1 -0
  55. package/dist/in-store/hosted-element-edit.d.ts +29 -0
  56. package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
  57. package/dist/in-store/hosted-element-edit.js +120 -0
  58. package/dist/in-store/hosted-element-edit.js.map +1 -0
  59. package/dist/in-store/hosted-element.d.ts +41 -0
  60. package/dist/in-store/hosted-element.d.ts.map +1 -0
  61. package/dist/in-store/hosted-element.js +124 -0
  62. package/dist/in-store/hosted-element.js.map +1 -0
  63. package/dist/in-store/hosted-fill-read.d.ts +56 -0
  64. package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
  65. package/dist/in-store/hosted-fill-read.js +197 -0
  66. package/dist/in-store/hosted-fill-read.js.map +1 -0
  67. package/dist/in-store/hosted-fill.d.ts +48 -0
  68. package/dist/in-store/hosted-fill.d.ts.map +1 -0
  69. package/dist/in-store/hosted-fill.js +58 -0
  70. package/dist/in-store/hosted-fill.js.map +1 -0
  71. package/dist/in-store/hosted-global-id.d.ts +8 -0
  72. package/dist/in-store/hosted-global-id.d.ts.map +1 -0
  73. package/dist/in-store/hosted-global-id.js +53 -0
  74. package/dist/in-store/hosted-global-id.js.map +1 -0
  75. package/dist/in-store/hosted-placement-edit.d.ts +30 -0
  76. package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
  77. package/dist/in-store/hosted-placement-edit.js +123 -0
  78. package/dist/in-store/hosted-placement-edit.js.map +1 -0
  79. package/dist/in-store/hosted-scale-chain.d.ts +12 -0
  80. package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
  81. package/dist/in-store/hosted-scale-chain.js +74 -0
  82. package/dist/in-store/hosted-scale-chain.js.map +1 -0
  83. package/dist/in-store/hosted-shape-edit.d.ts +9 -0
  84. package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
  85. package/dist/in-store/hosted-shape-edit.js +79 -0
  86. package/dist/in-store/hosted-shape-edit.js.map +1 -0
  87. package/dist/in-store/index.d.ts +59 -0
  88. package/dist/in-store/index.d.ts.map +1 -0
  89. package/dist/in-store/index.js +64 -0
  90. package/dist/in-store/index.js.map +1 -0
  91. package/dist/in-store/material.d.ts +62 -0
  92. package/dist/in-store/material.d.ts.map +1 -0
  93. package/dist/in-store/material.js +107 -0
  94. package/dist/in-store/material.js.map +1 -0
  95. package/dist/in-store/member.d.ts +8 -2
  96. package/dist/in-store/member.d.ts.map +1 -1
  97. package/dist/in-store/member.js +12 -14
  98. package/dist/in-store/member.js.map +1 -1
  99. package/dist/in-store/opening.d.ts +45 -0
  100. package/dist/in-store/opening.d.ts.map +1 -0
  101. package/dist/in-store/opening.js +104 -0
  102. package/dist/in-store/opening.js.map +1 -0
  103. package/dist/in-store/placement-frame.d.ts +9 -4
  104. package/dist/in-store/placement-frame.d.ts.map +1 -1
  105. package/dist/in-store/placement-frame.js +39 -39
  106. package/dist/in-store/placement-frame.js.map +1 -1
  107. package/dist/in-store/profile.d.ts +141 -0
  108. package/dist/in-store/profile.d.ts.map +1 -0
  109. package/dist/in-store/profile.js +174 -0
  110. package/dist/in-store/profile.js.map +1 -0
  111. package/dist/in-store/railing.d.ts +65 -0
  112. package/dist/in-store/railing.d.ts.map +1 -0
  113. package/dist/in-store/railing.js +112 -0
  114. package/dist/in-store/railing.js.map +1 -0
  115. package/dist/in-store/rel-connects-path.d.ts +43 -0
  116. package/dist/in-store/rel-connects-path.d.ts.map +1 -0
  117. package/dist/in-store/rel-connects-path.js +65 -0
  118. package/dist/in-store/rel-connects-path.js.map +1 -0
  119. package/dist/in-store/relate.d.ts +32 -0
  120. package/dist/in-store/relate.d.ts.map +1 -0
  121. package/dist/in-store/relate.js +39 -0
  122. package/dist/in-store/relate.js.map +1 -0
  123. package/dist/in-store/resolve-anchor.d.ts +21 -1
  124. package/dist/in-store/resolve-anchor.d.ts.map +1 -1
  125. package/dist/in-store/resolve-anchor.js +6 -2
  126. package/dist/in-store/resolve-anchor.js.map +1 -1
  127. package/dist/in-store/resolve-host.d.ts +16 -0
  128. package/dist/in-store/resolve-host.d.ts.map +1 -0
  129. package/dist/in-store/resolve-host.js +333 -0
  130. package/dist/in-store/resolve-host.js.map +1 -0
  131. package/dist/in-store/resolve-relations.d.ts +23 -0
  132. package/dist/in-store/resolve-relations.d.ts.map +1 -0
  133. package/dist/in-store/resolve-relations.js +57 -0
  134. package/dist/in-store/resolve-relations.js.map +1 -0
  135. package/dist/in-store/resolve-source.d.ts.map +1 -1
  136. package/dist/in-store/resolve-source.js +59 -63
  137. package/dist/in-store/resolve-source.js.map +1 -1
  138. package/dist/in-store/schema-attributes.d.ts +33 -0
  139. package/dist/in-store/schema-attributes.d.ts.map +1 -0
  140. package/dist/in-store/schema-attributes.js +102 -0
  141. package/dist/in-store/schema-attributes.js.map +1 -0
  142. package/dist/in-store/space-footprints.d.ts +55 -0
  143. package/dist/in-store/space-footprints.d.ts.map +1 -0
  144. package/dist/in-store/space-footprints.js +260 -0
  145. package/dist/in-store/space-footprints.js.map +1 -0
  146. package/dist/in-store/space.d.ts.map +1 -1
  147. package/dist/in-store/space.js +15 -3
  148. package/dist/in-store/space.js.map +1 -1
  149. package/dist/in-store/spatial-children.d.ts +1 -1
  150. package/dist/in-store/spatial-children.js +1 -1
  151. package/dist/in-store/stair-edit.d.ts +24 -0
  152. package/dist/in-store/stair-edit.d.ts.map +1 -0
  153. package/dist/in-store/stair-edit.js +190 -0
  154. package/dist/in-store/stair-edit.js.map +1 -0
  155. package/dist/in-store/stair.d.ts +58 -0
  156. package/dist/in-store/stair.d.ts.map +1 -0
  157. package/dist/in-store/stair.js +156 -0
  158. package/dist/in-store/stair.js.map +1 -0
  159. package/dist/in-store/wall-join-apply.d.ts +74 -0
  160. package/dist/in-store/wall-join-apply.d.ts.map +1 -0
  161. package/dist/in-store/wall-join-apply.js +137 -0
  162. package/dist/in-store/wall-join-apply.js.map +1 -0
  163. package/dist/in-store/wall-join-edit.d.ts +70 -0
  164. package/dist/in-store/wall-join-edit.d.ts.map +1 -0
  165. package/dist/in-store/wall-join-edit.js +217 -0
  166. package/dist/in-store/wall-join-edit.js.map +1 -0
  167. package/dist/in-store/wall-join-read.d.ts +60 -0
  168. package/dist/in-store/wall-join-read.d.ts.map +1 -0
  169. package/dist/in-store/wall-join-read.js +230 -0
  170. package/dist/in-store/wall-join-read.js.map +1 -0
  171. package/dist/in-store/wall-join.d.ts +122 -0
  172. package/dist/in-store/wall-join.d.ts.map +1 -0
  173. package/dist/in-store/wall-join.js +231 -0
  174. package/dist/in-store/wall-join.js.map +1 -0
  175. package/dist/in-store/wall-opening-fit.d.ts +11 -0
  176. package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
  177. package/dist/in-store/wall-opening-fit.js +27 -0
  178. package/dist/in-store/wall-opening-fit.js.map +1 -0
  179. package/dist/in-store/wall.d.ts +32 -0
  180. package/dist/in-store/wall.d.ts.map +1 -1
  181. package/dist/in-store/wall.js +77 -13
  182. package/dist/in-store/wall.js.map +1 -1
  183. package/dist/in-store/window.d.ts +7 -0
  184. package/dist/in-store/window.d.ts.map +1 -1
  185. package/dist/in-store/window.js +24 -17
  186. package/dist/in-store/window.js.map +1 -1
  187. package/dist/index.d.ts +1 -31
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +2 -34
  190. package/dist/index.js.map +1 -1
  191. package/dist/landxml/cant-superelevation.d.ts +28 -0
  192. package/dist/landxml/cant-superelevation.d.ts.map +1 -0
  193. package/dist/landxml/cant-superelevation.js +31 -0
  194. package/dist/landxml/cant-superelevation.js.map +1 -0
  195. package/dist/landxml/landxml-to-ifc.d.ts +8 -2
  196. package/dist/landxml/landxml-to-ifc.d.ts.map +1 -1
  197. package/dist/landxml/landxml-to-ifc.js +34 -2
  198. package/dist/landxml/landxml-to-ifc.js.map +1 -1
  199. package/dist/landxml/refusals.d.ts.map +1 -1
  200. package/dist/landxml/refusals.js +8 -3
  201. package/dist/landxml/refusals.js.map +1 -1
  202. package/dist/landxml/result-types.d.ts +44 -0
  203. package/dist/landxml/result-types.d.ts.map +1 -1
  204. package/dist/landxml/writers.d.ts +4 -0
  205. package/dist/landxml/writers.d.ts.map +1 -1
  206. package/dist/landxml/writers.js +4 -2
  207. package/dist/landxml/writers.js.map +1 -1
  208. package/package.json +8 -7
@@ -0,0 +1,99 @@
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 { asRef } from './style-entity-reader.js';
5
+ export const IDENTITY_FRAME = { origin: [0, 0, 0], c: 1, s: 0 };
6
+ export function applyRigid(f, p) {
7
+ return [f.origin[0] + f.c * p[0] - f.s * p[1], f.origin[1] + f.s * p[0] + f.c * p[1], f.origin[2] + (p[2] ?? 0)];
8
+ }
9
+ export function composeRigid(outer, inner) {
10
+ return {
11
+ origin: applyRigid(outer, inner.origin),
12
+ c: outer.c * inner.c - outer.s * inner.s,
13
+ s: outer.s * inner.c + outer.c * inner.s,
14
+ };
15
+ }
16
+ export function invertRigid(f) {
17
+ const [x, y, z] = f.origin;
18
+ return { origin: [-(f.c * x + f.s * y), -(-f.s * x + f.c * y), -z], c: f.c, s: -f.s };
19
+ }
20
+ /** The turn about the vertical through `pivot`, then the move `offset`: one rigid frame. */
21
+ export function turnThenMove(turn, pivot, offset) {
22
+ const c = Math.cos(turn);
23
+ const s = Math.sin(turn);
24
+ // q = R(p - pivot) + pivot + offset = R p + (pivot - R pivot + offset)
25
+ return {
26
+ origin: [pivot[0] - (c * pivot[0] - s * pivot[1]) + offset[0], pivot[1] - (s * pivot[0] + c * pivot[1]) + offset[1], offset[2] ?? 0],
27
+ c,
28
+ s,
29
+ };
30
+ }
31
+ export function numberTriple(value) {
32
+ if (!Array.isArray(value) || value.length < 2)
33
+ return null;
34
+ const out = [0, 0, 0].map((_, i) => (i < value.length ? value[i] : 0));
35
+ return out.every((v) => typeof v === 'number' && Number.isFinite(v)) ? out : null;
36
+ }
37
+ /** One `IfcLocalPlacement`'s own frame in its parent's, or null when a link does not read. */
38
+ export function readOwnPlacement(read, placementId) {
39
+ const placement = read(placementId);
40
+ const axisPlacementId = asRef(placement?.attributes[1]);
41
+ const axisPlacement = axisPlacementId === null ? null : read(axisPlacementId);
42
+ if (!placement || !axisPlacement)
43
+ return null;
44
+ const locationId = asRef(axisPlacement.attributes[0]);
45
+ const location = locationId === null ? null : numberTriple(read(locationId)?.attributes[0]);
46
+ if (!location)
47
+ return null;
48
+ const direction = (slot) => {
49
+ const id = asRef(slot);
50
+ return id === null ? null : numberTriple(read(id)?.attributes[0]);
51
+ };
52
+ const axis = direction(axisPlacement.attributes[1]);
53
+ const refDirection = direction(axisPlacement.attributes[2]);
54
+ const [dx, dy] = refDirection ?? [1, 0, 0];
55
+ const length = Math.hypot(dx, dy);
56
+ const [c, s] = length > 1e-9 ? [dx / length, dy / length] : [1, 0];
57
+ return { frame: { origin: location, c, s }, parentId: asRef(placement.attributes[0]), location, axis, refDirection };
58
+ }
59
+ /**
60
+ * The frame of `placementId` in `ancestorId`'s frame: every placement from it
61
+ * up to (not including) the ancestor, composed. `placementId === ancestorId`
62
+ * is the identity. Null when the chain does not reach the ancestor (or loops).
63
+ */
64
+ export function frameInAncestor(read, placementId, ancestorId) {
65
+ let frame = IDENTITY_FRAME;
66
+ const visited = new Set();
67
+ let id = placementId;
68
+ while (id !== null && id !== ancestorId) {
69
+ if (visited.has(id))
70
+ return null;
71
+ visited.add(id);
72
+ const own = readOwnPlacement(read, id);
73
+ if (!own)
74
+ return null;
75
+ frame = composeRigid(own.frame, frame);
76
+ id = own.parentId;
77
+ }
78
+ return id === ancestorId ? frame : null;
79
+ }
80
+ /** `v` turned counter-clockwise about the vertical by the frame's turn (directions do not translate). */
81
+ export function turnDirection(f, v) {
82
+ return [f.c * v[0] - f.s * v[1], f.s * v[0] + f.c * v[1], v[2]];
83
+ }
84
+ /** A `#N` reference token, or null. */
85
+ export function refToken(id) {
86
+ return id === null ? null : `#${id}`;
87
+ }
88
+ /** Rewrite every `#old` token in a (possibly nested) attribute value that `ids` maps. */
89
+ export function remapRefs(value, ids) {
90
+ if (Array.isArray(value))
91
+ return value.map((v) => remapRefs(v, ids));
92
+ if (typeof value === 'string') {
93
+ const id = asRef(value);
94
+ const mapped = id === null ? undefined : ids.get(id);
95
+ return mapped === undefined ? value : `#${mapped}`;
96
+ }
97
+ return value;
98
+ }
99
+ //# sourceMappingURL=copy-frame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-frame.js","sourceRoot":"","sources":["../../src/in-store/copy-frame.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAc/D,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAcjD,MAAM,CAAC,MAAM,cAAc,GAAe,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAE5E,MAAM,UAAU,UAAU,CAAC,CAAa,EAAE,CAAoB;IAC5D,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAA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1C,CAAC;AAED,yGAAyG;AACzG,MAAM,UAAU,aAAa,CAAC,CAA8B,EAAE,CAAW;IACvE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,QAAQ,CAAC,EAAiB;IACxC,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AACvC,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,GAAgC;IACxE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAsB,CAAC;IAC1F,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QACxB,MAAM,MAAM,GAAG,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrD,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC;IACrD,CAAC;IACD,OAAO,KAA0B,CAAC;AACpC,CAAC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Copy a product, turned and moved, onto its own storey or another one
3
+ * (#6232 C3, decision D7): the one write behind the Model workspace's paste
4
+ * and array, built on `duplicateInStore`.
5
+ *
6
+ * - Every copy gets fresh GlobalIds (the product, its placement's rels).
7
+ * - The openings that void the product and the doors and windows that fill
8
+ * them are copied with it, and the IfcRelVoidsElement / IfcRelFillsElement
9
+ * are written again between the copies. One placed relative to its host
10
+ * (or its opening) keeps its local placement under the copy's.
11
+ * - A shape created this session is copied record by record (with the
12
+ * styles on its items), so the copy can be reshaped on its own. A shape
13
+ * read from the file is shared by reference, as Duplicate has always
14
+ * done.
15
+ *
16
+ * The turn and move are storey-local metres: a turn counter-clockwise about
17
+ * the vertical through `pivot`, then `offset`. On another storey the copy is
18
+ * placed relative to that storey's placement at the same plan position and
19
+ * height above the floor.
20
+ */
21
+ import { type StoreEditor } from '@ifc-lite/mutations';
22
+ import type { IfcDataStore } from '@ifc-lite/parser';
23
+ import { type RandomSource } from '@ifc-lite/encoding';
24
+ import { type CopyVec3, type LiveRead } from './copy-frame.js';
25
+ export interface CopyTransform {
26
+ /** Move after the turn, storey-local metres (IFC Z-up). */
27
+ readonly offset?: readonly [number, number, number];
28
+ /** Counter-clockwise turn about the vertical, radians. */
29
+ readonly turn?: number;
30
+ /** The plan point the turn is about, storey-local metres. Default: the storey origin. */
31
+ readonly pivot?: readonly [number, number];
32
+ /** The storey the copy goes on. Default: the source's own. */
33
+ readonly targetStoreyId?: number;
34
+ }
35
+ export interface CopyProductResult {
36
+ /** The copy of the product itself. */
37
+ readonly copyId: number;
38
+ readonly openingIds: readonly number[];
39
+ readonly fillingIds: readonly number[];
40
+ /** The copies of the assembly's parts, at every depth. */
41
+ readonly partIds: readonly number[];
42
+ /** Source product id for every copied product, including openings, fillings and assembly parts. */
43
+ readonly copiedFrom: ReadonlyMap<number, number>;
44
+ /** The storey the copy (and its doors and windows) is contained in. */
45
+ readonly storeyId: number | null;
46
+ /** Every element the copy wrote with a shape to mesh: the copy and its doors and windows. */
47
+ readonly meshed: readonly number[];
48
+ }
49
+ interface HostedLink {
50
+ readonly id: number;
51
+ readonly ownerHistory: string | null;
52
+ }
53
+ /** One IfcRelAggregates: the parts of an assembly, and the rel's OwnerHistory. */
54
+ interface PartsLink {
55
+ readonly ownerHistory: string | null;
56
+ readonly parts: readonly number[];
57
+ }
58
+ /**
59
+ * Everything one batch of copies reads once: the live reader, the styles and
60
+ * the void / fill links of the model as it was before the batch.
61
+ */
62
+ export interface CopyContext {
63
+ readonly store: IfcDataStore;
64
+ readonly editor: StoreEditor;
65
+ readonly read: LiveRead;
66
+ readonly guidRandom?: RandomSource;
67
+ readonly styledBy: ReadonlyMap<number, number>;
68
+ readonly voids: ReadonlyMap<number, readonly HostedLink[]>;
69
+ readonly fills: ReadonlyMap<number, readonly HostedLink[]>;
70
+ /** Fillings (door / window id → opening id). */
71
+ readonly filledBy: ReadonlyMap<number, number>;
72
+ /** Assembly id → its IfcRelAggregates parts (a spatial container's children are not parts). */
73
+ readonly parts: ReadonlyMap<number, readonly PartsLink[]>;
74
+ /** Part id → its assembly. */
75
+ readonly partOf: ReadonlyMap<number, number>;
76
+ }
77
+ export declare function createCopyContext(store: IfcDataStore, editor: StoreEditor, options?: {
78
+ guidRandom?: RandomSource;
79
+ }): CopyContext;
80
+ /** Why `sourceId` cannot be copied on its own, or null when it can. */
81
+ export declare function copyRefusal(ctx: CopyContext, sourceId: number): string | null;
82
+ /** Copy the complete product graph. `options.Name` overrides only the root product’s Name. */
83
+ export declare function copyProductInStore(ctx: CopyContext, sourceId: number, transform?: CopyTransform, options?: {
84
+ Name?: string;
85
+ }): CopyProductResult;
86
+ /**
87
+ * Where a product's placement origin is on its storey, metres: the point a
88
+ * paste lines up with the cursor. Null when its placement does not read;
89
+ * throws (with the reason) when it is not tied to its storey, as a copy would.
90
+ */
91
+ export declare function productStoreyOrigin(ctx: CopyContext, id: number): {
92
+ storeyId: number | null;
93
+ origin: CopyVec3;
94
+ } | null;
95
+ export {};
96
+ //# sourceMappingURL=copy-product.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-product.d.ts","sourceRoot":"","sources":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,GAAG,IAAI,CAQ7E;AAED,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAE,aAAkB,EAAE,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,iBAAiB,CAqBxJ;AAiMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,GAAG,IAAI,CAetH"}
@@ -0,0 +1,318 @@
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
+ * Copy a product, turned and moved, onto its own storey or another one
6
+ * (#6232 C3, decision D7): the one write behind the Model workspace's paste
7
+ * and array, built on `duplicateInStore`.
8
+ *
9
+ * - Every copy gets fresh GlobalIds (the product, its placement's rels).
10
+ * - The openings that void the product and the doors and windows that fill
11
+ * them are copied with it, and the IfcRelVoidsElement / IfcRelFillsElement
12
+ * are written again between the copies. One placed relative to its host
13
+ * (or its opening) keeps its local placement under the copy's.
14
+ * - A shape created this session is copied record by record (with the
15
+ * styles on its items), so the copy can be reshaped on its own. A shape
16
+ * read from the file is shared by reference, as Duplicate has always
17
+ * done.
18
+ *
19
+ * The turn and move are storey-local metres: a turn counter-clockwise about
20
+ * the vertical through `pivot`, then `offset`. On another storey the copy is
21
+ * placed relative to that storey's placement at the same plan position and
22
+ * height above the floor.
23
+ */
24
+ import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
25
+ import { generateIfcGuid } from '@ifc-lite/encoding';
26
+ import { duplicateInStore } from './duplicate.js';
27
+ import { resolveDuplicateSource } from './resolve-source.js';
28
+ import { asRef, createStyleEntityReader, indexExistingStyles, refList } from './style-entity-reader.js';
29
+ import { IDENTITY_FRAME, applyRigid, composeRigid, frameInAncestor, invertRigid, readOwnPlacement, refToken, remapRefs, turnDirection, turnThenMove, } from './copy-frame.js';
30
+ /** Classes that are copied with their host, never on their own. */
31
+ const HOSTED_TYPES = new Set(['IFCOPENINGELEMENT', 'IFCOPENINGSTANDARDCASE', 'IFCVOIDINGFEATURE']);
32
+ const SPATIAL_TYPES = new Set(['IFCSPACE', 'IFCBUILDINGSTOREY', 'IFCBUILDING', 'IFCSITE', 'IFCSPATIALZONE', 'IFCEXTERNALSPATIALELEMENT', 'IFCPROJECT']);
33
+ /** A shape bigger than this is not deep-copied (a pathological overlay graph). */
34
+ const MAX_CLONED_SHAPE_RECORDS = 50_000;
35
+ export function createCopyContext(store, editor, options = {}) {
36
+ const read = createStyleEntityReader(store, editor);
37
+ const view = editor.getMutationView();
38
+ const links = (relType) => {
39
+ const out = new Map();
40
+ for (const { expressId } of iterateEffectiveEntityIds(store, view, [relType])) {
41
+ const rel = read(expressId);
42
+ const relating = asRef(rel?.attributes[4]);
43
+ const related = asRef(rel?.attributes[5]);
44
+ if (relating === null || related === null)
45
+ continue;
46
+ const list = out.get(relating) ?? [];
47
+ list.push({ id: related, ownerHistory: refToken(asRef(rel?.attributes[1])) });
48
+ out.set(relating, list);
49
+ }
50
+ return out;
51
+ };
52
+ const fills = links('IFCRELFILLSELEMENT');
53
+ const filledBy = new Map();
54
+ for (const [opening, list] of fills)
55
+ for (const { id } of list)
56
+ filledBy.set(id, opening);
57
+ const parts = new Map();
58
+ const partOf = new Map();
59
+ for (const { expressId } of iterateEffectiveEntityIds(store, view, ['IFCRELAGGREGATES'])) {
60
+ const rel = read(expressId);
61
+ const whole = asRef(rel?.attributes[4]);
62
+ const wholeType = whole === null ? undefined : read(whole)?.type.toUpperCase();
63
+ if (whole === null || !wholeType || SPATIAL_TYPES.has(wholeType))
64
+ continue;
65
+ const related = refList(rel?.attributes[5]);
66
+ if (related.length === 0)
67
+ continue;
68
+ const list = parts.get(whole) ?? [];
69
+ list.push({ ownerHistory: refToken(asRef(rel?.attributes[1])), parts: related });
70
+ parts.set(whole, list);
71
+ for (const part of related)
72
+ partOf.set(part, whole);
73
+ }
74
+ return {
75
+ store, editor, read, guidRandom: options.guidRandom,
76
+ styledBy: indexExistingStyles(store, editor, read),
77
+ voids: links('IFCRELVOIDSELEMENT'),
78
+ fills,
79
+ filledBy,
80
+ parts,
81
+ partOf,
82
+ };
83
+ }
84
+ /** Why `sourceId` cannot be copied on its own, or null when it can. */
85
+ export function copyRefusal(ctx, sourceId) {
86
+ const type = ctx.read(sourceId)?.type.toUpperCase();
87
+ if (!type)
88
+ return `#${sourceId} is not in the model`;
89
+ if (HOSTED_TYPES.has(type))
90
+ return 'An opening is copied with the element it is cut into: copy that element';
91
+ if (ctx.filledBy.has(sourceId))
92
+ return 'A door or window is copied with its wall: copy the wall';
93
+ if (ctx.partOf.has(sourceId))
94
+ return 'A part is copied with its assembly: copy the assembly';
95
+ if (SPATIAL_TYPES.has(type))
96
+ return 'Spaces and spatial structure are not copied: copy the elements';
97
+ return null;
98
+ }
99
+ /** Copy the complete product graph. `options.Name` overrides only the root product’s Name. */
100
+ export function copyProductInStore(ctx, sourceId, transform = {}, options = {}) {
101
+ const refusal = copyRefusal(ctx, sourceId);
102
+ if (refusal)
103
+ throw new Error(refusal);
104
+ const source = resolveDuplicateSource(ctx.store, sourceId, ctx.editor);
105
+ const scale = source.lengthUnitScale && source.lengthUnitScale > 0 ? source.lengthUnitScale : 1;
106
+ const native = (m) => m / scale;
107
+ const [ox, oy, oz] = transform.offset ?? [0, 0, 0];
108
+ const [px, py] = transform.pivot ?? [0, 0];
109
+ const move = turnThenMove(transform.turn ?? 0, [native(px), native(py)], [native(ox), native(oy), native(oz)]);
110
+ const targetStoreyId = transform.targetStoreyId ?? source.storeyId;
111
+ const placed = placeOnStorey(ctx.read, source, targetStoreyId, move);
112
+ const copy = writeCopy(ctx, source, placed, targetStoreyId, options.Name);
113
+ // Openings, their doors and windows, and the parts of an assembly follow it.
114
+ const acc = { placements: new Map([[source.placementExpressId, copy.placementId]]), openingIds: [], fillingIds: [], partIds: [], visited: new Set([sourceId]), copiedFrom: new Map([[copy.id, sourceId]]) };
115
+ copyDependents(ctx, sourceId, copy.id, source, targetStoreyId, move, acc);
116
+ return {
117
+ copyId: copy.id, openingIds: acc.openingIds, fillingIds: acc.fillingIds, partIds: acc.partIds, storeyId: targetStoreyId,
118
+ meshed: [copy.id, ...acc.partIds, ...acc.fillingIds], copiedFrom: acc.copiedFrom,
119
+ };
120
+ }
121
+ /** The copies of `sourceId`'s openings (with their doors and windows) and parts (recursively), written under `copyId`. */
122
+ function copyDependents(ctx, sourceId, copyId, root, targetStoreyId, move, acc) {
123
+ for (const opening of ctx.voids.get(sourceId) ?? []) {
124
+ const openingSource = resolveDuplicateSource(ctx.store, opening.id, ctx.editor);
125
+ const openingCopy = writeCopy(ctx, openingSource, follow(ctx.read, openingSource, root, targetStoreyId, acc.placements, move), null);
126
+ acc.placements.set(openingSource.placementExpressId, openingCopy.placementId);
127
+ acc.copiedFrom.set(openingCopy.id, opening.id);
128
+ relate(ctx, 'IfcRelVoidsElement', opening.ownerHistory, copyId, openingCopy.id);
129
+ acc.openingIds.push(openingCopy.id);
130
+ for (const filling of ctx.fills.get(opening.id) ?? []) {
131
+ const fillingSource = resolveDuplicateSource(ctx.store, filling.id, ctx.editor);
132
+ const fillingCopy = writeCopy(ctx, fillingSource, follow(ctx.read, fillingSource, root, targetStoreyId, acc.placements, move), targetStoreyId);
133
+ acc.placements.set(fillingSource.placementExpressId, fillingCopy.placementId);
134
+ acc.copiedFrom.set(fillingCopy.id, filling.id);
135
+ relate(ctx, 'IfcRelFillsElement', filling.ownerHistory, openingCopy.id, fillingCopy.id);
136
+ acc.fillingIds.push(fillingCopy.id);
137
+ }
138
+ }
139
+ for (const link of ctx.parts.get(sourceId) ?? []) {
140
+ const partCopies = [];
141
+ for (const part of link.parts) {
142
+ if (acc.visited.has(part))
143
+ continue;
144
+ acc.visited.add(part);
145
+ const partSource = resolveDuplicateSource(ctx.store, part, ctx.editor);
146
+ // A part is aggregated, not contained: no containment of its own.
147
+ const partCopy = writeCopy(ctx, partSource, follow(ctx.read, partSource, root, targetStoreyId, acc.placements, move), null);
148
+ acc.placements.set(partSource.placementExpressId, partCopy.placementId);
149
+ acc.copiedFrom.set(partCopy.id, part);
150
+ partCopies.push(partCopy.id);
151
+ acc.partIds.push(partCopy.id);
152
+ copyDependents(ctx, part, partCopy.id, root, targetStoreyId, move, acc);
153
+ }
154
+ if (partCopies.length > 0) {
155
+ ctx.editor.addEntity('IfcRelAggregates', [generateIfcGuid(ctx.guidRandom), link.ownerHistory, null, null, `#${copyId}`, partCopies.map((id) => `#${id}`)]);
156
+ }
157
+ }
158
+ }
159
+ function storeyPlacementId(read, storeyId) {
160
+ return storeyId === null ? null : asRef(read(storeyId)?.attributes[5]);
161
+ }
162
+ /**
163
+ * The source's parent placement as a frame in its storey's. A storey without a
164
+ * placement has no frame to tie to (the storey plane is then the model frame).
165
+ * A parent that does not chain to the storey's placement has no known place on
166
+ * the storey, so the copy is refused: the preview (`copy-ghost.ts`) works in
167
+ * the storey's frame, and a guess here would commit the copy somewhere else.
168
+ */
169
+ function parentFrameInStorey(read, source, fromStorey) {
170
+ if (fromStorey === null)
171
+ return IDENTITY_FRAME;
172
+ const parent = frameInAncestor(read, source.parentPlacementId, fromStorey);
173
+ if (!parent)
174
+ throw new Error(`#${source.placementExpressId}: its placement is not tied to its storey's, so it cannot be copied`);
175
+ return parent;
176
+ }
177
+ function placeOnStorey(read, source, targetStoreyId, move) {
178
+ const own = readOwnPlacement(read, source.placementExpressId);
179
+ if (!own)
180
+ throw new Error(`#${source.placementExpressId}: the placement does not read as a local placement`);
181
+ const fromStorey = storeyPlacementId(read, source.storeyId);
182
+ const parent = parentFrameInStorey(read, source, fromStorey);
183
+ if (targetStoreyId === source.storeyId) {
184
+ const location = applyRigid(invertRigid(parent), applyRigid(move, applyRigid(parent, own.location)));
185
+ return { parentPlacementId: source.parentPlacementId, location, turn: move };
186
+ }
187
+ const toStorey = storeyPlacementId(read, targetStoreyId);
188
+ if (toStorey === null) {
189
+ throw new Error(`#${source.placementExpressId}: the storey it is copied to has no placement to copy under`);
190
+ }
191
+ // Same plan position and height above the floor, now under the other storey's placement.
192
+ return { parentPlacementId: toStorey, location: applyRigid(move, applyRigid(parent, own.location)), turn: composeRigid(move, parent) };
193
+ }
194
+ /**
195
+ * A hosted element: under the copy of the placement it was placed relative
196
+ * to, unchanged; otherwise moved as its host was, on the host's storey (an
197
+ * opening is not contained in one of its own).
198
+ */
199
+ function follow(read, source, host, targetStoreyId, placements, move) {
200
+ const mapped = source.parentPlacementId === null ? undefined : placements.get(source.parentPlacementId);
201
+ if (mapped !== undefined)
202
+ return { parentPlacementId: mapped, location: [...source.sourceLocation], turn: IDENTITY_FRAME };
203
+ return placeOnStorey(read, { ...source, storeyId: host.storeyId }, targetStoreyId, move);
204
+ }
205
+ function writeCopy(ctx, source, placed, storeyId, name) {
206
+ const turned = Math.abs(placed.turn.s) > 1e-12 || placed.turn.c < 0;
207
+ const own = turned ? readOwnPlacement(ctx.read, source.placementExpressId) : null;
208
+ const direction = (v, fallback) => {
209
+ const base = v ?? fallback;
210
+ if (!base)
211
+ return null;
212
+ return `#${ctx.editor.addEntity('IfcDirection', [turnDirection(placed.turn, base)]).expressId}`;
213
+ };
214
+ const attributes = [...source.attributes];
215
+ const shape = cloneCreatedShape(ctx, source.representationId);
216
+ if (shape !== null)
217
+ attributes[6] = `#${shape}`;
218
+ const built = duplicateInStore(ctx.editor, {
219
+ ...source,
220
+ attributes,
221
+ sourceLocation: placed.location,
222
+ parentPlacementId: placed.parentPlacementId,
223
+ storeyId,
224
+ // An upright Axis does not change under a turn about the vertical.
225
+ axisRef: own && own.axis && (Math.abs(own.axis[0]) > 1e-12 || Math.abs(own.axis[1]) > 1e-12) ? direction(own.axis, null) : source.axisRef,
226
+ refDirectionRef: own ? direction(own.refDirection, [1, 0, 0]) : source.refDirectionRef,
227
+ lengthUnitScale: 1,
228
+ }, {
229
+ offset: [0, 0, 0],
230
+ // A copy is the same element again: it keeps the source's Name.
231
+ name: name ?? (typeof source.attributes[2] === 'string' ? source.attributes[2] : undefined),
232
+ guidRandom: ctx.guidRandom,
233
+ });
234
+ return { id: built.newId, placementId: built.newPlacementId };
235
+ }
236
+ function relate(ctx, type, ownerHistory, relating, related) {
237
+ ctx.editor.addEntity(type, [generateIfcGuid(ctx.guidRandom), ownerHistory, null, null, `#${relating}`, `#${related}`]);
238
+ }
239
+ /**
240
+ * Copy a shape created this session, record by record, with the styles on
241
+ * its items; null when the shape is the file's own (it is then shared).
242
+ * Records the file holds (a representation context) stay shared references.
243
+ */
244
+ function cloneCreatedShape(ctx, shapeId) {
245
+ const view = ctx.editor.getMutationView();
246
+ const created = (id) => view.getNewEntity(id) !== null && !view.isDeleted(id);
247
+ if (shapeId === null || !created(shapeId))
248
+ return null;
249
+ const copies = new Map();
250
+ const expanded = new Set();
251
+ // Iterative post-order: children are written before the records that name them.
252
+ const stack = [shapeId];
253
+ while (stack.length > 0) {
254
+ const id = stack[stack.length - 1];
255
+ const record = copies.has(id) ? null : ctx.read(id);
256
+ if (!record) {
257
+ stack.pop();
258
+ continue;
259
+ }
260
+ if (!expanded.has(id)) {
261
+ expanded.add(id);
262
+ if (expanded.size > MAX_CLONED_SHAPE_RECORDS)
263
+ throw new Error(`The shape of this element is too large to copy (over ${MAX_CLONED_SHAPE_RECORDS} records)`);
264
+ for (const child of childRefs(record.attributes))
265
+ if (created(child) && !expanded.has(child))
266
+ stack.push(child);
267
+ continue;
268
+ }
269
+ stack.pop();
270
+ copies.set(id, ctx.editor.addEntity(record.type, record.attributes.map((a) => remapRefs(a, copies))).expressId);
271
+ }
272
+ for (const [from, to] of copies) {
273
+ const styledItem = ctx.styledBy.get(from);
274
+ const style = styledItem === undefined ? null : ctx.read(styledItem);
275
+ // IfcStyledItem(Item, Styles, Name): the same styles, on the copied item.
276
+ if (style)
277
+ ctx.editor.addEntity('IfcStyledItem', [`#${to}`, refList(style.attributes[1]).map((id) => `#${id}`), (style.attributes[2] ?? null)]);
278
+ }
279
+ return copies.get(shapeId) ?? null;
280
+ }
281
+ function childRefs(values) {
282
+ const out = [];
283
+ const visit = (value) => {
284
+ if (Array.isArray(value))
285
+ value.forEach(visit);
286
+ else if (typeof value === 'string') {
287
+ const id = asRef(value);
288
+ if (id !== null)
289
+ out.push(id);
290
+ }
291
+ };
292
+ values.forEach(visit);
293
+ return out;
294
+ }
295
+ /**
296
+ * Where a product's placement origin is on its storey, metres: the point a
297
+ * paste lines up with the cursor. Null when its placement does not read;
298
+ * throws (with the reason) when it is not tied to its storey, as a copy would.
299
+ */
300
+ export function productStoreyOrigin(ctx, id) {
301
+ let source;
302
+ try {
303
+ source = resolveDuplicateSource(ctx.store, id, ctx.editor);
304
+ }
305
+ catch (error) {
306
+ console.warn(`[create] #${id} has no readable placement to copy from`, error);
307
+ return null;
308
+ }
309
+ const own = readOwnPlacement(ctx.read, source.placementExpressId);
310
+ if (!own)
311
+ return null;
312
+ const fromStorey = storeyPlacementId(ctx.read, source.storeyId);
313
+ const parent = parentFrameInStorey(ctx.read, source, fromStorey);
314
+ const scale = source.lengthUnitScale && source.lengthUnitScale > 0 ? source.lengthUnitScale : 1;
315
+ const [x, y, z] = applyRigid(parent, own.location);
316
+ return { storeyId: source.storeyId, origin: [x * scale, y * scale, z * scale] };
317
+ }
318
+ //# sourceMappingURL=copy-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-product.js","sourceRoot":"","sources":["../../src/in-store/copy-product.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,yBAAyB,EAA4C,MAAM,qBAAqB,CAAC;AAE1G,OAAO,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,gBA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IAC7D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,yCAAyC,EAAE,KAAK,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,GAAG,GAAG,gBAAgB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAClE,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAChG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;AAClF,CAAC"}
@@ -0,0 +1,87 @@
1
+ import type { StoreEditor } from '@ifc-lite/mutations';
2
+ import { type SpatialAnchor } from './anchor.js';
3
+ import { type ProfileSection } from './profile.js';
4
+ /** A grid direction: a bay count (equal bays), or the interior grid lines' offsets (metres). */
5
+ export type CurtainWallGridSpec = number | readonly number[];
6
+ export interface CurtainWallInStoreParams {
7
+ /** Start of the base line, storey-local (metres). Its Z is the base elevation. */
8
+ Start: [number, number, number];
9
+ /** End of the base line, storey-local (metres). Same Z as `Start`. */
10
+ End: [number, number, number];
11
+ /** Height above the base line (metres). */
12
+ Height: number;
13
+ /**
14
+ * Vertical grid lines along the path: a bay count, or the interior lines'
15
+ * distances from `Start` (strictly increasing, inside the length).
16
+ * Default: equal bays no wider than 1.5 m.
17
+ */
18
+ UGrid?: CurtainWallGridSpec;
19
+ /**
20
+ * Horizontal grid lines up the wall: a bay count, or the interior lines'
21
+ * heights above the base (strictly increasing, inside the height).
22
+ * Default: 1 (no intermediate transom).
23
+ */
24
+ VGrid?: CurtainWallGridSpec;
25
+ /** Mullion section. Default: a 50 x 150 mm rectangle (in-plane x depth). */
26
+ MullionProfile?: ProfileSection;
27
+ /** Transom section. Default: `MullionProfile`. */
28
+ TransomProfile?: ProfileSection;
29
+ /** Panel thickness (metres). Default 0.024. */
30
+ PanelThickness?: number;
31
+ /** Frame the perimeter with edge mullions and transoms. Default true. */
32
+ EdgeMembers?: boolean;
33
+ /** IfcCurtainWall PredefinedType (IFC4+). Default `NOTDEFINED`. */
34
+ PredefinedType?: 'USERDEFINED' | 'NOTDEFINED';
35
+ Name?: string;
36
+ Description?: string;
37
+ ObjectType?: string;
38
+ Tag?: string;
39
+ /** Explicit GlobalId for the IfcCurtainWall (22-char IFC GUID); generated when omitted. Parts always get fresh ones. */
40
+ GlobalId?: string;
41
+ }
42
+ /** A member or panel of the layout, in the curtain wall's frame (metres): u along the path, v up. */
43
+ export interface CurtainWallLayout {
44
+ length: number;
45
+ height: number;
46
+ /** U grid lines, 0 and the length included. */
47
+ uLines: number[];
48
+ /** V grid lines, 0 and the height included. */
49
+ vLines: number[];
50
+ /** Mullion centre lines (u), each full height. */
51
+ mullions: number[];
52
+ /** Transoms: centre height v, spanning u0 -> u1 between mullion faces. */
53
+ transoms: Array<{
54
+ v: number;
55
+ u0: number;
56
+ u1: number;
57
+ }>;
58
+ /** Panels: the clear openings between member faces. */
59
+ panels: Array<{
60
+ u0: number;
61
+ u1: number;
62
+ v0: number;
63
+ v1: number;
64
+ }>;
65
+ }
66
+ export interface CurtainWallBuildResult {
67
+ curtainWallId: number;
68
+ placementId: number;
69
+ /** IfcMember ids, in `layout.mullions` order. */
70
+ mullionIds: number[];
71
+ /** IfcMember ids, in `layout.transoms` order. */
72
+ transomIds: number[];
73
+ /** IfcPlate ids, in `layout.panels` order. */
74
+ panelIds: number[];
75
+ mullionProfileId: number;
76
+ transomProfileId: number;
77
+ relAggregatesId: number;
78
+ relContainedId: number;
79
+ layout: CurtainWallLayout;
80
+ }
81
+ /**
82
+ * The curtain wall's members and panels, in metres, without emitting anything.
83
+ * Refuses a layout whose members leave no clear opening.
84
+ */
85
+ export declare function curtainWallLayout(params: CurtainWallInStoreParams, op?: string): CurtainWallLayout;
86
+ export declare function addCurtainWallToStore(editor: StoreEditor, anchor: SpatialAnchor, params: CurtainWallInStoreParams): CurtainWallBuildResult;
87
+ //# sourceMappingURL=curtain-wall.d.ts.map