@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.
- package/README.md +9 -0
- package/dist/ifc-creator-math.d.ts +5 -7
- package/dist/ifc-creator-math.d.ts.map +1 -1
- package/dist/ifc-creator-math.js +8 -15
- package/dist/ifc-creator-math.js.map +1 -1
- package/dist/in-store/anchor.d.ts +25 -0
- package/dist/in-store/anchor.d.ts.map +1 -1
- package/dist/in-store/auto-space-detect.d.ts +1 -1
- package/dist/in-store/auto-space-detect.js +1 -1
- package/dist/in-store/beam.d.ts +10 -1
- package/dist/in-store/beam.d.ts.map +1 -1
- package/dist/in-store/beam.js +14 -25
- package/dist/in-store/beam.js.map +1 -1
- package/dist/in-store/column.d.ts +18 -1
- package/dist/in-store/column.d.ts.map +1 -1
- package/dist/in-store/column.js +37 -29
- package/dist/in-store/column.js.map +1 -1
- package/dist/in-store/copy-frame.d.ts +52 -0
- package/dist/in-store/copy-frame.d.ts.map +1 -0
- package/dist/in-store/copy-frame.js +99 -0
- package/dist/in-store/copy-frame.js.map +1 -0
- package/dist/in-store/copy-product.d.ts +96 -0
- package/dist/in-store/copy-product.d.ts.map +1 -0
- package/dist/in-store/copy-product.js +318 -0
- package/dist/in-store/copy-product.js.map +1 -0
- package/dist/in-store/curtain-wall.d.ts +87 -0
- package/dist/in-store/curtain-wall.d.ts.map +1 -0
- package/dist/in-store/curtain-wall.js +237 -0
- package/dist/in-store/curtain-wall.js.map +1 -0
- package/dist/in-store/door.d.ts +10 -4
- package/dist/in-store/door.d.ts.map +1 -1
- package/dist/in-store/door.js +23 -17
- package/dist/in-store/door.js.map +1 -1
- package/dist/in-store/element-type.d.ts +40 -0
- package/dist/in-store/element-type.d.ts.map +1 -0
- package/dist/in-store/element-type.js +60 -0
- package/dist/in-store/element-type.js.map +1 -0
- package/dist/in-store/extract-grids.d.ts +46 -0
- package/dist/in-store/extract-grids.d.ts.map +1 -0
- package/dist/in-store/extract-grids.js +211 -0
- package/dist/in-store/extract-grids.js.map +1 -0
- package/dist/in-store/extract-walls.d.ts +12 -23
- package/dist/in-store/extract-walls.d.ts.map +1 -1
- package/dist/in-store/extract-walls.js +14 -83
- package/dist/in-store/extract-walls.js.map +1 -1
- package/dist/in-store/generate-spaces.d.ts +1 -1
- package/dist/in-store/grid.d.ts +118 -0
- package/dist/in-store/grid.d.ts.map +1 -0
- package/dist/in-store/grid.js +194 -0
- package/dist/in-store/grid.js.map +1 -0
- package/dist/in-store/host-geometry-frame.d.ts +44 -0
- package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
- package/dist/in-store/host-geometry-frame.js +146 -0
- package/dist/in-store/host-geometry-frame.js.map +1 -0
- package/dist/in-store/hosted-element-edit.d.ts +29 -0
- package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-element-edit.js +120 -0
- package/dist/in-store/hosted-element-edit.js.map +1 -0
- package/dist/in-store/hosted-element.d.ts +41 -0
- package/dist/in-store/hosted-element.d.ts.map +1 -0
- package/dist/in-store/hosted-element.js +124 -0
- package/dist/in-store/hosted-element.js.map +1 -0
- package/dist/in-store/hosted-fill-read.d.ts +56 -0
- package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
- package/dist/in-store/hosted-fill-read.js +197 -0
- package/dist/in-store/hosted-fill-read.js.map +1 -0
- package/dist/in-store/hosted-fill.d.ts +48 -0
- package/dist/in-store/hosted-fill.d.ts.map +1 -0
- package/dist/in-store/hosted-fill.js +58 -0
- package/dist/in-store/hosted-fill.js.map +1 -0
- package/dist/in-store/hosted-global-id.d.ts +8 -0
- package/dist/in-store/hosted-global-id.d.ts.map +1 -0
- package/dist/in-store/hosted-global-id.js +53 -0
- package/dist/in-store/hosted-global-id.js.map +1 -0
- package/dist/in-store/hosted-placement-edit.d.ts +30 -0
- package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-placement-edit.js +123 -0
- package/dist/in-store/hosted-placement-edit.js.map +1 -0
- package/dist/in-store/hosted-scale-chain.d.ts +12 -0
- package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
- package/dist/in-store/hosted-scale-chain.js +74 -0
- package/dist/in-store/hosted-scale-chain.js.map +1 -0
- package/dist/in-store/hosted-shape-edit.d.ts +9 -0
- package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-shape-edit.js +79 -0
- package/dist/in-store/hosted-shape-edit.js.map +1 -0
- package/dist/in-store/index.d.ts +59 -0
- package/dist/in-store/index.d.ts.map +1 -0
- package/dist/in-store/index.js +64 -0
- package/dist/in-store/index.js.map +1 -0
- package/dist/in-store/material.d.ts +62 -0
- package/dist/in-store/material.d.ts.map +1 -0
- package/dist/in-store/material.js +107 -0
- package/dist/in-store/material.js.map +1 -0
- package/dist/in-store/member.d.ts +8 -2
- package/dist/in-store/member.d.ts.map +1 -1
- package/dist/in-store/member.js +12 -14
- package/dist/in-store/member.js.map +1 -1
- package/dist/in-store/opening.d.ts +45 -0
- package/dist/in-store/opening.d.ts.map +1 -0
- package/dist/in-store/opening.js +104 -0
- package/dist/in-store/opening.js.map +1 -0
- package/dist/in-store/placement-frame.d.ts +9 -4
- package/dist/in-store/placement-frame.d.ts.map +1 -1
- package/dist/in-store/placement-frame.js +39 -39
- package/dist/in-store/placement-frame.js.map +1 -1
- package/dist/in-store/profile.d.ts +141 -0
- package/dist/in-store/profile.d.ts.map +1 -0
- package/dist/in-store/profile.js +174 -0
- package/dist/in-store/profile.js.map +1 -0
- package/dist/in-store/railing.d.ts +65 -0
- package/dist/in-store/railing.d.ts.map +1 -0
- package/dist/in-store/railing.js +112 -0
- package/dist/in-store/railing.js.map +1 -0
- package/dist/in-store/rel-connects-path.d.ts +43 -0
- package/dist/in-store/rel-connects-path.d.ts.map +1 -0
- package/dist/in-store/rel-connects-path.js +65 -0
- package/dist/in-store/rel-connects-path.js.map +1 -0
- package/dist/in-store/relate.d.ts +32 -0
- package/dist/in-store/relate.d.ts.map +1 -0
- package/dist/in-store/relate.js +39 -0
- package/dist/in-store/relate.js.map +1 -0
- package/dist/in-store/resolve-anchor.d.ts +21 -1
- package/dist/in-store/resolve-anchor.d.ts.map +1 -1
- package/dist/in-store/resolve-anchor.js +6 -2
- package/dist/in-store/resolve-anchor.js.map +1 -1
- package/dist/in-store/resolve-host.d.ts +16 -0
- package/dist/in-store/resolve-host.d.ts.map +1 -0
- package/dist/in-store/resolve-host.js +333 -0
- package/dist/in-store/resolve-host.js.map +1 -0
- package/dist/in-store/resolve-relations.d.ts +23 -0
- package/dist/in-store/resolve-relations.d.ts.map +1 -0
- package/dist/in-store/resolve-relations.js +57 -0
- package/dist/in-store/resolve-relations.js.map +1 -0
- package/dist/in-store/resolve-source.d.ts.map +1 -1
- package/dist/in-store/resolve-source.js +59 -63
- package/dist/in-store/resolve-source.js.map +1 -1
- package/dist/in-store/schema-attributes.d.ts +33 -0
- package/dist/in-store/schema-attributes.d.ts.map +1 -0
- package/dist/in-store/schema-attributes.js +102 -0
- package/dist/in-store/schema-attributes.js.map +1 -0
- package/dist/in-store/space-footprints.d.ts +55 -0
- package/dist/in-store/space-footprints.d.ts.map +1 -0
- package/dist/in-store/space-footprints.js +260 -0
- package/dist/in-store/space-footprints.js.map +1 -0
- package/dist/in-store/space.d.ts.map +1 -1
- package/dist/in-store/space.js +15 -3
- package/dist/in-store/space.js.map +1 -1
- package/dist/in-store/spatial-children.d.ts +1 -1
- package/dist/in-store/spatial-children.js +1 -1
- package/dist/in-store/stair-edit.d.ts +24 -0
- package/dist/in-store/stair-edit.d.ts.map +1 -0
- package/dist/in-store/stair-edit.js +190 -0
- package/dist/in-store/stair-edit.js.map +1 -0
- package/dist/in-store/stair.d.ts +58 -0
- package/dist/in-store/stair.d.ts.map +1 -0
- package/dist/in-store/stair.js +156 -0
- package/dist/in-store/stair.js.map +1 -0
- package/dist/in-store/wall-join-apply.d.ts +74 -0
- package/dist/in-store/wall-join-apply.d.ts.map +1 -0
- package/dist/in-store/wall-join-apply.js +137 -0
- package/dist/in-store/wall-join-apply.js.map +1 -0
- package/dist/in-store/wall-join-edit.d.ts +70 -0
- package/dist/in-store/wall-join-edit.d.ts.map +1 -0
- package/dist/in-store/wall-join-edit.js +217 -0
- package/dist/in-store/wall-join-edit.js.map +1 -0
- package/dist/in-store/wall-join-read.d.ts +60 -0
- package/dist/in-store/wall-join-read.d.ts.map +1 -0
- package/dist/in-store/wall-join-read.js +230 -0
- package/dist/in-store/wall-join-read.js.map +1 -0
- package/dist/in-store/wall-join.d.ts +122 -0
- package/dist/in-store/wall-join.d.ts.map +1 -0
- package/dist/in-store/wall-join.js +231 -0
- package/dist/in-store/wall-join.js.map +1 -0
- package/dist/in-store/wall-opening-fit.d.ts +11 -0
- package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
- package/dist/in-store/wall-opening-fit.js +27 -0
- package/dist/in-store/wall-opening-fit.js.map +1 -0
- package/dist/in-store/wall.d.ts +32 -0
- package/dist/in-store/wall.d.ts.map +1 -1
- package/dist/in-store/wall.js +77 -13
- package/dist/in-store/wall.js.map +1 -1
- package/dist/in-store/window.d.ts +7 -0
- package/dist/in-store/window.d.ts.map +1 -1
- package/dist/in-store/window.js +24 -17
- package/dist/in-store/window.js.map +1 -1
- package/dist/index.d.ts +1 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -34
- package/dist/index.js.map +1 -1
- package/dist/landxml/cant-superelevation.d.ts +28 -0
- package/dist/landxml/cant-superelevation.d.ts.map +1 -0
- package/dist/landxml/cant-superelevation.js +31 -0
- package/dist/landxml/cant-superelevation.js.map +1 -0
- package/dist/landxml/landxml-to-ifc.d.ts +8 -2
- package/dist/landxml/landxml-to-ifc.d.ts.map +1 -1
- package/dist/landxml/landxml-to-ifc.js +34 -2
- package/dist/landxml/landxml-to-ifc.js.map +1 -1
- package/dist/landxml/refusals.d.ts.map +1 -1
- package/dist/landxml/refusals.js +8 -3
- package/dist/landxml/refusals.js.map +1 -1
- package/dist/landxml/result-types.d.ts +44 -0
- package/dist/landxml/result-types.d.ts.map +1 -1
- package/dist/landxml/writers.d.ts +4 -0
- package/dist/landxml/writers.d.ts.map +1 -1
- package/dist/landxml/writers.js +4 -2
- package/dist/landxml/writers.js.map +1 -1
- package/package.json +8 -7
|
@@ -0,0 +1,112 @@
|
|
|
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 { assertFinitePoint3 } from '../ifc-creator-math.js';
|
|
5
|
+
import { toNativeLength, toNativePoint3 } from './anchor.js';
|
|
6
|
+
import { assertPositiveFinite, emitLocalPlacement, emitRelContainedInSpatialStructure, ownerHistoryRef, productGuid, } from './_emit-helpers.js';
|
|
7
|
+
import { schemaAttributes, schemaRegistry } from './schema-attributes.js';
|
|
8
|
+
const DEFAULT_RAIL_DIAMETER = 0.05;
|
|
9
|
+
const sub = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2]];
|
|
10
|
+
const lerp = (a, b, t) => [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t];
|
|
11
|
+
/**
|
|
12
|
+
* Post base points along `path` (vertices, plus intermediates at `spacing`).
|
|
13
|
+
* `spacing`, when given, must be finite and positive: a zero spacing would
|
|
14
|
+
* need infinitely many posts, and NaN would silently drop segment ends.
|
|
15
|
+
*/
|
|
16
|
+
export function railingPostPoints(path, spacing) {
|
|
17
|
+
if (spacing !== undefined)
|
|
18
|
+
assertPositiveFinite([spacing], 'railingPostPoints: spacing must be a finite positive number');
|
|
19
|
+
const posts = [path[0]];
|
|
20
|
+
for (let i = 1; i < path.length; i++) {
|
|
21
|
+
const a = path[i - 1];
|
|
22
|
+
const b = path[i];
|
|
23
|
+
const bays = spacing === undefined ? 1 : Math.max(1, Math.ceil(Math.hypot(...sub(b, a)) / spacing - 1e-9));
|
|
24
|
+
for (let k = 1; k <= bays; k++)
|
|
25
|
+
posts.push(lerp(a, b, k / bays));
|
|
26
|
+
}
|
|
27
|
+
return posts;
|
|
28
|
+
}
|
|
29
|
+
function assertRailingParams(params, op) {
|
|
30
|
+
if (!Array.isArray(params.Path) || params.Path.length < 2) {
|
|
31
|
+
throw new Error(`${op}: Path needs at least two points`);
|
|
32
|
+
}
|
|
33
|
+
params.Path.forEach((p, i) => assertFinitePoint3({ [`Path[${i}]`]: p }, op));
|
|
34
|
+
for (let i = 1; i < params.Path.length; i++) {
|
|
35
|
+
if (Math.hypot(...sub(params.Path[i], params.Path[i - 1])) <= 1e-9) {
|
|
36
|
+
throw new Error(`${op}: Path[${i - 1}] and Path[${i}] must be distinct points`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const rail = params.RailDiameter ?? DEFAULT_RAIL_DIAMETER;
|
|
40
|
+
assertPositiveFinite([params.Height, rail, params.PostDiameter ?? rail], `${op}: Height, RailDiameter and PostDiameter must be finite positive numbers`);
|
|
41
|
+
if (params.Height <= rail)
|
|
42
|
+
throw new Error(`${op}: Height must be greater than RailDiameter`);
|
|
43
|
+
if (params.PostSpacing !== undefined) {
|
|
44
|
+
assertPositiveFinite([params.PostSpacing], `${op}: PostSpacing must be a finite positive number`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function addRailingToStore(editor, anchor, params) {
|
|
48
|
+
const op = 'addRailingToStore';
|
|
49
|
+
assertRailingParams(params, op);
|
|
50
|
+
const registry = schemaRegistry(anchor.schema, op);
|
|
51
|
+
const isIfc2x3 = registry.name.toUpperCase() === 'IFC2X3';
|
|
52
|
+
const railDiameter = params.RailDiameter ?? DEFAULT_RAIL_DIAMETER;
|
|
53
|
+
const railRadius = toNativeLength(anchor, railDiameter / 2);
|
|
54
|
+
const postRadius = toNativeLength(anchor, (params.PostDiameter ?? railDiameter) / 2);
|
|
55
|
+
const railAxisHeight = toNativeLength(anchor, params.Height - railDiameter / 2);
|
|
56
|
+
const path = params.Path.map((p) => toNativePoint3(anchor, p));
|
|
57
|
+
const origin = path[0];
|
|
58
|
+
const local = path.map((p) => sub(p, origin));
|
|
59
|
+
const spacing = params.PostSpacing === undefined ? undefined : toNativeLength(anchor, params.PostSpacing);
|
|
60
|
+
// Lay the railing record out before the first emit so a bad PredefinedType
|
|
61
|
+
// or a missing IFC2X3 OwnerHistory refuses cleanly.
|
|
62
|
+
const globalId = productGuid(params, anchor.guidRandom);
|
|
63
|
+
const railingValues = (placement, shape) => ({
|
|
64
|
+
GlobalId: globalId,
|
|
65
|
+
OwnerHistory: ownerHistoryRef(anchor.ownerHistoryId),
|
|
66
|
+
Name: params.Name ?? 'Railing',
|
|
67
|
+
Description: params.Description,
|
|
68
|
+
ObjectType: params.ObjectType,
|
|
69
|
+
ObjectPlacement: placement,
|
|
70
|
+
Representation: shape,
|
|
71
|
+
Tag: params.Tag,
|
|
72
|
+
PredefinedType: params.PredefinedType ?? 'HANDRAIL',
|
|
73
|
+
});
|
|
74
|
+
schemaAttributes(registry, 'IfcRailing', railingValues(null, null), op);
|
|
75
|
+
// Placement at the first path point, explicit axes so it can be turned later.
|
|
76
|
+
const placementId = emitLocalPlacement(editor, anchor.storeyPlacementId, origin, [0, 0, 1], [1, 0, 0]);
|
|
77
|
+
// Handrail: a disk swept along the path lifted to the rail's centreline.
|
|
78
|
+
const directrixPoints = local.map((p) => editor.addEntity('IfcCartesianPoint', [[p[0], p[1], p[2] + railAxisHeight]]).expressId);
|
|
79
|
+
const directrix = editor.addEntity('IfcPolyline', [directrixPoints.map((id) => `#${id}`)]).expressId;
|
|
80
|
+
const railSolidId = editor.addEntity('IfcSweptDiskSolid', schemaAttributes(registry, 'IfcSweptDiskSolid', {
|
|
81
|
+
Directrix: `#${directrix}`,
|
|
82
|
+
Radius: railRadius,
|
|
83
|
+
// IfcPolyline's parameter is the point index; IFC2X3 requires the range.
|
|
84
|
+
...(isIfc2x3 ? { StartParam: 0, EndParam: local.length - 1 } : {}),
|
|
85
|
+
}, op)).expressId;
|
|
86
|
+
// Posts: circular, from the path up to the rail's centreline. One shared
|
|
87
|
+
// profile and extrusion direction.
|
|
88
|
+
const postOriginPt = editor.addEntity('IfcCartesianPoint', [[0, 0]]).expressId;
|
|
89
|
+
const postProfilePos = editor.addEntity('IfcAxis2Placement2D', [`#${postOriginPt}`, null]).expressId;
|
|
90
|
+
const postProfile = editor.addEntity('IfcCircleProfileDef', schemaAttributes(registry, 'IfcCircleProfileDef', {
|
|
91
|
+
ProfileType: 'AREA',
|
|
92
|
+
Position: `#${postProfilePos}`,
|
|
93
|
+
Radius: postRadius,
|
|
94
|
+
}, op)).expressId;
|
|
95
|
+
const up = editor.addEntity('IfcDirection', [[0, 0, 1]]).expressId;
|
|
96
|
+
const postSolidIds = railingPostPoints(local, spacing).map((p) => {
|
|
97
|
+
const pt = editor.addEntity('IfcCartesianPoint', [p]).expressId;
|
|
98
|
+
const position = editor.addEntity('IfcAxis2Placement3D', [`#${pt}`, null, null]).expressId;
|
|
99
|
+
return editor.addEntity('IfcExtrudedAreaSolid', [`#${postProfile}`, `#${position}`, `#${up}`, railAxisHeight]).expressId;
|
|
100
|
+
});
|
|
101
|
+
const shapeRepId = editor.addEntity('IfcShapeRepresentation', [
|
|
102
|
+
`#${anchor.bodyContextId}`,
|
|
103
|
+
'Body',
|
|
104
|
+
'SolidModel',
|
|
105
|
+
[railSolidId, ...postSolidIds].map((id) => `#${id}`),
|
|
106
|
+
]).expressId;
|
|
107
|
+
const productShapeId = editor.addEntity('IfcProductDefinitionShape', [null, null, [`#${shapeRepId}`]]).expressId;
|
|
108
|
+
const railingId = editor.addEntity('IfcRailing', schemaAttributes(registry, 'IfcRailing', railingValues(`#${placementId}`, `#${productShapeId}`), op)).expressId;
|
|
109
|
+
const relContainedId = emitRelContainedInSpatialStructure(editor, anchor.ownerHistoryId, railingId, anchor.storeyId, anchor.guidRandom);
|
|
110
|
+
return { railingId, placementId, railSolidId, postSolidIds, shapeRepId, productShapeId, relContainedId };
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=railing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"railing.js","sourceRoot":"","sources":["../../src/in-store/railing.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAsB/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjF,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,kCAAkC,EAClC,eAAe,EACf,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAK1E,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAuCnC,MAAM,GAAG,GAAG,CAAC,CAAO,EAAE,CAAO,EAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,MAAM,IAAI,GAAG,CAAC,CAAO,EAAE,CAAO,EAAE,CAAS,EAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEnI;;;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EAAE,CAAC,IAAI,WAAW,EAAE,EAAE,IAAI,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3H,CAAC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,wBAAwB,EAAE;QAC5D,IAAI,MAAM,CAAC,aAAa,EAAE;QAC1B,MAAM;QACN,YAAY;QACZ,CAAC,WAAW,EAAE,GAAG,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;KACrD,CAAC,CAAC,SAAS,CAAC;IACb,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,2BAA2B,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjH,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAChC,YAAY,EACZ,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,aAAa,CAAC,IAAI,WAAW,EAAE,EAAE,IAAI,cAAc,EAAE,CAAC,EAAE,EAAE,CAAU,CAC9G,CAAC,SAAS,CAAC;IACZ,MAAM,cAAc,GAAG,kCAAkC,CACvD,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAC7E,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC3G,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `IfcRelConnectsPathElements`: two path elements (walls) joined at their
|
|
3
|
+
* start, end or along the path (#6232 D1). The attribute layout comes from the
|
|
4
|
+
* target schema's registry, so IFC2X3, IFC4 and IFC4X3 are all written right;
|
|
5
|
+
* IFC5 / IFCX are refused.
|
|
6
|
+
*
|
|
7
|
+
* GlobalId, OwnerHistory?, Name?, Description?, ConnectionGeometry?,
|
|
8
|
+
* RelatingElement, RelatedElement, RelatingPriorities, RelatedPriorities,
|
|
9
|
+
* RelatedConnectionType, RelatingConnectionType
|
|
10
|
+
*
|
|
11
|
+
* The priorities are the material-layer priorities at the joint; they are
|
|
12
|
+
* mandatory lists, written empty when the caller has none.
|
|
13
|
+
*
|
|
14
|
+
* Pure: writes through the editor only.
|
|
15
|
+
*/
|
|
16
|
+
import { type RandomSource } from '@ifc-lite/encoding';
|
|
17
|
+
import type { StoreEditor } from '@ifc-lite/mutations';
|
|
18
|
+
import type { SpatialAnchorSchema } from './anchor.js';
|
|
19
|
+
import type { WallConnectionType } from './wall-join.js';
|
|
20
|
+
/** The anchor fields the relationship needs. A full `SpatialAnchor` or an `AuthoringAnchor` both fit. */
|
|
21
|
+
export interface RelConnectsAnchor {
|
|
22
|
+
ownerHistoryId: number | null;
|
|
23
|
+
/** Default IFC4. */
|
|
24
|
+
schema?: SpatialAnchorSchema;
|
|
25
|
+
guidRandom?: RandomSource;
|
|
26
|
+
}
|
|
27
|
+
export interface RelConnectsPathElementsParams {
|
|
28
|
+
/** The element that runs through (for a T, the one whose path is joined). */
|
|
29
|
+
RelatingElement: number;
|
|
30
|
+
RelatedElement: number;
|
|
31
|
+
RelatingConnectionType: WallConnectionType;
|
|
32
|
+
RelatedConnectionType: WallConnectionType;
|
|
33
|
+
/** Layer priorities of the relating element at the joint. Default empty. */
|
|
34
|
+
RelatingPriorities?: readonly number[];
|
|
35
|
+
/** Layer priorities of the related element at the joint. Default empty. */
|
|
36
|
+
RelatedPriorities?: readonly number[];
|
|
37
|
+
Name?: string;
|
|
38
|
+
Description?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function addRelConnectsPathElementsToStore(editor: StoreEditor, anchor: RelConnectsAnchor, params: RelConnectsPathElementsParams): number;
|
|
41
|
+
/** Validate `params` and lay out the relationship's attributes, without writing anything. */
|
|
42
|
+
export declare function relConnectsPathElementsAttributes(editor: StoreEditor, anchor: RelConnectsAnchor, params: RelConnectsPathElementsParams, op: string): unknown[];
|
|
43
|
+
//# sourceMappingURL=rel-connects-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rel-connects-path.d.ts","sourceRoot":"","sources":["../../src/in-store/rel-connects-path.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,yGAAyG;AACzG,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,oBAAoB;IACpB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED,MAAM,WAAW,6BAA6B;IAC5C,6EAA6E;IAC7E,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,kBAAkB,CAAC;IAC3C,qBAAqB,EAAE,kBAAkB,CAAC;IAC1C,4EAA4E;IAC5E,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,6BAA6B,GACpC,MAAM,CAGR;AAED,6FAA6F;AAC7F,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,6BAA6B,EACrC,EAAE,EAAE,MAAM,GACT,OAAO,EAAE,CAiCX"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
* `IfcRelConnectsPathElements`: two path elements (walls) joined at their
|
|
6
|
+
* start, end or along the path (#6232 D1). The attribute layout comes from the
|
|
7
|
+
* target schema's registry, so IFC2X3, IFC4 and IFC4X3 are all written right;
|
|
8
|
+
* IFC5 / IFCX are refused.
|
|
9
|
+
*
|
|
10
|
+
* GlobalId, OwnerHistory?, Name?, Description?, ConnectionGeometry?,
|
|
11
|
+
* RelatingElement, RelatedElement, RelatingPriorities, RelatedPriorities,
|
|
12
|
+
* RelatedConnectionType, RelatingConnectionType
|
|
13
|
+
*
|
|
14
|
+
* The priorities are the material-layer priorities at the joint; they are
|
|
15
|
+
* mandatory lists, written empty when the caller has none.
|
|
16
|
+
*
|
|
17
|
+
* Pure: writes through the editor only.
|
|
18
|
+
*/
|
|
19
|
+
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
20
|
+
import { ownerHistoryRef } from './_emit-helpers.js';
|
|
21
|
+
import { conformsTo, schemaAttributes, schemaRegistry } from './schema-attributes.js';
|
|
22
|
+
const CONNECTION_TYPES = ['ATSTART', 'ATEND', 'ATPATH'];
|
|
23
|
+
export function addRelConnectsPathElementsToStore(editor, anchor, params) {
|
|
24
|
+
const attributes = relConnectsPathElementsAttributes(editor, anchor, params, 'addRelConnectsPathElementsToStore');
|
|
25
|
+
return editor.addEntity('IfcRelConnectsPathElements', attributes).expressId;
|
|
26
|
+
}
|
|
27
|
+
/** Validate `params` and lay out the relationship's attributes, without writing anything. */
|
|
28
|
+
export function relConnectsPathElementsAttributes(editor, anchor, params, op) {
|
|
29
|
+
const registry = schemaRegistry(anchor.schema, op);
|
|
30
|
+
const { RelatingElement: relating, RelatedElement: related } = params;
|
|
31
|
+
for (const id of [relating, related]) {
|
|
32
|
+
if (!Number.isInteger(id) || id <= 0 || !editor.hasEntity(id))
|
|
33
|
+
throw new Error(`${op}: #${id} is not a live entity`);
|
|
34
|
+
const type = editor.getEntityType(id);
|
|
35
|
+
if (!type || !conformsTo(registry, type, 'IfcElement')) {
|
|
36
|
+
throw new Error(`${op}: #${id} is ${type ?? 'unknown'}, not an IfcElement`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (relating === related)
|
|
40
|
+
throw new Error(`${op}: an element cannot connect to itself`);
|
|
41
|
+
for (const value of [params.RelatingConnectionType, params.RelatedConnectionType]) {
|
|
42
|
+
if (!CONNECTION_TYPES.includes(value))
|
|
43
|
+
throw new Error(`${op}: connection type must be ATSTART, ATEND or ATPATH; got ${String(value)}`);
|
|
44
|
+
}
|
|
45
|
+
const priorities = (list, name) => {
|
|
46
|
+
const values = [...(list ?? [])];
|
|
47
|
+
if (values.some((v) => !Number.isInteger(v) || v < 0 || v > 100)) {
|
|
48
|
+
throw new Error(`${op}: ${name} must be integers between 0 and 100`);
|
|
49
|
+
}
|
|
50
|
+
return values;
|
|
51
|
+
};
|
|
52
|
+
return schemaAttributes(registry, 'IfcRelConnectsPathElements', {
|
|
53
|
+
GlobalId: generateIfcGuid(anchor.guidRandom),
|
|
54
|
+
OwnerHistory: ownerHistoryRef(anchor.ownerHistoryId),
|
|
55
|
+
Name: params.Name,
|
|
56
|
+
Description: params.Description,
|
|
57
|
+
RelatingElement: `#${relating}`,
|
|
58
|
+
RelatedElement: `#${related}`,
|
|
59
|
+
RelatingPriorities: priorities(params.RelatingPriorities, 'RelatingPriorities'),
|
|
60
|
+
RelatedPriorities: priorities(params.RelatedPriorities, 'RelatedPriorities'),
|
|
61
|
+
RelatedConnectionType: params.RelatedConnectionType,
|
|
62
|
+
RelatingConnectionType: params.RelatingConnectionType,
|
|
63
|
+
}, op);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=rel-connects-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rel-connects-path.js","sourceRoot":"","sources":["../../src/in-store/rel-connects-path.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AAGxE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAyBtF,MAAM,gBAAgB,GAAsB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE3E,MAAM,UAAU,iCAAiC,CAC/C,MAAmB,EACnB,MAAyB,EACzB,MAAqC;IAErC,MAAM,UAAU,GAAG,iCAAiC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,mCAAmC,CAAC,CAAC;IAClH,OAAO,MAAM,CAAC,SAAS,CAAC,4BAA4B,EAAE,UAAqD,CAAC,CAAC,SAAS,CAAC;AACzH,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,iCAAiC,CAC/C,MAAmB,EACnB,MAAyB,EACzB,MAAqC,EACrC,EAAU;IAEV,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACnD,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACtE,KAAK,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,I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AAQ,EAAE,4BAA4B,EAAE;QAC9D,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC;QAC5C,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC;QACpD,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,eAAe,EAAE,IAAI,QAAQ,EAAE;QAC/B,cAAc,EAAE,IAAI,OAAO,EAAE;QAC7B,kBAAkB,EAAE,UAAU,CAAC,MAAM,CAAC,kBAAkB,EAAE,oBAAoB,CAAC;QAC/E,iBAAiB,EAAE,UAAU,CAAC,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;QAC5E,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;QACnD,sBAAsB,EAAE,MAAM,CAAC,sBAAsB;KACtD,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-to-many relationships where an object belongs to at most one relating
|
|
3
|
+
* entity: IfcRelDefinesByType (one type per occurrence) and
|
|
4
|
+
* IfcRelAssociatesMaterial (one material association per object). Both keep
|
|
5
|
+
* `RelatedObjects` at slot 4 and the relating side at slot 5.
|
|
6
|
+
*
|
|
7
|
+
* Assigning moves each object: it leaves every other relationship of the same
|
|
8
|
+
* class (a relationship it empties is removed), then joins the relating
|
|
9
|
+
* entity's existing relationship, or a new one when there is none. Reading
|
|
10
|
+
* the existing relationships is the resolver's job (`readRelatedLists`), so
|
|
11
|
+
* this stays a pure write through the editor.
|
|
12
|
+
*/
|
|
13
|
+
import type { StoreEditor } from '@ifc-lite/mutations';
|
|
14
|
+
import type { ExistingRelatedList } from './cost.js';
|
|
15
|
+
export interface OneToManyResult {
|
|
16
|
+
/** The relationship the objects now belong to. */
|
|
17
|
+
relId: number;
|
|
18
|
+
/** True when `relId` was created by this call rather than extended. */
|
|
19
|
+
created: boolean;
|
|
20
|
+
/** Relationships the objects were moved out of (removed when emptied). */
|
|
21
|
+
detachedRelIds: number[];
|
|
22
|
+
}
|
|
23
|
+
export interface OneToManySpec {
|
|
24
|
+
relType: 'IfcRelDefinesByType' | 'IfcRelAssociatesMaterial';
|
|
25
|
+
relatingId: number;
|
|
26
|
+
relatedIds: readonly number[];
|
|
27
|
+
existing: readonly ExistingRelatedList[];
|
|
28
|
+
/** Full attribute list for a new relationship, given its RelatedObjects. */
|
|
29
|
+
create: (related: string[]) => unknown[];
|
|
30
|
+
}
|
|
31
|
+
export declare function relateOneToManyInStore(editor: StoreEditor, spec: OneToManySpec, op: string): OneToManyResult;
|
|
32
|
+
//# sourceMappingURL=relate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relate.d.ts","sourceRoot":"","sources":["../../src/in-store/relate.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAIrD,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,OAAO,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,qBAAqB,GAAG,0BAA0B,CAAC;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACzC,4EAA4E;IAC5E,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,EAAE,CAAC;CAC1C;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe,CA6B5G"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
const RELATED_SLOT = 4;
|
|
5
|
+
export function relateOneToManyInStore(editor, spec, op) {
|
|
6
|
+
const ids = [...new Set(spec.relatedIds)];
|
|
7
|
+
if (ids.length === 0)
|
|
8
|
+
throw new Error(`${op}: pass at least one object id`);
|
|
9
|
+
for (const id of [spec.relatingId, ...ids]) {
|
|
10
|
+
if (!Number.isInteger(id) || id <= 0)
|
|
11
|
+
throw new Error(`${op}: ${id} is not an entity id`);
|
|
12
|
+
}
|
|
13
|
+
if (ids.includes(spec.relatingId))
|
|
14
|
+
throw new Error(`${op}: #${spec.relatingId} cannot relate to itself`);
|
|
15
|
+
const moving = new Set(ids);
|
|
16
|
+
const target = spec.existing.find((rel) => rel.relatingId === spec.relatingId);
|
|
17
|
+
const detachedRelIds = [];
|
|
18
|
+
for (const rel of spec.existing) {
|
|
19
|
+
if (rel === target || !rel.relatedIds.some((id) => moving.has(id)))
|
|
20
|
+
continue;
|
|
21
|
+
detachedRelIds.push(rel.relId);
|
|
22
|
+
const remaining = rel.relatedIds.filter((id) => !moving.has(id));
|
|
23
|
+
if (remaining.length === 0)
|
|
24
|
+
editor.removeEntity(rel.relId);
|
|
25
|
+
else
|
|
26
|
+
editor.setPositionalAttribute(rel.relId, RELATED_SLOT, remaining.map((id) => `#${id}`));
|
|
27
|
+
}
|
|
28
|
+
if (target) {
|
|
29
|
+
const merged = [...new Set([...target.relatedIds, ...ids])];
|
|
30
|
+
if (merged.length !== target.relatedIds.length) {
|
|
31
|
+
editor.setPositionalAttribute(target.relId, RELATED_SLOT, merged.map((id) => `#${id}`));
|
|
32
|
+
}
|
|
33
|
+
return { relId: target.relId, created: false, detachedRelIds };
|
|
34
|
+
}
|
|
35
|
+
const attrs = spec.create(ids.map((id) => `#${id}`));
|
|
36
|
+
const relId = editor.addEntity(spec.relType, attrs).expressId;
|
|
37
|
+
return { relId, created: true, detachedRelIds };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=relate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relate.js","sourceRoot":"","sources":["../../src/in-store/relate.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAkB/D,MAAM,YAAY,GAAG,CAAC,CAAC;AAoBvB,MAAM,UAAU,sBAAsB,CAAC,MAAmB,EAAE,IAAmB,EAAE,EAAU;IACzF,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC;IAC5E,KAAK,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC;IAC5F,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC,UAAU,0BAA0B,CAAC,CAAC;IAEzG,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/E,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC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GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,KAAgD,CAAC,CAAC,SAAS,CAAC;IACzG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -7,8 +7,28 @@
|
|
|
7
7
|
* 3D IfcGeometricRepresentationContext), and the target storey's
|
|
8
8
|
* IfcLocalPlacement.
|
|
9
9
|
*/
|
|
10
|
-
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
10
|
+
import { type EffectiveEntityRecord, type IfcDataStore } from '@ifc-lite/parser';
|
|
11
11
|
import { type MutablePropertyView } from '@ifc-lite/mutations';
|
|
12
12
|
import type { SpatialAnchor } from './anchor.js';
|
|
13
13
|
export declare function resolveSpatialAnchor(store: IfcDataStore, storeyExpressId: number, view?: MutablePropertyView | null): SpatialAnchor;
|
|
14
|
+
/**
|
|
15
|
+
* Read source and overlay entities through the same effective ID boundary.
|
|
16
|
+
* Shared with `resolve-host.ts`, whose host-geometry walk needs the same
|
|
17
|
+
* overlay-aware point lookups.
|
|
18
|
+
*/
|
|
19
|
+
export declare class AnchorEntityReader {
|
|
20
|
+
private readonly store;
|
|
21
|
+
private readonly view;
|
|
22
|
+
private readonly extractor;
|
|
23
|
+
constructor(store: IfcDataStore, view: MutablePropertyView | null | undefined);
|
|
24
|
+
ids(type: string): IterableIterator<number>;
|
|
25
|
+
firstId(type: string): number | null;
|
|
26
|
+
/** Prefer the named subcontext, then the root 3D context. */
|
|
27
|
+
contextId(identifier: 'body' | 'axis', rootContextId: number | null): number | null;
|
|
28
|
+
/** The model's root 3D context, never a subcontext. */
|
|
29
|
+
rootContextId(): number | null;
|
|
30
|
+
/** The effective storey's live IfcLocalPlacement, including overlay refs. */
|
|
31
|
+
storeyPlacementId(storeyId: number): number | null;
|
|
32
|
+
entity(id: number): EffectiveEntityRecord | null;
|
|
33
|
+
}
|
|
14
34
|
//# sourceMappingURL=resolve-anchor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-anchor.d.ts","sourceRoot":"","sources":["../../src/in-store/resolve-anchor.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"resolve-anchor.d.ts","sourceRoot":"","sources":["../../src/in-store/resolve-anchor.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAiD,KAAK,qBAAqB,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChI,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,aAAa,CAAC;AAGtE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,YAAY,EACnB,eAAe,EAAE,MAAM,EACvB,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAChC,aAAa,CAiDf;AAED;;;;GAIG;AACH,qBAAa,kBAAkB;IAI3B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;gBAGhC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS;IAK9D,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAM5C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIpC,6DAA6D;IAC7D,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI;IASnF,uDAAuD;IACvD,aAAa,IAAI,MAAM,GAAG,IAAI;IAW9B,6EAA6E;IAC7E,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAgBlD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI;CAcjD"}
|
|
@@ -53,8 +53,12 @@ export function resolveSpatialAnchor(store, storeyExpressId, view) {
|
|
|
53
53
|
: 1.0;
|
|
54
54
|
return { ownerHistoryId, bodyContextId, axisContextId, rootContextId, storeyId: storeyExpressId, storeyPlacementId, schema, lengthUnitScale };
|
|
55
55
|
}
|
|
56
|
-
/**
|
|
57
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Read source and overlay entities through the same effective ID boundary.
|
|
58
|
+
* Shared with `resolve-host.ts`, whose host-geometry walk needs the same
|
|
59
|
+
* overlay-aware point lookups.
|
|
60
|
+
*/
|
|
61
|
+
export class AnchorEntityReader {
|
|
58
62
|
store;
|
|
59
63
|
view;
|
|
60
64
|
extractor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-anchor.js","sourceRoot":"","sources":["../../src/in-store/resolve-anchor.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAiD,MAAM,kBAAkB,CAAC;AAChI,OAAO,EAAE,yBAAyB,EAA4B,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,UAAU,oBAAoB,CAClC,KAAmB,EACnB,eAAuB,EACvB,IAAiC;IAEjC,MAAM,MAAM,GAAG,IAAI,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACnD,uEAAuE;IACvE,wEAAwE;IACxE,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEzD,MAAM,aAAa,GAAG,MAAM,CAA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,CAAC,CAAC,IAAI,CAAC;QAChF,MAAM,MAAM,GAAG,OAAO,IAAI,MAAM,CAAC;QACjC,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,OAAO,4BAA4B,CAAC,MAAM,EAAE;YAC1C,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,qBAAqB,CAAC,EAAE,CAAC,EAAE,OAAO;YACrD,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,8BAA8B,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,CAAU,CAAC,IAAI,EAAE;YAC3G,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,+BAA+B,CAAC,EAAE,CAAC,IAAI,EAAE;SACjE,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
2
|
+
import type { MutablePropertyView } from '@ifc-lite/mutations';
|
|
3
|
+
import type { HostAnchor, HostBounds } from './anchor.js';
|
|
4
|
+
export declare function resolveHostAnchor(store: IfcDataStore, hostExpressId: number, view?: MutablePropertyView | null): HostAnchor;
|
|
5
|
+
/**
|
|
6
|
+
* The extent of `productId`'s Body geometry in its PARENT placement's frame
|
|
7
|
+
* (native units): the body bounds taken through the product's own
|
|
8
|
+
* RelativePlacement. For an opening placed relative to its host, that is the
|
|
9
|
+
* cut's extent in the host's frame, whatever profile or orientation the
|
|
10
|
+
* authoring tool gave it. Null when the product has no readable body.
|
|
11
|
+
*/
|
|
12
|
+
export declare function placedBodyExtent(store: IfcDataStore, productId: number, view?: MutablePropertyView | null): HostBounds | null;
|
|
13
|
+
/** Package-private Model Body bounds before ObjectPlacement. Plan annotation
|
|
14
|
+
* representations are not physical volume; unreadable 3D parts still refuse. */
|
|
15
|
+
export declare function localBodyExtent(store: IfcDataStore, productId: number, view?: MutablePropertyView | null): HostBounds | null;
|
|
16
|
+
//# sourceMappingURL=resolve-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-host.d.ts","sourceRoot":"","sources":["../../src/in-store/resolve-host.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAY,MAAM,aAAa,CAAC;AAYpE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAChC,UAAU,CAuBZ;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAChC,UAAU,GAAG,IAAI,CAYnB;AAED;gFACgF;AAChF,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAK5H"}
|