@ifc-lite/create 1.14.5 → 1.15.1
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/dist/ifc-creator-math.d.ts +23 -0
- package/dist/ifc-creator-math.d.ts.map +1 -0
- package/dist/ifc-creator-math.js +50 -0
- package/dist/ifc-creator-math.js.map +1 -0
- package/dist/ifc-creator.d.ts +63 -1
- package/dist/ifc-creator.d.ts.map +1 -1
- package/dist/ifc-creator.js +222 -41
- package/dist/ifc-creator.js.map +1 -1
- package/dist/in-store/_emit-helpers.d.ts +52 -0
- package/dist/in-store/_emit-helpers.d.ts.map +1 -0
- package/dist/in-store/_emit-helpers.js +147 -0
- package/dist/in-store/_emit-helpers.js.map +1 -0
- package/dist/in-store/anchor.d.ts +29 -0
- package/dist/in-store/anchor.d.ts.map +1 -0
- package/dist/in-store/anchor.js +5 -0
- package/dist/in-store/anchor.js.map +1 -0
- package/dist/in-store/auto-space-detect.d.ts +68 -0
- package/dist/in-store/auto-space-detect.d.ts.map +1 -0
- package/dist/in-store/auto-space-detect.js +393 -0
- package/dist/in-store/auto-space-detect.js.map +1 -0
- package/dist/in-store/beam.d.ts +25 -0
- package/dist/in-store/beam.d.ts.map +1 -0
- package/dist/in-store/beam.js +119 -0
- package/dist/in-store/beam.js.map +1 -0
- package/dist/in-store/column.d.ts +42 -0
- package/dist/in-store/column.d.ts.map +1 -0
- package/dist/in-store/column.js +108 -0
- package/dist/in-store/column.js.map +1 -0
- package/dist/in-store/door.d.ts +44 -0
- package/dist/in-store/door.d.ts.map +1 -0
- package/dist/in-store/door.js +68 -0
- package/dist/in-store/door.js.map +1 -0
- package/dist/in-store/duplicate.d.ts +100 -0
- package/dist/in-store/duplicate.d.ts.map +1 -0
- package/dist/in-store/duplicate.js +122 -0
- package/dist/in-store/duplicate.js.map +1 -0
- package/dist/in-store/extract-walls.d.ts +80 -0
- package/dist/in-store/extract-walls.d.ts.map +1 -0
- package/dist/in-store/extract-walls.js +522 -0
- package/dist/in-store/extract-walls.js.map +1 -0
- package/dist/in-store/generate-spaces.d.ts +71 -0
- package/dist/in-store/generate-spaces.d.ts.map +1 -0
- package/dist/in-store/generate-spaces.js +76 -0
- package/dist/in-store/generate-spaces.js.map +1 -0
- package/dist/in-store/member.d.ts +32 -0
- package/dist/in-store/member.d.ts.map +1 -0
- package/dist/in-store/member.js +35 -0
- package/dist/in-store/member.js.map +1 -0
- package/dist/in-store/plate.d.ts +43 -0
- package/dist/in-store/plate.d.ts.map +1 -0
- package/dist/in-store/plate.js +33 -0
- package/dist/in-store/plate.js.map +1 -0
- package/dist/in-store/resolve-anchor.d.ts +12 -0
- package/dist/in-store/resolve-anchor.d.ts.map +1 -0
- package/dist/in-store/resolve-anchor.js +125 -0
- package/dist/in-store/resolve-anchor.js.map +1 -0
- package/dist/in-store/resolve-source.d.ts +19 -0
- package/dist/in-store/resolve-source.d.ts.map +1 -0
- package/dist/in-store/resolve-source.js +203 -0
- package/dist/in-store/resolve-source.js.map +1 -0
- package/dist/in-store/roof.d.ts +43 -0
- package/dist/in-store/roof.d.ts.map +1 -0
- package/dist/in-store/roof.js +33 -0
- package/dist/in-store/roof.js.map +1 -0
- package/dist/in-store/slab.d.ts +44 -0
- package/dist/in-store/slab.d.ts.map +1 -0
- package/dist/in-store/slab.js +142 -0
- package/dist/in-store/slab.js.map +1 -0
- package/dist/in-store/space.d.ts +43 -0
- package/dist/in-store/space.d.ts.map +1 -0
- package/dist/in-store/space.js +71 -0
- package/dist/in-store/space.js.map +1 -0
- package/dist/in-store/wall.d.ts +27 -0
- package/dist/in-store/wall.d.ts.map +1 -0
- package/dist/in-store/wall.js +121 -0
- package/dist/in-store/wall.js.map +1 -0
- package/dist/in-store/window.d.ts +36 -0
- package/dist/in-store/window.d.ts.map +1 -0
- package/dist/in-store/window.js +57 -0
- package/dist/in-store/window.js.map +1 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +96 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -6
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
* Duplicate an existing IfcRoot product in place via the StoreEditor
|
|
6
|
+
* overlay. Geometry is shared (the new entity points at the source's
|
|
7
|
+
* Representation by reference), and the new placement is offset from
|
|
8
|
+
* the source's so the duplicate is visible — the user can refine the
|
|
9
|
+
* position via Raw STEP editing or, in a future PR, a place-mode
|
|
10
|
+
* cursor flow.
|
|
11
|
+
*
|
|
12
|
+
* What lands in the overlay (4 new entities + 1 new spatial rel):
|
|
13
|
+
* 1. IfcCartesianPoint — the new world position
|
|
14
|
+
* 2. IfcAxis2Placement3D — wraps the new point, reuses source axes
|
|
15
|
+
* 3. IfcLocalPlacement — chains to the source's parent placement
|
|
16
|
+
* 4. {SourceType} — new GUID + new placement, same Representation ref
|
|
17
|
+
* 5. IfcRelContainedInSpatialStructure — anchors the new entity to
|
|
18
|
+
* the same storey the source belongs to (or skipped if the
|
|
19
|
+
* source isn't spatially contained)
|
|
20
|
+
*
|
|
21
|
+
* The function is pure — no I/O, no parser access. It accepts the
|
|
22
|
+
* already-extracted source attributes and does the bookkeeping.
|
|
23
|
+
*/
|
|
24
|
+
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
25
|
+
/**
|
|
26
|
+
* Emit a duplicate of the source product into the editor overlay.
|
|
27
|
+
* Returns the new expressIds. Throws if the source attributes don't
|
|
28
|
+
* have at least 7 slots (the minimum IfcProduct surface).
|
|
29
|
+
*/
|
|
30
|
+
export function duplicateInStore(editor, source, options = {}) {
|
|
31
|
+
if (source.attributes.length < 7) {
|
|
32
|
+
throw new Error(`duplicateInStore: source has ${source.attributes.length} attributes, need ≥7 for an IfcProduct`);
|
|
33
|
+
}
|
|
34
|
+
const offset = options.offset ?? [1, 0, 0];
|
|
35
|
+
const newLocation = [
|
|
36
|
+
source.sourceLocation[0] + offset[0],
|
|
37
|
+
source.sourceLocation[1] + offset[1],
|
|
38
|
+
source.sourceLocation[2] + offset[2],
|
|
39
|
+
];
|
|
40
|
+
// 1. New IfcCartesianPoint at the offset position.
|
|
41
|
+
const point = editor.addEntity('IfcCartesianPoint', [
|
|
42
|
+
[newLocation[0], newLocation[1], newLocation[2]],
|
|
43
|
+
]);
|
|
44
|
+
// 2. New IfcAxis2Placement3D wrapping the new point. Reuse source
|
|
45
|
+
// axis + ref-direction so the duplicate keeps the source's
|
|
46
|
+
// rotation. The two ref args are passed through as the verbatim
|
|
47
|
+
// STEP tokens captured at extraction time (`"#N"` or `"$"`).
|
|
48
|
+
const axisPlacement = editor.addEntity('IfcAxis2Placement3D', [
|
|
49
|
+
`#${point.expressId}`,
|
|
50
|
+
source.axisRef,
|
|
51
|
+
source.refDirectionRef,
|
|
52
|
+
]);
|
|
53
|
+
// 3. New IfcLocalPlacement chained to the source's parent (or `$`
|
|
54
|
+
// if the source sat at the spatial root).
|
|
55
|
+
const placement = editor.addEntity('IfcLocalPlacement', [
|
|
56
|
+
source.parentPlacementId !== null ? `#${source.parentPlacementId}` : null,
|
|
57
|
+
`#${axisPlacement.expressId}`,
|
|
58
|
+
]);
|
|
59
|
+
// 4. The duplicate IfcRoot. New GUID; new ObjectPlacement; same
|
|
60
|
+
// Representation reference (geometry shared); name suffix unless
|
|
61
|
+
// the caller provided one.
|
|
62
|
+
const sourceName = source.attributes[2];
|
|
63
|
+
const duplicateName = options.name !== undefined
|
|
64
|
+
? options.name
|
|
65
|
+
: (typeof sourceName === 'string' && sourceName.length > 0
|
|
66
|
+
? `${sourceName} (copy)`
|
|
67
|
+
: sourceName);
|
|
68
|
+
const cloned = source.attributes.slice();
|
|
69
|
+
cloned[0] = generateIfcGuid(); // GlobalId
|
|
70
|
+
cloned[1] = source.ownerHistoryId !== null
|
|
71
|
+
? `#${source.ownerHistoryId}`
|
|
72
|
+
: null; // OwnerHistory (preserved; null when source omitted it)
|
|
73
|
+
cloned[2] = duplicateName; // Name
|
|
74
|
+
cloned[5] = `#${placement.expressId}`; // ObjectPlacement
|
|
75
|
+
// cloned[6] (Representation) intentionally untouched — share geometry.
|
|
76
|
+
// cloned[7] (Tag) — leave the source tag; STEP allows duplicate tags.
|
|
77
|
+
const duplicate = editor.addEntity(source.type, cloned);
|
|
78
|
+
// 5. Optional: new IfcRelContainedInSpatialStructure anchoring the
|
|
79
|
+
// new entity to the same storey. Skipped when the source had no
|
|
80
|
+
// storey context.
|
|
81
|
+
let relContainedId = null;
|
|
82
|
+
if (source.storeyId !== null) {
|
|
83
|
+
const rel = editor.addEntity('IfcRelContainedInSpatialStructure', [
|
|
84
|
+
generateIfcGuid(), // GlobalId
|
|
85
|
+
source.ownerHistoryId !== null ? `#${source.ownerHistoryId}` : null, // OwnerHistory
|
|
86
|
+
null, // Name
|
|
87
|
+
null, // Description
|
|
88
|
+
[`#${duplicate.expressId}`], // RelatedElements
|
|
89
|
+
`#${source.storeyId}`, // RelatingStructure
|
|
90
|
+
]);
|
|
91
|
+
relContainedId = rel.expressId;
|
|
92
|
+
}
|
|
93
|
+
// 6. Replay every IfcRelDefines* / IfcRelAssociates* edge that
|
|
94
|
+
// references the source. Emits one fresh rel per association so
|
|
95
|
+
// the duplicate carries identical psets, qsets, material,
|
|
96
|
+
// classifications, documents, and type binding in the exported
|
|
97
|
+
// STEP. Modifies no existing rel — each new rel has just the
|
|
98
|
+
// duplicate in its RelatedObjects list.
|
|
99
|
+
const associationRelIds = [];
|
|
100
|
+
if (source.associations && source.associations.length > 0) {
|
|
101
|
+
for (const assoc of source.associations) {
|
|
102
|
+
const rel = editor.addEntity(assoc.relType, [
|
|
103
|
+
generateIfcGuid(), // GlobalId
|
|
104
|
+
assoc.ownerHistoryId !== null ? `#${assoc.ownerHistoryId}` : null, // OwnerHistory
|
|
105
|
+
assoc.name, // Name (parsed; may be null)
|
|
106
|
+
assoc.description, // Description
|
|
107
|
+
[`#${duplicate.expressId}`], // RelatedObjects
|
|
108
|
+
`#${assoc.relatingExpressId}`, // Relating*
|
|
109
|
+
]);
|
|
110
|
+
associationRelIds.push(rel.expressId);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
newId: duplicate.expressId,
|
|
115
|
+
newPlacementId: placement.expressId,
|
|
116
|
+
newPointId: point.expressId,
|
|
117
|
+
newAxisPlacementId: axisPlacement.expressId,
|
|
118
|
+
relContainedId,
|
|
119
|
+
associationRelIds,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=duplicate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicate.js","sourceRoot":"","sources":["../../src/in-store/duplicate.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAoGrD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAmB,EACnB,MAAwB,EACxB,UAAmC,EAAE;IAErC,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,gCAAgC,MAAM,CAAC,UAAU,CAAC,MAAM,wCAAwC,CACjG,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAS,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjD,MAAM,WAAW,GAAS;QACxB,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACpC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACpC,MAAM,CAAC,cAAc,CA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E,CAAC;QAC1D,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxC,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE;gBAC1C,eAAe,EAAE,EAAmD,WAAW;gBAC/E,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,EAAG,eAAe;gBACnF,KAAK,CAAC,IAAI,EAA0D,6BAA6B;gBACjG,KAAK,CAAC,WAAW,EAAmD,cAAc;gBAClF,CAAC,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC,EAAyC,iBAAiB;gBACrF,IAAI,KAAK,CAAC,iBAAiB,EAAE,EAAuC,YAAY;aACjF,CAAC,CAAC;YACH,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,SAAS,CAAC,SAAS;QAC1B,cAAc,EAAE,SAAS,CAAC,SAAS;QACnC,UAAU,EAAE,KAAK,CAAC,SAAS;QAC3B,kBAAkB,EAAE,aAAa,CAAC,SAAS;QAC3C,cAAc;QACd,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pull every wall axis on a given storey from a parsed `IfcDataStore`
|
|
3
|
+
* plus an optional overlay (`MutablePropertyView`-style new-entities
|
|
4
|
+
* map). The resulting 2D segments feed `detectEnclosedAreas`.
|
|
5
|
+
*
|
|
6
|
+
* Two extraction strategies, tried in order:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Axis representation** (preferred).
|
|
9
|
+
* `IfcShapeRepresentation` with `RepresentationIdentifier = 'Axis'`
|
|
10
|
+
* is the standard way authoring tools (Revit, ArchiCAD, etc.) ship
|
|
11
|
+
* a wall's centreline. Items are usually `IfcPolyline` (2 points →
|
|
12
|
+
* start, end) or `IfcTrimmedCurve` (treated as polyline endpoints).
|
|
13
|
+
* The endpoints are read in storey-local space, walked through the
|
|
14
|
+
* placement chain, and projected to the storey-floor plane.
|
|
15
|
+
*
|
|
16
|
+
* 2. **Body fallback — placement + IfcRectangleProfileDef.XDim**.
|
|
17
|
+
* Matches the convention emitted by `addWallToStore` /
|
|
18
|
+
* `IfcCreator.addIfcWall`: placement origin = wall Start,
|
|
19
|
+
* RefDirection = wall axis, profile XDim = wall length. Used for
|
|
20
|
+
* walls authored by the Add Element tool or anything else that
|
|
21
|
+
* mirrors that shape.
|
|
22
|
+
*
|
|
23
|
+
* Walls that match neither shape are skipped with a recorded reason —
|
|
24
|
+
* `WallExtractionResult.skipped[]` carries `{ wallId, reason }` so
|
|
25
|
+
* callers (and the viewer's Auto Spaces UI) can surface why a wall
|
|
26
|
+
* didn't contribute to the planar graph.
|
|
27
|
+
*/
|
|
28
|
+
import { type IfcDataStore, type IfcAttributeValue } from '@ifc-lite/parser';
|
|
29
|
+
import type { Segment } from './auto-space-detect.js';
|
|
30
|
+
/**
|
|
31
|
+
* Optional overlay reader. If supplied, overlay walls (entities
|
|
32
|
+
* created via `editor.addEntity('IfcWall', ...)` since the model was
|
|
33
|
+
* parsed) are included alongside the source walls.
|
|
34
|
+
*/
|
|
35
|
+
export interface OverlayWallReader {
|
|
36
|
+
/** Iterate every overlay-created entity. */
|
|
37
|
+
getNewEntities(): Iterable<{
|
|
38
|
+
expressId: number;
|
|
39
|
+
type: string;
|
|
40
|
+
attributes: IfcAttributeValue[];
|
|
41
|
+
}>;
|
|
42
|
+
/** Resolve a positional attribute (with mutations applied). */
|
|
43
|
+
getAttribute?(expressId: number, index: number): IfcAttributeValue | undefined;
|
|
44
|
+
}
|
|
45
|
+
export type WallSkipReason = 'no-source-bytes' | 'wall-not-parsed' | 'no-placement' | 'no-representation' | 'placement-not-resolvable' | 'no-axis-or-rect-profile' | 'zero-length-axis' | 'sloped-axis';
|
|
46
|
+
export interface WallSkip {
|
|
47
|
+
wallId: number;
|
|
48
|
+
reason: WallSkipReason;
|
|
49
|
+
}
|
|
50
|
+
export interface WallExtractionResult {
|
|
51
|
+
segments: Segment[];
|
|
52
|
+
/** Wall expressIds that contributed an axis segment. */
|
|
53
|
+
contributingWallIds: number[];
|
|
54
|
+
/** Walls dropped by the extractor, with the reason. */
|
|
55
|
+
skipped: WallSkip[];
|
|
56
|
+
/** Best-effort total wall count visible on the storey (existing + overlay). */
|
|
57
|
+
considered: number;
|
|
58
|
+
/**
|
|
59
|
+
* Length-unit scale that was applied to the extracted segments
|
|
60
|
+
* (e.g. `0.001` for a millimetre model). Reported so callers can
|
|
61
|
+
* scale their snap tolerance / min area to match.
|
|
62
|
+
*/
|
|
63
|
+
lengthUnitScale: number;
|
|
64
|
+
}
|
|
65
|
+
export interface ExtractWallSegmentsOptions {
|
|
66
|
+
/**
|
|
67
|
+
* When true, the extractor emits `console.debug` messages for the
|
|
68
|
+
* containment scan + per-wall extraction step. Useful for diagnosing
|
|
69
|
+
* "no enclosed regions detected" in the Auto Spaces flow.
|
|
70
|
+
*/
|
|
71
|
+
debug?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Additional element types to treat as space dividers. Defaults to
|
|
74
|
+
* the standard wall set; pass extras here to broaden coverage on
|
|
75
|
+
* unusual models. Names are case-insensitive (`'IfcMember'` etc.).
|
|
76
|
+
*/
|
|
77
|
+
extraDividerTypes?: string[];
|
|
78
|
+
}
|
|
79
|
+
export declare function extractWallSegmentsForStorey(store: IfcDataStore, storeyExpressId: number, overlay?: OverlayWallReader, options?: ExtractWallSegmentsOptions): WallExtractionResult;
|
|
80
|
+
//# sourceMappingURL=extract-walls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-walls.d.ts","sourceRoot":"","sources":["../../src/in-store/extract-walls.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAGL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