@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,48 @@
1
+ /**
2
+ * Wall-hosted IfcDoor / IfcWindow: cut an IfcOpeningElement into the host
3
+ * wall (`addOpeningToStore`), then place the filling in it and link the two
4
+ * with IfcRelFillsElement — the in-store counterpart of
5
+ * `IfcCreator.addIfcWallDoor` / `addIfcWallWindow`.
6
+ *
7
+ * The filling's ObjectPlacement is relative to the OPENING's placement, so
8
+ * moving the opening along its host carries the door or window with it. Its
9
+ * own frame is the conventional one for a door or window: X along the wall,
10
+ * Y across the wall, Z up. The leaf is `Width × FrameThickness` centred in
11
+ * the wall's body and extruded up by `Height`. The filling is contained in
12
+ * the host's storey; the opening, per IFC, is not.
13
+ */
14
+ import type { StoreEditor } from '@ifc-lite/mutations';
15
+ import { type HostAnchor } from './anchor.js';
16
+ import { type OpeningBuildResult } from './opening.js';
17
+ import { type DoorInStoreParams } from './door.js';
18
+ import { type WindowInStoreParams } from './window.js';
19
+ interface HostedPlacementParams {
20
+ /** Distance along the host wall's local X from its placement origin to the filling's centre (metres). */
21
+ Offset: number;
22
+ /** Length of the opening cut through the wall (metres). Defaults to the wall's body thickness + 2 × 50 mm. */
23
+ CutDepth?: number;
24
+ }
25
+ export interface HostedDoorInStoreParams extends Omit<DoorInStoreParams, 'Position'>, HostedPlacementParams {
26
+ /** Height of the door's bottom above the wall's placement origin (metres). Defaults to 0. */
27
+ Sill?: number;
28
+ }
29
+ export interface HostedWindowInStoreParams extends Omit<WindowInStoreParams, 'Position'>, HostedPlacementParams {
30
+ /** Height of the window's bottom edge above the wall's placement origin (metres). */
31
+ Sill: number;
32
+ }
33
+ export interface HostedFillBuildResult {
34
+ /** The IfcDoor or IfcWindow. */
35
+ fillingId: number;
36
+ placementId: number;
37
+ profileId: number;
38
+ solidId: number;
39
+ shapeRepId: number;
40
+ productShapeId: number;
41
+ relContainedId: number;
42
+ relFillsId: number;
43
+ opening: OpeningBuildResult;
44
+ }
45
+ export declare function addHostedDoorToStore(editor: StoreEditor, host: HostAnchor, params: HostedDoorInStoreParams): HostedFillBuildResult;
46
+ export declare function addHostedWindowToStore(editor: StoreEditor, host: HostAnchor, params: HostedWindowInStoreParams): HostedFillBuildResult;
47
+ export {};
48
+ //# sourceMappingURL=hosted-fill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-fill.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-fill.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAW9D,OAAO,EAAqB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE5E,UAAU,qBAAqB;IAC7B,yGAAyG;IACzG,MAAM,EAAE,MAAM,CAAC;IACf,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,EAAE,qBAAqB;IACzG,6FAA6F;IAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,EAAE,qBAAqB;IAC7G,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,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;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,uBAAuB,GAC9B,qBAAqB,CAEvB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,yBAAyB,GAChC,qBAAqB,CAEvB"}
@@ -0,0 +1,58 @@
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 { generateIfcGuid } from '@ifc-lite/encoding';
5
+ import { toNativeLength } from './anchor.js';
6
+ import { assertPositiveFinite, emitBodyRepresentation, emitExtrudedSolid, emitLocalPlacement, emitRectangleProfile, emitRelContainedInSpatialStructure, ifcElementHeader, ownerHistoryRef, } from './_emit-helpers.js';
7
+ import { addOpeningToStore } from './opening.js';
8
+ import { doorAttributeTail } from './door.js';
9
+ import { windowAttributeTail } from './window.js';
10
+ export function addHostedDoorToStore(editor, host, params) {
11
+ return addHostedFill(editor, host, 'IfcDoor', params.Sill ?? 0, params, (native) => doorAttributeTail(host.schema, { ...params, ...native }));
12
+ }
13
+ export function addHostedWindowToStore(editor, host, params) {
14
+ return addHostedFill(editor, host, 'IfcWindow', params.Sill, params, (native) => windowAttributeTail(host.schema, { ...params, ...native }));
15
+ }
16
+ function addHostedFill(editor, host, type, sill, params, tail) {
17
+ const op = type === 'IfcDoor' ? 'addHostedDoorToStore' : 'addHostedWindowToStore';
18
+ if (host.hostKind !== 'wall')
19
+ throw new Error(`${op}: host #${host.hostId} is a ${host.hostKind}; doors and windows are hosted in walls`);
20
+ assertPositiveFinite([params.Width, params.Height], `${op}: Width and Height must be positive`);
21
+ const frameThickness = params.FrameThickness ?? 0.05;
22
+ assertPositiveFinite([frameThickness], `${op}: FrameThickness must be positive`);
23
+ if (!Number.isFinite(params.Offset) || !Number.isFinite(sill))
24
+ throw new Error(`${op}: Offset and Sill must be finite`);
25
+ const label = type === 'IfcDoor' ? 'Door' : 'Window';
26
+ const opening = addOpeningToStore(editor, host, {
27
+ Offset: params.Offset,
28
+ Sill: sill,
29
+ Width: params.Width,
30
+ Height: params.Height,
31
+ CutDepth: params.CutDepth,
32
+ Name: `${params.Name ?? label} Opening`,
33
+ });
34
+ // The opening's frame is X = wall X, Y = wall Z, Z = wall -Y, with its
35
+ // origin on the cut's +Y face. Axis = opening Y and RefDirection = opening
36
+ // X turn that back into X along the wall, Z up; the origin moves half the
37
+ // cut into the wall, i.e. onto the body's centre plane.
38
+ const placementId = emitLocalPlacement(editor, opening.placementId, [0, 0, opening.cutDepth / 2], [0, 1, 0], [1, 0, 0]);
39
+ const width = toNativeLength(host, params.Width);
40
+ const height = toNativeLength(host, params.Height);
41
+ const profileId = emitRectangleProfile(editor, width, toNativeLength(host, frameThickness));
42
+ const solidId = emitExtrudedSolid(editor, profileId, height);
43
+ const { shapeRepId, productShapeId } = emitBodyRepresentation(editor, host.bodyContextId, solidId);
44
+ const attrs = ifcElementHeader(host.ownerHistoryId, placementId, productShapeId, params, label, host.guidRandom);
45
+ attrs.push(...tail({ Width: width, Height: height }));
46
+ const fillingId = editor.addEntity(type, attrs).expressId;
47
+ const relFillsId = editor.addEntity('IfcRelFillsElement', [
48
+ generateIfcGuid(host.guidRandom),
49
+ ownerHistoryRef(host.ownerHistoryId),
50
+ null,
51
+ null,
52
+ `#${opening.openingId}`,
53
+ `#${fillingId}`,
54
+ ]).expressId;
55
+ const relContainedId = emitRelContainedInSpatialStructure(editor, host.ownerHistoryId, fillingId, host.storeyId, host.guidRandom);
56
+ return { fillingId, placementId, profileId, solidId, shapeRepId, productShapeId, relContainedId, relFillsId, opening };
57
+ }
58
+ //# sourceMappingURL=hosted-fill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-fill.js","sourceRoot":"","sources":["../../src/in-store/hosted-fill.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiB/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAmB,MAAM,aAAa,CAAC;AAC9D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,kCAAkC,EAClC,gBAAgB,EAChB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA2B,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAA0B,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAA4B,MAAM,aAAa,CAAC;AAgC5E,MAAM,UAAU,oBAAoB,CAClC,MAAmB,EACnB,IAAgB,EAChB,MAA+B;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sB,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAEnG,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACjH,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,KAAgD,CAAC,CAAC,SAAS,CAAC;IAErG,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,EAAE;QACxD,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC;QAChC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC;QACpC,IAAI;QACJ,IAAI;QACJ,IAAI,OAAO,CAAC,SAAS,EAAE;QACvB,IAAI,SAAS,EAAE;KAChB,CAAC,CAAC,SAAS,CAAC;IACb,MAAM,cAAc,GAAG,kCAAkC,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAElI,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AACzH,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** #6232 / #6539: immutable source ownership is indexed once on demand;
2
+ * effective ownership is always rechecked through the live overlay. */
3
+ import { type IfcDataStore } from '@ifc-lite/parser';
4
+ import { type MutablePropertyView } from '@ifc-lite/mutations';
5
+ /** A deleted, renamed or retyped original owner does not reserve its old
6
+ * GUID. Live named/positional overrides and creations can introduce an owner. */
7
+ export declare function assertHostedGlobalIdAvailable(store: IfcDataStore, view: MutablePropertyView, globalId: string): void;
8
+ //# sourceMappingURL=hosted-global-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-global-id.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-global-id.ts"],"names":[],"mappings":"AAIA;uEACuE;AACvE,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAsC1F;iFACiF;AACjF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAYpH"}
@@ -0,0 +1,53 @@
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
+ /** #6232 / #6539: immutable source ownership is indexed once on demand;
5
+ * effective ownership is always rechecked through the live overlay. */
6
+ import { getAttributeNamesForSchema } from '@ifc-lite/parser';
7
+ import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
8
+ import { AnchorEntityReader } from './resolve-anchor.js';
9
+ const indices = new WeakMap();
10
+ function sourceOwners(store) {
11
+ const cached = indices.get(store);
12
+ // @raw-entity-enumeration-ok Cache identity compares the immutable source index; effective ownership is rechecked below.
13
+ if (cached?.entities === store.entities && cached.byId === store.entityIndex.byId && cached.schema === store.schemaVersion) {
14
+ return cached.owners;
15
+ }
16
+ // The display table's GlobalId index omits relationship GUIDs. Index ALL
17
+ // schema-declared IfcRoot classes, never unrelated points/geometry records.
18
+ // @raw-entity-enumeration-ok Source class keys seed the immutable IfcRoot GUID index; live retypes and creations are checked separately.
19
+ const rootTypes = [...store.entityIndex.byType.keys()].filter(type => getAttributeNamesForSchema(type, store.schemaVersion)[0] === 'GlobalId');
20
+ const reader = new AnchorEntityReader(store, null);
21
+ const owners = new Map();
22
+ // An empty type filter means every entity to the canonical iterator.
23
+ const roots = rootTypes.length ? iterateEffectiveEntityIds(store, null, rootTypes) : [];
24
+ for (const { expressId } of roots) {
25
+ const guid = reader.entity(expressId)?.attributes[0];
26
+ if (typeof guid !== 'string')
27
+ continue;
28
+ const ids = owners.get(guid);
29
+ if (ids)
30
+ ids.push(expressId);
31
+ else
32
+ owners.set(guid, [expressId]);
33
+ }
34
+ // @raw-entity-enumeration-ok Retain source-index identity only for cache invalidation, never as live session membership.
35
+ indices.set(store, { entities: store.entities, byId: store.entityIndex.byId, schema: store.schemaVersion, owners });
36
+ return owners;
37
+ }
38
+ /** A deleted, renamed or retyped original owner does not reserve its old
39
+ * GUID. Live named/positional overrides and creations can introduce an owner. */
40
+ export function assertHostedGlobalIdAvailable(store, view, globalId) {
41
+ const candidates = new Set([
42
+ ...(sourceOwners(store).get(globalId) ?? []),
43
+ ...view.getAttributeOverrideEntityIds(),
44
+ ]);
45
+ const reader = new AnchorEntityReader(store, view);
46
+ for (const { expressId } of iterateEffectiveEntityIds(store, view, undefined, candidates)) {
47
+ const entity = reader.entity(expressId);
48
+ if (entity?.names[0] === 'GlobalId' && entity.attributes[0] === globalId) {
49
+ throw new Error(`GlobalId '${globalId}' is already used by #${expressId}`);
50
+ }
51
+ }
52
+ }
53
+ //# sourceMappingURL=hosted-global-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-global-id.js","sourceRoot":"","sources":["../../src/in-store/hosted-global-id.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;uEACuE;AACvE,OAAO,EAAE,0BAA0B,EAAqB,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAA4B,MAAM,qBAAqB,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAQzD,MAAM,OAAO,GAAG,IAAI,OAAO,EAA8B,CAAC;AAE1D,SAAS,YAAY,CAAC,KAAmB;IACvC,MAAM,MAAM,GAAG,OAAO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C,CAAC;IACrC,CAAC;IACD,yHAAyH;IACzH,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC;IACpH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;iFACiF;AACjF,MAAM,UAAU,6BAA6B,CAAC,KAAmB,EAAE,IAAyB,EAAE,QAAgB;IAC5G,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;QACzB,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC5C,GAAG,IAAI,CAAC,6BAA6B,EAAE;KACxC,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACnD,KAAK,MAAM,EAAE,SAAS,EAAE,IAAI,yBAAyB,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC;QAC1F,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACxC,IAAI,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YACzE,MAAM,IAAI,KAAK,CAAC,aAAa,QAAQ,yBAAyB,SAAS,EAAE,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,30 @@
1
+ /** One fresh-placement writer for hosted moves and host reanchoring (#6232).
2
+ * Source Location/RelativePlacement records can be shared across hosts. */
3
+ import type { IfcDataStore } from '@ifc-lite/parser';
4
+ import type { StoreEditor } from '@ifc-lite/mutations';
5
+ import { AnchorEntityReader } from './resolve-anchor.js';
6
+ import { type HostedFillRead } from './hosted-fill-read.js';
7
+ import { type Vec3 } from './host-geometry-frame.js';
8
+ /** A fresh placement prevents a shared source Location/RelativePlacement
9
+ * from moving another occurrence. A filling directly follows its opening. */
10
+ export declare function moveHostedOpeningPlacement(reader: AnchorEntityReader, editor: StoreEditor, read: HostedFillRead, next: Vec3, targetHostId?: number): void;
11
+ export interface HostedOpeningReassignment {
12
+ readonly openingId: number;
13
+ readonly hostId: number;
14
+ /** Opening origin in the target host frame, in native file units. */
15
+ readonly location: Vec3;
16
+ }
17
+ /** Apply a validated split/rehost plan atomically. Every opening, filling and
18
+ * void relation keeps its identity; only the selected occurrence receives
19
+ * fresh placements and its void relation's host changes. Source placement
20
+ * records stay untouched. The caller decides the final host/fit for all cuts;
21
+ * this batch never validates against intermediate single-move positions. */
22
+ export declare function reassignHostedOpeningsInStore(store: IfcDataStore, editor: StoreEditor, sourceHostId: number, moves: readonly HostedOpeningReassignment[]): void;
23
+ /** Reanchor every opening after a host-origin translation. `shift` is the
24
+ * host's origin displacement in its own frame, in native file units. The
25
+ * caller validates the final host body before changing its placement.
26
+ * Reanchor the whole batch without applying single-move fit/overlap checks
27
+ * to transient positions; the cuts keep their relative positions and shape.
28
+ * Unreadable cuts or placements refuse with no surviving writes. */
29
+ export declare function reanchorHostedOpeningsInStore(store: IfcDataStore, editor: StoreEditor, hostId: number, shift: Vec3): void;
30
+ //# sourceMappingURL=hosted-placement-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-placement-edit.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-placement-edit.ts"],"names":[],"mappings":"AAIA;2EAC2E;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAsC,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIzF;6EAC6E;AAC7E,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,SAAc,GAAG,IAAI,CA0C9J;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;CACzB;AAED;;;;4EAI4E;AAC5E,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,yBAAyB,EAAE,GAC1G,IAAI,CA8BN;AAED;;;;;oEAKoE;AACpE,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GACpE,IAAI,CAYN"}
@@ -0,0 +1,123 @@
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 { AnchorEntityReader } from './resolve-anchor.js';
5
+ import { readHostOpeningExtents } from './hosted-element.js';
6
+ import { readHostedOpeningBatch } from './hosted-fill-read.js';
7
+ import { axis3d, placementInAncestor, refId } from './host-geometry-frame.js';
8
+ const ref = (id) => `#${id}`;
9
+ /** A fresh placement prevents a shared source Location/RelativePlacement
10
+ * from moving another occurrence. A filling directly follows its opening. */
11
+ export function moveHostedOpeningPlacement(reader, editor, read, next, targetHostId = read.hostId) {
12
+ if (next.length !== 3 || !next.every(Number.isFinite))
13
+ throw new Error('The opening location must contain three finite native lengths');
14
+ const opening = reader.entity(read.openingId);
15
+ const oldPlacementId = refId(opening.attributes[5]);
16
+ const oldPlacement = oldPlacementId === null ? null : reader.entity(oldPlacementId);
17
+ const oldAxisId = oldPlacement ? refId(oldPlacement.attributes[1]) : null;
18
+ const oldAxis = oldAxisId === null ? null : reader.entity(oldAxisId);
19
+ const parent = oldPlacement ? refId(oldPlacement.attributes[0]) : null;
20
+ const host = reader.entity(read.hostId);
21
+ const hostPlacement = host ? refId(host.attributes[5]) : null;
22
+ if (!oldAxis || parent === null || hostPlacement !== parent || oldPlacementId === null
23
+ || !placementInAncestor(reader, oldPlacementId, parent))
24
+ throw new Error('The opening placement cannot be edited safely');
25
+ const targetHost = reader.entity(targetHostId);
26
+ const targetPlacementId = targetHost ? refId(targetHost.attributes[5]) : null;
27
+ const targetPlacement = targetPlacementId === null ? null : reader.entity(targetPlacementId);
28
+ const targetAxisId = targetPlacement ? refId(targetPlacement.attributes[1]) : null;
29
+ const targetAxis = targetAxisId === null ? null : reader.entity(targetAxisId);
30
+ if (!targetPlacement || targetPlacement.type.toUpperCase() !== 'IFCLOCALPLACEMENT'
31
+ || targetAxisId === null || targetAxis?.type.toUpperCase() !== 'IFCAXIS2PLACEMENT3D'
32
+ || !axis3d(reader, targetAxisId))
33
+ throw new Error('The target host placement cannot be edited safely');
34
+ const direction = (value) => {
35
+ if (value === null || value === undefined)
36
+ return null;
37
+ const id = refId(value);
38
+ if (id === null)
39
+ throw new Error('An unreadable placement direction is refused');
40
+ return ref(id);
41
+ };
42
+ const point = editor.addEntity('IfcCartesianPoint', [next]).expressId;
43
+ const axis = editor.addEntity('IfcAxis2Placement3D', [ref(point), direction(oldAxis.attributes[1]), direction(oldAxis.attributes[2])]).expressId;
44
+ const placement = editor.addEntity('IfcLocalPlacement', [ref(targetPlacementId), ref(axis)]).expressId;
45
+ if (read.fillingId !== null) {
46
+ const filling = reader.entity(read.fillingId);
47
+ const fillingPlacementId = refId(filling.attributes[5]);
48
+ const fillingPlacement = fillingPlacementId === null ? null : reader.entity(fillingPlacementId);
49
+ const fillingAxis = fillingPlacement ? refId(fillingPlacement.attributes[1]) : null;
50
+ if (!fillingPlacement || refId(fillingPlacement.attributes[0]) !== oldPlacementId || fillingAxis === null
51
+ || fillingPlacementId === null || !placementInAncestor(reader, fillingPlacementId, parent)) {
52
+ throw new Error('A filling not placed directly in its opening cannot be moved safely');
53
+ }
54
+ const nextFilling = editor.addEntity('IfcLocalPlacement', [ref(placement), ref(fillingAxis)]).expressId;
55
+ editor.setPositionalAttribute(read.fillingId, 5, ref(nextFilling));
56
+ }
57
+ editor.setPositionalAttribute(read.openingId, 5, ref(placement));
58
+ }
59
+ /** Apply a validated split/rehost plan atomically. Every opening, filling and
60
+ * void relation keeps its identity; only the selected occurrence receives
61
+ * fresh placements and its void relation's host changes. Source placement
62
+ * records stay untouched. The caller decides the final host/fit for all cuts;
63
+ * this batch never validates against intermediate single-move positions. */
64
+ export function reassignHostedOpeningsInStore(store, editor, sourceHostId, moves) {
65
+ if (moves.length === 0)
66
+ return;
67
+ editor.runAtomic(draft => {
68
+ const view = draft.getMutationView(), reader = new AnchorEntityReader(store, view);
69
+ const sourceRelations = new Map();
70
+ for (const id of reader.ids('IFCRELVOIDSELEMENT')) {
71
+ const rel = reader.entity(id);
72
+ if (!rel || refId(rel.attributes[4]) !== sourceHostId)
73
+ continue;
74
+ const openingId = refId(rel.attributes[5]);
75
+ if (openingId === null)
76
+ continue;
77
+ const ids = sourceRelations.get(openingId) ?? [];
78
+ ids.push(id);
79
+ sourceRelations.set(openingId, ids);
80
+ }
81
+ const seen = new Set();
82
+ const reads = readHostedOpeningBatch(store, new Set(moves.map(move => move.openingId)), view);
83
+ const plan = moves.map(move => {
84
+ if (seen.has(move.openingId))
85
+ throw new Error('An opening cannot be reassigned twice in one batch');
86
+ seen.add(move.openingId);
87
+ const read = reads.get(move.openingId);
88
+ if (!read || read.hostId !== sourceHostId)
89
+ throw new Error('The opening does not belong to the source host');
90
+ const relations = sourceRelations.get(move.openingId) ?? [];
91
+ if (relations.length !== 1)
92
+ throw new Error('An opening must have exactly one source void relationship');
93
+ return { move, read, relationId: relations[0] };
94
+ });
95
+ for (const { move, read, relationId } of plan) {
96
+ moveHostedOpeningPlacement(reader, draft, read, move.location, move.hostId);
97
+ if (move.hostId !== sourceHostId)
98
+ draft.setPositionalAttribute(relationId, 4, ref(move.hostId));
99
+ }
100
+ });
101
+ }
102
+ /** Reanchor every opening after a host-origin translation. `shift` is the
103
+ * host's origin displacement in its own frame, in native file units. The
104
+ * caller validates the final host body before changing its placement.
105
+ * Reanchor the whole batch without applying single-move fit/overlap checks
106
+ * to transient positions; the cuts keep their relative positions and shape.
107
+ * Unreadable cuts or placements refuse with no surviving writes. */
108
+ export function reanchorHostedOpeningsInStore(store, editor, hostId, shift) {
109
+ if (shift.length !== 3 || !shift.every(Number.isFinite))
110
+ throw new Error('The host displacement must contain three finite native lengths');
111
+ editor.runAtomic(draft => {
112
+ const view = draft.getMutationView(), reader = new AnchorEntityReader(store, view);
113
+ const { cuts, unreadable } = readHostOpeningExtents(store, hostId, view);
114
+ if (unreadable.length > 0)
115
+ throw new Error('Unreadable hosted cuts cannot be reanchored safely');
116
+ for (const cut of cuts) {
117
+ moveHostedOpeningPlacement(reader, draft, cut, [
118
+ cut.location[0] - shift[0], cut.location[1] - shift[1], cut.location[2] - shift[2],
119
+ ]);
120
+ }
121
+ });
122
+ }
123
+ //# sourceMappingURL=hosted-placement-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-placement-edit.js","sourceRoot":"","sources":["../../src/in-store/hosted-placement-edit.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAM/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAuB,MAAM,uBAAuB,CAAC;AACpF,OAAO,EA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;gBAC7C,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;aACnF,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** #6232: repeated size commits must not grow a mapping chain until the
2
+ * canonical renderer's reference-walk bound drops the occurrence. Collapse
3
+ * only an existing anchored scale with the same rigid factorization; other
4
+ * mappings remain untouched. No source/type entity is mutated. */
5
+ import type { AnchorEntityReader } from './resolve-anchor.js';
6
+ import { type Frame3, type Vec3 } from './host-geometry-frame.js';
7
+ export declare function retainedHostedScale(reader: AnchorEntityReader, repId: number, dimension: 2 | 3, inHost: Frame3, sourceAnchor: Vec3, inverse: Frame3, localAnchor: Vec3): {
8
+ repId: number;
9
+ width: number;
10
+ height: number;
11
+ } | null;
12
+ //# sourceMappingURL=hosted-scale-chain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-scale-chain.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-scale-chain.ts"],"names":[],"mappings":"AAIA;;;kEAGkE;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAuC,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEvG,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAC3D,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,GACrE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA0DzD"}
@@ -0,0 +1,74 @@
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 { axis2d, axis3d, num, pointOf, refId } from './host-geometry-frame.js';
5
+ export function retainedHostedScale(reader, repId, dimension, inHost, sourceAnchor, inverse, localAnchor) {
6
+ const rep = reader.entity(repId);
7
+ const items = rep?.attributes[3];
8
+ if (!Array.isArray(items) || items.length !== 1)
9
+ return null;
10
+ const itemId = refId(items[0]), item = itemId === null ? null : reader.entity(itemId);
11
+ if (item?.type.toUpperCase() !== 'IFCMAPPEDITEM')
12
+ return null;
13
+ const mapId = refId(item.attributes[0]), targetId = refId(item.attributes[1]);
14
+ const map = mapId === null ? null : reader.entity(mapId);
15
+ const target = targetId === null ? null : reader.entity(targetId);
16
+ if (map?.type.toUpperCase() !== 'IFCREPRESENTATIONMAP' || !target)
17
+ return null;
18
+ const originId = refId(map.attributes[0]);
19
+ const mappingOrigin = originId === null ? null : reader.entity(originId);
20
+ if (mappingOrigin?.type.toUpperCase() !== `IFCAXIS2PLACEMENT${dimension}D`)
21
+ return null;
22
+ const underlyingId = refId(map.attributes[1]);
23
+ const underlying = underlyingId === null ? null : reader.entity(underlyingId);
24
+ if (underlying?.type.toUpperCase() !== 'IFCSHAPEREPRESENTATION' || underlyingId === null
25
+ || refId(underlying.attributes[0]) !== refId(rep?.attributes[0]))
26
+ return null;
27
+ // A style or presentation layer on the wrapper itself must remain in the
28
+ // graph. Retaining that wrapper once still lets later plain scales compose.
29
+ for (const id of reader.ids('IFCSTYLEDITEM')) {
30
+ if (refId(reader.entity(id)?.attributes[0]) === itemId)
31
+ return null;
32
+ }
33
+ for (const type of ['IFCPRESENTATIONLAYERASSIGNMENT', 'IFCPRESENTATIONLAYERWITHSTYLE']) {
34
+ for (const id of reader.ids(type)) {
35
+ const assigned = reader.entity(id)?.attributes[2];
36
+ if (Array.isArray(assigned) && assigned.some(value => [itemId, repId].includes(refId(value))))
37
+ return null;
38
+ }
39
+ }
40
+ // Directions only allow floating-point normalization noise. Origins use
41
+ // a billionth of the native file unit; this is not a clipping tolerance.
42
+ const same = (a, b, epsilon) => a.length === b.length && a.every((v, i) => Math.abs(v - b[i]) <= epsilon);
43
+ const origin = pointOf(reader, target.attributes[2], 'IFCCARTESIANPOINT', dimension);
44
+ const x = pointOf(reader, target.attributes[0], 'IFCDIRECTION', dimension);
45
+ const y = pointOf(reader, target.attributes[1], 'IFCDIRECTION', dimension);
46
+ if (!origin || !x || !y || !same(origin.slice(0, dimension), localAnchor.slice(0, dimension), 1e-9)
47
+ || !same(x.slice(0, dimension), inverse.x.slice(0, dimension), 1e-12)
48
+ || !same(y.slice(0, dimension), inverse.y.slice(0, dimension), 1e-12))
49
+ return null;
50
+ const width = num(target.attributes[3]);
51
+ if (width === null || width <= 0)
52
+ return null;
53
+ if (dimension === 2) {
54
+ if (target.type.toUpperCase() !== 'IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM'
55
+ || num(target.attributes[4]) !== 1)
56
+ return null;
57
+ const source = axis2d(reader, originId);
58
+ if (!source || !same(source.o, sourceAnchor.slice(0, 2), 1e-9)
59
+ || !same(source.x, inHost.x.slice(0, 2), 1e-12))
60
+ return null;
61
+ return { repId: underlyingId, width, height: 1 };
62
+ }
63
+ const source = axis3d(reader, originId);
64
+ const z = pointOf(reader, target.attributes[4], 'IFCDIRECTION');
65
+ const height = num(target.attributes[6]);
66
+ if (target.type.toUpperCase() !== 'IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM'
67
+ || num(target.attributes[5]) !== 1 || height === null || height <= 0 || !source || !z
68
+ || !same(source.o, sourceAnchor, 1e-9) || !same(source.x, inHost.x, 1e-12)
69
+ || !same(source.y, inHost.y, 1e-12) || !same(source.z, inHost.z, 1e-12)
70
+ || !same(z, inverse.z, 1e-12))
71
+ return null;
72
+ return { repId: underlyingId, width, height };
73
+ }
74
+ //# sourceMappingURL=hosted-scale-chain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-scale-chain.js","sourceRoot":"","sources":["../../src/in-store/hosted-scale-chain.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAO/D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAA0B,MAAM,0BAA0B,CAAC;AAEvG,MAAM,UAAU,mBAAmB,CACjC,MAA0B,EAAE,KAAa,EAAE,SAAgB,EAC3D,MAAc,EAAE,YAAkB,EAAE,OAAe,EAAE,WAAiB;IAEtE,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtF,IAAI,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,eAAe;QAAE,OAAO,IAAI,CAAC;IAC9D,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,MAAM,GAAG,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,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AC/D,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACnD,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACxC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,gDAAgD;WAC7E,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;WAClF,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC;WACvE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC;WACpE,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7C,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Occurrence-only affine size edit. Source/type geometry and styles remain
2
+ * shared and immutable; each representation receives its own mapping wrapper.
3
+ * IFC mapping supports independent axis scales, including nested mappings:
4
+ * https://standards.buildingsmart.org/IFC/RELEASE/IFC4_3/HTML/lexical/IfcCartesianTransformationOperator3DnonUniform.htm */
5
+ import type { StoreEditor } from '@ifc-lite/mutations';
6
+ import type { AnchorEntityReader } from './resolve-anchor.js';
7
+ import { type Frame3, type Vec3 } from './host-geometry-frame.js';
8
+ export declare function scaleHostedShape(reader: AnchorEntityReader, editor: StoreEditor, productId: number, inHost: Frame3, hostAnchor: Vec3, widthScale: number, heightScale: number): void;
9
+ //# sourceMappingURL=hosted-shape-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-shape-edit.d.ts","sourceRoot":"","sources":["../../src/in-store/hosted-shape-edit.ts"],"names":[],"mappings":"AAIA;;;4HAG4H;AAC5H,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAqD,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKrH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAClE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GACxE,IAAI,CAiEN"}
@@ -0,0 +1,79 @@
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 { applyFrame, contextDimension, inverseFrame, refId } from './host-geometry-frame.js';
5
+ import { retainedHostedScale } from './hosted-scale-chain.js';
6
+ const ref = (id) => `#${id}`;
7
+ export function scaleHostedShape(reader, editor, productId, inHost, hostAnchor, widthScale, heightScale) {
8
+ const product = reader.entity(productId);
9
+ const shapeId = product ? refId(product.attributes[6]) : null;
10
+ const shape = shapeId === null ? null : reader.entity(shapeId);
11
+ if (shape?.type.toUpperCase() !== 'IFCPRODUCTDEFINITIONSHAPE' || !Array.isArray(shape.attributes[2])) {
12
+ throw new Error(`Representation of #${productId} cannot be resized without losing its geometry`);
13
+ }
14
+ const inverse = inverseFrame(inHost);
15
+ const localAnchor = applyFrame(inverse, hostAnchor);
16
+ // The renderer/IfcOpenShell compose MappingTarget * MappingOrigin. The
17
+ // source frame therefore maps product coordinates into host coordinates
18
+ // relative to the held anchor; the target maps scaled host axes back into
19
+ // the product. Together this is P^-1 * anchoredScale * P, not its inverse.
20
+ const sourceAnchor = inHost.o.map((value, axis) => value - hostAnchor[axis]);
21
+ const sourcePoint3 = editor.addEntity('IfcCartesianPoint', [sourceAnchor]).expressId;
22
+ const sourceX = editor.addEntity('IfcDirection', [inHost.x]).expressId;
23
+ const sourceZ = editor.addEntity('IfcDirection', [inHost.z]).expressId;
24
+ const point3 = editor.addEntity('IfcCartesianPoint', [localAnchor]).expressId;
25
+ const directions = [inverse.x, inverse.y, inverse.z].map(v => editor.addEntity('IfcDirection', [v]).expressId);
26
+ const origin3 = editor.addEntity('IfcAxis2Placement3D', [ref(sourcePoint3), ref(sourceZ), ref(sourceX)]).expressId;
27
+ const representations = [];
28
+ if (shape.attributes[2].length === 0 || shape.attributes[2].length > 10_000)
29
+ throw new Error('The representation list cannot be resized safely');
30
+ for (const value of shape.attributes[2]) {
31
+ const repId = refId(value), rep = repId === null ? null : reader.entity(repId);
32
+ const contextId = rep ? refId(rep.attributes[0]) : null;
33
+ const dimension = contextId === null ? null : contextDimension(reader, contextId);
34
+ if (rep?.type.toUpperCase() !== 'IFCSHAPEREPRESENTATION' || repId === null || contextId === null || dimension === null) {
35
+ throw new Error(`A representation of #${productId} cannot be resized without losing its geometry`);
36
+ }
37
+ const retained = retainedHostedScale(reader, repId, dimension, inHost, sourceAnchor, inverse, localAnchor);
38
+ const width = widthScale * (retained?.width ?? 1);
39
+ const height = heightScale * (retained?.height ?? 1);
40
+ if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0)
41
+ throw new Error('The cumulative representation scale is invalid');
42
+ let origin = origin3, target;
43
+ if (dimension === 2) {
44
+ // A plan representation lives in local XY. Tilting it into another
45
+ // plane cannot be represented by a 2D operator; refuse instead.
46
+ if (Math.abs(inverse.z[0]) > 1e-9 || Math.abs(inverse.z[1]) > 1e-9 || Math.abs(inverse.z[2] - 1) > 1e-9) {
47
+ throw new Error(`The plan representation of #${productId} has an unsupported tilted frame`);
48
+ }
49
+ const sourcePoint = editor.addEntity('IfcCartesianPoint', [[sourceAnchor[0], sourceAnchor[1]]]).expressId;
50
+ const sourceDirection = editor.addEntity('IfcDirection', [[inHost.x[0], inHost.x[1]]]).expressId;
51
+ const point = editor.addEntity('IfcCartesianPoint', [[localAnchor[0], localAnchor[1]]]).expressId;
52
+ const x = editor.addEntity('IfcDirection', [[inverse.x[0], inverse.x[1]]]).expressId;
53
+ const y = editor.addEntity('IfcDirection', [[inverse.y[0], inverse.y[1]]]).expressId;
54
+ origin = editor.addEntity('IfcAxis2Placement2D', [ref(sourcePoint), ref(sourceDirection)]).expressId;
55
+ target = editor.addEntity('IfcCartesianTransformationOperator2DnonUniform', [ref(x), ref(y), ref(point), width, 1]).expressId;
56
+ }
57
+ else {
58
+ target = editor.addEntity('IfcCartesianTransformationOperator3DnonUniform', [
59
+ ref(directions[0]), ref(directions[1]), ref(point3), width, ref(directions[2]), 1, height,
60
+ ]).expressId;
61
+ }
62
+ const map = editor.addEntity('IfcRepresentationMap', [ref(origin), ref(retained?.repId ?? repId)]).expressId;
63
+ const item = editor.addEntity('IfcMappedItem', [ref(map), ref(target)]).expressId;
64
+ const identifier = rep.attributes[1] ?? null;
65
+ if (identifier !== null && typeof identifier !== 'string')
66
+ throw new Error('An unreadable representation identifier is refused');
67
+ representations.push(ref(editor.addEntity('IfcShapeRepresentation', [ref(contextId), identifier, 'MappedRepresentation', [ref(item)]]).expressId));
68
+ }
69
+ const label = (value) => {
70
+ if (value === null || value === undefined)
71
+ return null;
72
+ if (typeof value !== 'string')
73
+ throw new Error('An unreadable product shape label is refused');
74
+ return value;
75
+ };
76
+ const nextShape = editor.addEntity('IfcProductDefinitionShape', [label(shape.attributes[0]), label(shape.attributes[1]), representations]).expressId;
77
+ editor.setPositionalAttribute(productId, 6, ref(nextShape));
78
+ }
79
+ //# sourceMappingURL=hosted-shape-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-shape-edit.js","sourceRoot":"","sources":["../../src/in-store/hosted-shape-edit.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAQ/D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,EAA0B,MAAM,0BAA0B,CAAC;AACrH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,GAAG,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;AAErC,MAAM,UAAU,gBAAgB,CAC9B,MAA0B,EAAE,MAAmB,EAAE,SAAiB,EAClE,MAAc,EAAE,UAAgB,EAAE,UAAkB,EAAE,WAAmB;IAEzE,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,MAAM,KAAK,GAAG,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,2BAA2B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrG,MAAM,IAAI,KAAK,CAAC,sBAAsB,SAAS,gDA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