@ifc-lite/parser 1.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/LICENSE +373 -0
- package/README.md +326 -0
- package/dist/classification-extractor.d.ts +73 -0
- package/dist/classification-extractor.d.ts.map +1 -0
- package/dist/classification-extractor.js +218 -0
- package/dist/classification-extractor.js.map +1 -0
- package/dist/columnar-parser.d.ts +43 -0
- package/dist/columnar-parser.d.ts.map +1 -0
- package/dist/columnar-parser.js +226 -0
- package/dist/columnar-parser.js.map +1 -0
- package/dist/entity-extractor.d.ts +15 -0
- package/dist/entity-extractor.d.ts.map +1 -0
- package/dist/entity-extractor.js +144 -0
- package/dist/entity-extractor.js.map +1 -0
- package/dist/entity-index.d.ts +11 -0
- package/dist/entity-index.d.ts.map +1 -0
- package/dist/entity-index.js +24 -0
- package/dist/entity-index.js.map +1 -0
- package/dist/examples/comprehensive-extraction.d.ts +76 -0
- package/dist/examples/comprehensive-extraction.d.ts.map +1 -0
- package/dist/examples/comprehensive-extraction.js +228 -0
- package/dist/examples/comprehensive-extraction.js.map +1 -0
- package/dist/generated/entities.d.ts +6198 -0
- package/dist/generated/entities.d.ts.map +1 -0
- package/dist/generated/entities.js +5 -0
- package/dist/generated/entities.js.map +1 -0
- package/dist/generated/enums.d.ts +2260 -0
- package/dist/generated/enums.d.ts.map +1 -0
- package/dist/generated/enums.js +2470 -0
- package/dist/generated/enums.js.map +1 -0
- package/dist/generated/index.d.ts +11 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +14 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/schema-registry.d.ts +50 -0
- package/dist/generated/schema-registry.d.ts.map +1 -0
- package/dist/generated/schema-registry.js +60518 -0
- package/dist/generated/schema-registry.js.map +1 -0
- package/dist/generated/selects.d.ts +127 -0
- package/dist/generated/selects.d.ts.map +1 -0
- package/dist/generated/selects.js +5 -0
- package/dist/generated/selects.js.map +1 -0
- package/dist/generated/test-compile.d.ts +7 -0
- package/dist/generated/test-compile.d.ts.map +1 -0
- package/dist/generated/test-compile.js +30 -0
- package/dist/generated/test-compile.js.map +1 -0
- package/dist/generated/types.d.ts +801 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +499 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/georef-extractor.d.ts +60 -0
- package/dist/georef-extractor.d.ts.map +1 -0
- package/dist/georef-extractor.js +200 -0
- package/dist/georef-extractor.js.map +1 -0
- package/dist/ifc-schema.d.ts +13 -0
- package/dist/ifc-schema.d.ts.map +1 -0
- package/dist/ifc-schema.js +203 -0
- package/dist/ifc-schema.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +150 -0
- package/dist/index.js.map +1 -0
- package/dist/material-extractor.d.ts +97 -0
- package/dist/material-extractor.d.ts.map +1 -0
- package/dist/material-extractor.js +283 -0
- package/dist/material-extractor.js.map +1 -0
- package/dist/property-extractor.d.ts +23 -0
- package/dist/property-extractor.d.ts.map +1 -0
- package/dist/property-extractor.js +102 -0
- package/dist/property-extractor.js.map +1 -0
- package/dist/quantity-extractor.d.ts +64 -0
- package/dist/quantity-extractor.d.ts.map +1 -0
- package/dist/quantity-extractor.js +202 -0
- package/dist/quantity-extractor.js.map +1 -0
- package/dist/relationship-extractor.d.ts +18 -0
- package/dist/relationship-extractor.d.ts.map +1 -0
- package/dist/relationship-extractor.js +91 -0
- package/dist/relationship-extractor.js.map +1 -0
- package/dist/spatial-hierarchy-builder.d.ts +21 -0
- package/dist/spatial-hierarchy-builder.d.ts.map +1 -0
- package/dist/spatial-hierarchy-builder.js +201 -0
- package/dist/spatial-hierarchy-builder.js.map +1 -0
- package/dist/style-extractor.d.ts +83 -0
- package/dist/style-extractor.d.ts.map +1 -0
- package/dist/style-extractor.js +327 -0
- package/dist/style-extractor.js.map +1 -0
- package/dist/tokenizer.d.ts +26 -0
- package/dist/tokenizer.d.ts.map +1 -0
- package/dist/tokenizer.js +181 -0
- package/dist/tokenizer.js.map +1 -0
- package/dist/types.d.ts +42 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classification Extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts IFC classification information.
|
|
5
|
+
*
|
|
6
|
+
* Classification systems in IFC:
|
|
7
|
+
* - IfcClassification: The classification system itself (e.g., Uniclass, Omniclass, MasterFormat)
|
|
8
|
+
* - IfcClassificationReference: Reference to a specific class in the system
|
|
9
|
+
* - IfcRelAssociatesClassification: Associates classifications with elements
|
|
10
|
+
*
|
|
11
|
+
* Common classification systems:
|
|
12
|
+
* - Uniclass 2015 (UK)
|
|
13
|
+
* - Omniclass (North America)
|
|
14
|
+
* - MasterFormat (North America)
|
|
15
|
+
* - Uniformat (North America)
|
|
16
|
+
* - DIN 276 (Germany)
|
|
17
|
+
* - SfB (Sweden/Denmark)
|
|
18
|
+
*/
|
|
19
|
+
import type { IfcEntity } from './entity-extractor';
|
|
20
|
+
export interface Classification {
|
|
21
|
+
id: number;
|
|
22
|
+
name: string;
|
|
23
|
+
source?: string;
|
|
24
|
+
edition?: string;
|
|
25
|
+
editionDate?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
location?: string;
|
|
28
|
+
referenceTokens?: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface ClassificationReference {
|
|
31
|
+
id: number;
|
|
32
|
+
location?: string;
|
|
33
|
+
identification?: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
referencedSource?: number;
|
|
36
|
+
description?: string;
|
|
37
|
+
sort?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ClassificationAssociation {
|
|
40
|
+
relationshipId: number;
|
|
41
|
+
classificationId: number;
|
|
42
|
+
relatedObjects: number[];
|
|
43
|
+
}
|
|
44
|
+
export interface ClassificationsData {
|
|
45
|
+
classifications: Map<number, Classification>;
|
|
46
|
+
classificationReferences: Map<number, ClassificationReference>;
|
|
47
|
+
associations: ClassificationAssociation[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Extract classifications from IFC entities
|
|
51
|
+
*/
|
|
52
|
+
export declare function extractClassifications(entities: Map<number, IfcEntity>, entitiesByType: Map<string, number[]>): ClassificationsData;
|
|
53
|
+
/**
|
|
54
|
+
* Get classifications for an element
|
|
55
|
+
*/
|
|
56
|
+
export declare function getClassificationsForElement(elementId: number, classificationsData: ClassificationsData): ClassificationReference[];
|
|
57
|
+
/**
|
|
58
|
+
* Get classification code for an element (first classification found)
|
|
59
|
+
*/
|
|
60
|
+
export declare function getClassificationCodeForElement(elementId: number, classificationsData: ClassificationsData): string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Get full classification path (e.g., "Pr_60 > Pr_60_10 > Pr_60_10_32")
|
|
63
|
+
*/
|
|
64
|
+
export declare function getClassificationPath(classificationRefId: number, classificationsData: ClassificationsData): string[];
|
|
65
|
+
/**
|
|
66
|
+
* Group elements by classification
|
|
67
|
+
*/
|
|
68
|
+
export declare function groupElementsByClassification(classificationsData: ClassificationsData): Map<string, number[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Get classification system name
|
|
71
|
+
*/
|
|
72
|
+
export declare function getClassificationSystemName(classificationRefId: number, classificationsData: ClassificationsData): string | undefined;
|
|
73
|
+
//# sourceMappingURL=classification-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classification-extractor.d.ts","sourceRoot":"","sources":["../src/classification-extractor.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IA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B,qBAAqB,CACnC,mBAAmB,EAAE,MAAM,EAC3B,mBAAmB,EAAE,mBAAmB,GACvC,MAAM,EAAE,CA8BV;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,mBAAmB,EAAE,mBAAmB,GACvC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAavB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,mBAAmB,EAAE,MAAM,EAC3B,mBAAmB,EAAE,mBAAmB,GACvC,MAAM,GAAG,SAAS,CAmBpB"}
|
|
@@ -0,0 +1,218 @@
|
|
|
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
|
+
* Extract classifications from IFC entities
|
|
6
|
+
*/
|
|
7
|
+
export function extractClassifications(entities, entitiesByType) {
|
|
8
|
+
const data = {
|
|
9
|
+
classifications: new Map(),
|
|
10
|
+
classificationReferences: new Map(),
|
|
11
|
+
associations: [],
|
|
12
|
+
};
|
|
13
|
+
// Extract IfcClassification
|
|
14
|
+
const classificationIds = entitiesByType.get('IfcClassification') || [];
|
|
15
|
+
for (const id of classificationIds) {
|
|
16
|
+
const entity = entities.get(id);
|
|
17
|
+
if (entity) {
|
|
18
|
+
data.classifications.set(id, extractClassification(entity));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// Extract IfcClassificationReference
|
|
22
|
+
const referenceIds = entitiesByType.get('IfcClassificationReference') || [];
|
|
23
|
+
for (const id of referenceIds) {
|
|
24
|
+
const entity = entities.get(id);
|
|
25
|
+
if (entity) {
|
|
26
|
+
data.classificationReferences.set(id, extractClassificationReference(entity));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Extract IfcRelAssociatesClassification
|
|
30
|
+
const relIds = entitiesByType.get('IfcRelAssociatesClassification') || [];
|
|
31
|
+
for (const id of relIds) {
|
|
32
|
+
const entity = entities.get(id);
|
|
33
|
+
if (entity) {
|
|
34
|
+
const association = extractClassificationAssociation(entity);
|
|
35
|
+
if (association) {
|
|
36
|
+
data.associations.push(association);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
function extractClassification(entity) {
|
|
43
|
+
// IfcClassification attributes (IFC4):
|
|
44
|
+
// [0] Source (OPTIONAL IfcLabel)
|
|
45
|
+
// [1] Edition (OPTIONAL IfcLabel)
|
|
46
|
+
// [2] EditionDate (OPTIONAL IfcDate)
|
|
47
|
+
// [3] Name (IfcLabel)
|
|
48
|
+
// [4] Description (OPTIONAL IfcText)
|
|
49
|
+
// [5] Location (OPTIONAL IfcURIReference)
|
|
50
|
+
// [6] ReferenceTokens (OPTIONAL LIST OF IfcIdentifier)
|
|
51
|
+
return {
|
|
52
|
+
id: entity.id,
|
|
53
|
+
source: getString(entity.attributes[0]),
|
|
54
|
+
edition: getString(entity.attributes[1]),
|
|
55
|
+
editionDate: getString(entity.attributes[2]),
|
|
56
|
+
name: getString(entity.attributes[3]) || '',
|
|
57
|
+
description: getString(entity.attributes[4]),
|
|
58
|
+
location: getString(entity.attributes[5]),
|
|
59
|
+
referenceTokens: getStringList(entity.attributes[6]),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function extractClassificationReference(entity) {
|
|
63
|
+
// IfcClassificationReference attributes (IFC4):
|
|
64
|
+
// [0] Location (OPTIONAL IfcURIReference)
|
|
65
|
+
// [1] Identification (OPTIONAL IfcIdentifier)
|
|
66
|
+
// [2] Name (OPTIONAL IfcLabel)
|
|
67
|
+
// [3] ReferencedSource (OPTIONAL IfcClassificationReferenceSelect)
|
|
68
|
+
// [4] Description (OPTIONAL IfcText)
|
|
69
|
+
// [5] Sort (OPTIONAL IfcIdentifier)
|
|
70
|
+
return {
|
|
71
|
+
id: entity.id,
|
|
72
|
+
location: getString(entity.attributes[0]),
|
|
73
|
+
identification: getString(entity.attributes[1]),
|
|
74
|
+
name: getString(entity.attributes[2]),
|
|
75
|
+
referencedSource: getReference(entity.attributes[3]),
|
|
76
|
+
description: getString(entity.attributes[4]),
|
|
77
|
+
sort: getString(entity.attributes[5]),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function extractClassificationAssociation(entity) {
|
|
81
|
+
// IfcRelAssociatesClassification attributes:
|
|
82
|
+
// [0] GlobalId
|
|
83
|
+
// [1] OwnerHistory
|
|
84
|
+
// [2] Name
|
|
85
|
+
// [3] Description
|
|
86
|
+
// [4] RelatedObjects (list of elements)
|
|
87
|
+
// [5] RelatingClassification (ClassificationReference or Classification)
|
|
88
|
+
const relatedObjects = getReferences(entity.attributes[4]) || [];
|
|
89
|
+
const classificationRef = getReference(entity.attributes[5]);
|
|
90
|
+
if (!classificationRef) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
relationshipId: entity.id,
|
|
95
|
+
classificationId: classificationRef,
|
|
96
|
+
relatedObjects,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get classifications for an element
|
|
101
|
+
*/
|
|
102
|
+
export function getClassificationsForElement(elementId, classificationsData) {
|
|
103
|
+
const results = [];
|
|
104
|
+
// Find all associations for this element
|
|
105
|
+
for (const assoc of classificationsData.associations) {
|
|
106
|
+
if (assoc.relatedObjects.includes(elementId)) {
|
|
107
|
+
const ref = classificationsData.classificationReferences.get(assoc.classificationId);
|
|
108
|
+
if (ref) {
|
|
109
|
+
results.push(ref);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return results;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get classification code for an element (first classification found)
|
|
117
|
+
*/
|
|
118
|
+
export function getClassificationCodeForElement(elementId, classificationsData) {
|
|
119
|
+
const classifications = getClassificationsForElement(elementId, classificationsData);
|
|
120
|
+
return classifications[0]?.identification;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get full classification path (e.g., "Pr_60 > Pr_60_10 > Pr_60_10_32")
|
|
124
|
+
*/
|
|
125
|
+
export function getClassificationPath(classificationRefId, classificationsData) {
|
|
126
|
+
const path = [];
|
|
127
|
+
let currentId = classificationRefId;
|
|
128
|
+
// Walk up the reference chain
|
|
129
|
+
while (currentId !== undefined) {
|
|
130
|
+
const ref = classificationsData.classificationReferences.get(currentId);
|
|
131
|
+
if (!ref)
|
|
132
|
+
break;
|
|
133
|
+
// Add identification or name to path
|
|
134
|
+
const code = ref.identification || ref.name;
|
|
135
|
+
if (code) {
|
|
136
|
+
path.unshift(code); // Add to front
|
|
137
|
+
}
|
|
138
|
+
// Move to parent
|
|
139
|
+
currentId = ref.referencedSource;
|
|
140
|
+
// Stop if we reached a Classification (not a ClassificationReference)
|
|
141
|
+
if (currentId && !classificationsData.classificationReferences.has(currentId)) {
|
|
142
|
+
// This is a Classification, add its name
|
|
143
|
+
const classification = classificationsData.classifications.get(currentId);
|
|
144
|
+
if (classification) {
|
|
145
|
+
path.unshift(classification.name);
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return path;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Group elements by classification
|
|
154
|
+
*/
|
|
155
|
+
export function groupElementsByClassification(classificationsData) {
|
|
156
|
+
const groups = new Map();
|
|
157
|
+
for (const assoc of classificationsData.associations) {
|
|
158
|
+
const ref = classificationsData.classificationReferences.get(assoc.classificationId);
|
|
159
|
+
const code = ref?.identification || ref?.name || 'Unclassified';
|
|
160
|
+
const existing = groups.get(code) || [];
|
|
161
|
+
existing.push(...assoc.relatedObjects);
|
|
162
|
+
groups.set(code, existing);
|
|
163
|
+
}
|
|
164
|
+
return groups;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get classification system name
|
|
168
|
+
*/
|
|
169
|
+
export function getClassificationSystemName(classificationRefId, classificationsData) {
|
|
170
|
+
// Walk up to find the root Classification
|
|
171
|
+
let currentId = classificationRefId;
|
|
172
|
+
while (currentId !== undefined) {
|
|
173
|
+
// Check if this is a Classification
|
|
174
|
+
const classification = classificationsData.classifications.get(currentId);
|
|
175
|
+
if (classification) {
|
|
176
|
+
return classification.name;
|
|
177
|
+
}
|
|
178
|
+
// Otherwise, get the parent reference
|
|
179
|
+
const ref = classificationsData.classificationReferences.get(currentId);
|
|
180
|
+
if (!ref || !ref.referencedSource)
|
|
181
|
+
break;
|
|
182
|
+
currentId = ref.referencedSource;
|
|
183
|
+
}
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
// Helper functions
|
|
187
|
+
function getString(value) {
|
|
188
|
+
if (value === null || value === undefined)
|
|
189
|
+
return undefined;
|
|
190
|
+
if (typeof value === 'string')
|
|
191
|
+
return value;
|
|
192
|
+
return String(value);
|
|
193
|
+
}
|
|
194
|
+
function getReference(value) {
|
|
195
|
+
if (value === null || value === undefined)
|
|
196
|
+
return undefined;
|
|
197
|
+
if (typeof value === 'number')
|
|
198
|
+
return value;
|
|
199
|
+
if (typeof value === 'string' && value.startsWith('#')) {
|
|
200
|
+
return parseInt(value.substring(1));
|
|
201
|
+
}
|
|
202
|
+
return undefined;
|
|
203
|
+
}
|
|
204
|
+
function getReferences(value) {
|
|
205
|
+
if (!Array.isArray(value))
|
|
206
|
+
return undefined;
|
|
207
|
+
return value
|
|
208
|
+
.map(v => getReference(v))
|
|
209
|
+
.filter(ref => ref !== undefined);
|
|
210
|
+
}
|
|
211
|
+
function getStringList(value) {
|
|
212
|
+
if (!Array.isArray(value))
|
|
213
|
+
return undefined;
|
|
214
|
+
return value
|
|
215
|
+
.map(v => getString(v))
|
|
216
|
+
.filter(str => str !== undefined);
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=classification-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classification-extractor.js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,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Columnar parser - builds columnar data structures
|
|
3
|
+
*/
|
|
4
|
+
import type { EntityRef, IfcEntity } from './types.js';
|
|
5
|
+
import { StringTable, EntityTableBuilder, PropertyTableBuilder, RelationshipGraphBuilder } from '@ifc-lite/data';
|
|
6
|
+
import type { SpatialHierarchy, QuantityTable } from '@ifc-lite/data';
|
|
7
|
+
export interface SpatialIndex {
|
|
8
|
+
queryAABB(bounds: {
|
|
9
|
+
min: [number, number, number];
|
|
10
|
+
max: [number, number, number];
|
|
11
|
+
}): number[];
|
|
12
|
+
raycast(origin: [number, number, number], direction: [number, number, number]): number[];
|
|
13
|
+
}
|
|
14
|
+
export interface IfcDataStore {
|
|
15
|
+
fileSize: number;
|
|
16
|
+
schemaVersion: 'IFC2X3' | 'IFC4' | 'IFC4X3';
|
|
17
|
+
entityCount: number;
|
|
18
|
+
parseTime: number;
|
|
19
|
+
source: Uint8Array;
|
|
20
|
+
entityIndex: {
|
|
21
|
+
byId: Map<number, EntityRef>;
|
|
22
|
+
byType: Map<string, number[]>;
|
|
23
|
+
};
|
|
24
|
+
strings: StringTable;
|
|
25
|
+
entities: ReturnType<EntityTableBuilder['build']>;
|
|
26
|
+
properties: ReturnType<PropertyTableBuilder['build']>;
|
|
27
|
+
quantities: QuantityTable;
|
|
28
|
+
relationships: ReturnType<RelationshipGraphBuilder['build']>;
|
|
29
|
+
spatialHierarchy?: SpatialHierarchy;
|
|
30
|
+
spatialIndex?: SpatialIndex;
|
|
31
|
+
}
|
|
32
|
+
export declare class ColumnarParser {
|
|
33
|
+
/**
|
|
34
|
+
* Parse IFC file into columnar data store
|
|
35
|
+
*/
|
|
36
|
+
parse(buffer: ArrayBuffer, entityRefs: EntityRef[], entities: Map<number, IfcEntity>, options?: {
|
|
37
|
+
onProgress?: (progress: {
|
|
38
|
+
phase: string;
|
|
39
|
+
percent: number;
|
|
40
|
+
}) => void;
|
|
41
|
+
}): Promise<IfcDataStore>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AO,CAAC,CAAC,CAAC;IAClD,UAAU,EAAE,UAAU,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,UAAU,EAAE,aAAa,CAAC;IAC1B,aAAa,EAAE,UAAU,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;IAG7D,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,qBAAa,cAAc;IACvB;;OAEG;IACG,KAAK,CACP,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,SAAS,EAAE,EACvB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,EAChC,OAAO,GAAE;QAAE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,KAAK,IAAI,CAAA;KAAO,GACtF,OAAO,CAAC,YAAY,CAAC;CAuP3B"}
|
|
@@ -0,0 +1,226 @@
|
|
|
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 { PropertyExtractor } from './property-extractor.js';
|
|
5
|
+
import { QuantityExtractor } from './quantity-extractor.js';
|
|
6
|
+
import { RelationshipExtractor } from './relationship-extractor.js';
|
|
7
|
+
import { SpatialHierarchyBuilder } from './spatial-hierarchy-builder.js';
|
|
8
|
+
import { StringTable, EntityTableBuilder, PropertyTableBuilder, QuantityTableBuilder, RelationshipGraphBuilder, RelationshipType, PropertyValueType, QuantityType, } from '@ifc-lite/data';
|
|
9
|
+
export class ColumnarParser {
|
|
10
|
+
/**
|
|
11
|
+
* Parse IFC file into columnar data store
|
|
12
|
+
*/
|
|
13
|
+
async parse(buffer, entityRefs, entities, options = {}) {
|
|
14
|
+
const startTime = performance.now();
|
|
15
|
+
const uint8Buffer = new Uint8Array(buffer);
|
|
16
|
+
// Initialize builders
|
|
17
|
+
const strings = new StringTable();
|
|
18
|
+
const entityTableBuilder = new EntityTableBuilder(entities.size, strings);
|
|
19
|
+
const propertyTableBuilder = new PropertyTableBuilder(strings);
|
|
20
|
+
const relationshipGraphBuilder = new RelationshipGraphBuilder();
|
|
21
|
+
// === Build Entity Table ===
|
|
22
|
+
options.onProgress?.({ phase: 'entities', percent: 0 });
|
|
23
|
+
let processed = 0;
|
|
24
|
+
for (const [id, entity] of entities) {
|
|
25
|
+
const attrs = entity.attributes || [];
|
|
26
|
+
const globalId = String(attrs[0] || '');
|
|
27
|
+
const name = String(attrs[2] || '');
|
|
28
|
+
const description = String(attrs[3] || '');
|
|
29
|
+
const objectType = String(attrs[7] || '');
|
|
30
|
+
// Check if entity has geometry (simplified check)
|
|
31
|
+
const hasGeometry = entity.type.toUpperCase().includes('WALL') ||
|
|
32
|
+
entity.type.toUpperCase().includes('DOOR') ||
|
|
33
|
+
entity.type.toUpperCase().includes('WINDOW') ||
|
|
34
|
+
entity.type.toUpperCase().includes('SLAB') ||
|
|
35
|
+
entity.type.toUpperCase().includes('COLUMN') ||
|
|
36
|
+
entity.type.toUpperCase().includes('BEAM');
|
|
37
|
+
const isType = entity.type.toUpperCase().endsWith('TYPE');
|
|
38
|
+
entityTableBuilder.add(id, entity.type, globalId, name, description, objectType, hasGeometry, isType);
|
|
39
|
+
processed++;
|
|
40
|
+
if (processed % 1000 === 0) {
|
|
41
|
+
options.onProgress?.({ phase: 'entities', percent: (processed / entities.size) * 100 });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const entityTable = entityTableBuilder.build();
|
|
45
|
+
options.onProgress?.({ phase: 'entities', percent: 100 });
|
|
46
|
+
// === Build Property Table ===
|
|
47
|
+
options.onProgress?.({ phase: 'properties', percent: 0 });
|
|
48
|
+
const propertyExtractor = new PropertyExtractor(entities);
|
|
49
|
+
const propertySets = propertyExtractor.extractPropertySets();
|
|
50
|
+
// Build mapping: psetId -> entityIds
|
|
51
|
+
const psetToEntities = new Map();
|
|
52
|
+
const relationshipExtractor = new RelationshipExtractor(entities);
|
|
53
|
+
const relationships = relationshipExtractor.extractRelationships();
|
|
54
|
+
for (const rel of relationships) {
|
|
55
|
+
if (rel.type.toUpperCase() === 'IFCRELDEFINESBYPROPERTIES') {
|
|
56
|
+
const psetId = rel.relatingObject;
|
|
57
|
+
for (const entityId of rel.relatedObjects) {
|
|
58
|
+
let list = psetToEntities.get(psetId);
|
|
59
|
+
if (!list) {
|
|
60
|
+
list = [];
|
|
61
|
+
psetToEntities.set(psetId, list);
|
|
62
|
+
}
|
|
63
|
+
list.push(entityId);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Extract properties into columnar format
|
|
68
|
+
for (const [psetId, pset] of propertySets) {
|
|
69
|
+
const entityIds = psetToEntities.get(psetId) || [];
|
|
70
|
+
const globalId = String(entities.get(psetId)?.attributes?.[0] || '');
|
|
71
|
+
for (const [propName, propValue] of pset.properties) {
|
|
72
|
+
for (const entityId of entityIds) {
|
|
73
|
+
let propType = PropertyValueType.String;
|
|
74
|
+
let value = propValue.value;
|
|
75
|
+
if (propValue.type === 'number') {
|
|
76
|
+
propType = PropertyValueType.Real;
|
|
77
|
+
value = propValue.value;
|
|
78
|
+
}
|
|
79
|
+
else if (propValue.type === 'boolean') {
|
|
80
|
+
propType = PropertyValueType.Boolean;
|
|
81
|
+
value = propValue.value;
|
|
82
|
+
}
|
|
83
|
+
else if (propValue.type === 'string') {
|
|
84
|
+
propType = PropertyValueType.String;
|
|
85
|
+
value = String(propValue.value);
|
|
86
|
+
}
|
|
87
|
+
propertyTableBuilder.add({
|
|
88
|
+
entityId,
|
|
89
|
+
psetName: pset.name,
|
|
90
|
+
psetGlobalId: globalId,
|
|
91
|
+
propName,
|
|
92
|
+
propType,
|
|
93
|
+
value,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const propertyTable = propertyTableBuilder.build();
|
|
99
|
+
options.onProgress?.({ phase: 'properties', percent: 100 });
|
|
100
|
+
// === Build Quantity Table ===
|
|
101
|
+
options.onProgress?.({ phase: 'quantities', percent: 0 });
|
|
102
|
+
const quantityTableBuilder = new QuantityTableBuilder(strings);
|
|
103
|
+
const quantityExtractor = new QuantityExtractor(entities);
|
|
104
|
+
const quantitySets = quantityExtractor.extractQuantitySets();
|
|
105
|
+
// Build mapping: qsetId -> entityIds (similar to properties)
|
|
106
|
+
const qsetToEntities = new Map();
|
|
107
|
+
for (const rel of relationships) {
|
|
108
|
+
if (rel.type.toUpperCase() === 'IFCRELDEFINESBYPROPERTIES') {
|
|
109
|
+
const qsetId = rel.relatingObject;
|
|
110
|
+
// Check if this is actually a quantity set (not a property set)
|
|
111
|
+
if (quantitySets.has(qsetId)) {
|
|
112
|
+
for (const entityId of rel.relatedObjects) {
|
|
113
|
+
let list = qsetToEntities.get(qsetId);
|
|
114
|
+
if (!list) {
|
|
115
|
+
list = [];
|
|
116
|
+
qsetToEntities.set(qsetId, list);
|
|
117
|
+
}
|
|
118
|
+
list.push(entityId);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Map quantity type names to QuantityType enum
|
|
124
|
+
const quantityTypeMap = {
|
|
125
|
+
'length': QuantityType.Length,
|
|
126
|
+
'area': QuantityType.Area,
|
|
127
|
+
'volume': QuantityType.Volume,
|
|
128
|
+
'count': QuantityType.Count,
|
|
129
|
+
'weight': QuantityType.Weight,
|
|
130
|
+
'time': QuantityType.Time,
|
|
131
|
+
};
|
|
132
|
+
// Extract quantities into columnar format
|
|
133
|
+
for (const [qsetId, qset] of quantitySets) {
|
|
134
|
+
const entityIds = qsetToEntities.get(qsetId) || [];
|
|
135
|
+
for (const quantity of qset.quantities) {
|
|
136
|
+
for (const entityId of entityIds) {
|
|
137
|
+
quantityTableBuilder.add({
|
|
138
|
+
entityId,
|
|
139
|
+
qsetName: qset.name,
|
|
140
|
+
quantityName: quantity.name,
|
|
141
|
+
quantityType: quantityTypeMap[quantity.type] ?? QuantityType.Length,
|
|
142
|
+
value: quantity.value,
|
|
143
|
+
formula: quantity.formula,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const quantityTable = quantityTableBuilder.build();
|
|
149
|
+
options.onProgress?.({ phase: 'quantities', percent: 100 });
|
|
150
|
+
// === Build Relationship Graph ===
|
|
151
|
+
options.onProgress?.({ phase: 'relationships', percent: 0 });
|
|
152
|
+
const relTypeMap = {
|
|
153
|
+
'IFCRELCONTAINEDINSPATIALSTRUCTURE': RelationshipType.ContainsElements,
|
|
154
|
+
'IFCRELAGGREGATES': RelationshipType.Aggregates,
|
|
155
|
+
'IFCRELDEFINESBYPROPERTIES': RelationshipType.DefinesByProperties,
|
|
156
|
+
'IFCRELDEFINESBYTYPE': RelationshipType.DefinesByType,
|
|
157
|
+
'IFCRELASSOCIATESMATERIAL': RelationshipType.AssociatesMaterial,
|
|
158
|
+
'IFCRELASSOCIATESCLASSIFICATION': RelationshipType.AssociatesClassification,
|
|
159
|
+
'IFCRELVOIDSELEMENT': RelationshipType.VoidsElement,
|
|
160
|
+
'IFCRELFILLSELEMENT': RelationshipType.FillsElement,
|
|
161
|
+
'IFCRELCONNECTSPATHELEMENTS': RelationshipType.ConnectsPathElements,
|
|
162
|
+
'IFCRELSPACEBOUNDARY': RelationshipType.SpaceBoundary,
|
|
163
|
+
};
|
|
164
|
+
for (const rel of relationships) {
|
|
165
|
+
const relType = relTypeMap[rel.type.toUpperCase()];
|
|
166
|
+
if (relType) {
|
|
167
|
+
for (const targetId of rel.relatedObjects) {
|
|
168
|
+
relationshipGraphBuilder.addEdge(rel.relatingObject, targetId, relType, rel.relatingObject);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const relationshipGraph = relationshipGraphBuilder.build();
|
|
173
|
+
options.onProgress?.({ phase: 'relationships', percent: 100 });
|
|
174
|
+
// Detect schema version (simplified)
|
|
175
|
+
let schemaVersion = 'IFC4';
|
|
176
|
+
for (const [, entity] of entities) {
|
|
177
|
+
if (entity.type.toUpperCase() === 'IFCPROJECT') {
|
|
178
|
+
// Check schema version from header or entity
|
|
179
|
+
schemaVersion = 'IFC4';
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const parseTime = performance.now() - startTime;
|
|
184
|
+
// Build entity index
|
|
185
|
+
const entityIndex = {
|
|
186
|
+
byId: new Map(),
|
|
187
|
+
byType: new Map(),
|
|
188
|
+
};
|
|
189
|
+
for (const ref of entityRefs) {
|
|
190
|
+
entityIndex.byId.set(ref.expressId, ref);
|
|
191
|
+
let typeList = entityIndex.byType.get(ref.type);
|
|
192
|
+
if (!typeList) {
|
|
193
|
+
typeList = [];
|
|
194
|
+
entityIndex.byType.set(ref.type, typeList);
|
|
195
|
+
}
|
|
196
|
+
typeList.push(ref.expressId);
|
|
197
|
+
}
|
|
198
|
+
// === Build Spatial Hierarchy ===
|
|
199
|
+
options.onProgress?.({ phase: 'spatial-hierarchy', percent: 0 });
|
|
200
|
+
let spatialHierarchy;
|
|
201
|
+
try {
|
|
202
|
+
const hierarchyBuilder = new SpatialHierarchyBuilder();
|
|
203
|
+
spatialHierarchy = hierarchyBuilder.build(entityTable, relationshipGraph, strings, uint8Buffer, entityIndex);
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
console.warn('[ColumnarParser] Failed to build spatial hierarchy:', error);
|
|
207
|
+
// Continue without hierarchy - it's optional
|
|
208
|
+
}
|
|
209
|
+
options.onProgress?.({ phase: 'spatial-hierarchy', percent: 100 });
|
|
210
|
+
return {
|
|
211
|
+
fileSize: buffer.byteLength,
|
|
212
|
+
schemaVersion,
|
|
213
|
+
entityCount: entities.size,
|
|
214
|
+
parseTime,
|
|
215
|
+
source: uint8Buffer,
|
|
216
|
+
entityIndex,
|
|
217
|
+
strings,
|
|
218
|
+
entities: entityTable,
|
|
219
|
+
properties: propertyTable,
|
|
220
|
+
quantities: quantityTable,
|
|
221
|
+
relationships: relationshipGraph,
|
|
222
|
+
spatialHierarchy,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=columnar-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnar-parser.js","sourceRoot":"","sources":["../src/columnar-parser.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAO/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACf,MAAM,gBAAgB,CAAC;AA8BxB,MAAM,OAAO,cAAc;IACvB;;OAEG;IACH,KAAK,CAAC,KAAK,CACP,MAAmB,EACnB,UAAuB,EACvB,QAAgC,EAChC,UAAmF,EAAE;QAErF,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,WAAW,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QAE3C,sBAAsB;QACtB,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1E,MAAM,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,wBAAwB,GAAG,IAAI,wBAAwB,EAAE,CAAC;QA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O,CAAC,IAAI,CAAC,qDAAqD,EAAE,KAAK,CAAC,CAAC;YAC3E,6CAA6C;QACjD,CAAC;QACD,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QAEnE,OAAO;YACH,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,aAAa;YACb,WAAW,EAAE,QAAQ,CAAC,IAAI;YAC1B,SAAS;YACT,MAAM,EAAE,WAAW;YACnB,WAAW;YACX,OAAO;YACP,QAAQ,EAAE,WAAW;YACrB,UAAU,EAAE,aAAa;YACzB,UAAU,EAAE,aAAa;YACzB,aAAa,EAAE,iBAAiB;YAChC,gBAAgB;SACnB,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity extractor - parses full entity content from STEP format
|
|
3
|
+
*/
|
|
4
|
+
import type { IfcEntity, EntityRef } from './types.js';
|
|
5
|
+
export declare class EntityExtractor {
|
|
6
|
+
private buffer;
|
|
7
|
+
constructor(buffer: Uint8Array);
|
|
8
|
+
/**
|
|
9
|
+
* Extract full entity data from a reference
|
|
10
|
+
*/
|
|
11
|
+
extractEntity(ref: EntityRef): IfcEntity | null;
|
|
12
|
+
private parseAttributes;
|
|
13
|
+
private parseAttributeValue;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=entity-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-extractor.d.ts","sourceRoot":"","sources":["../src/entity-extractor.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvD,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAa;gBAEf,MAAM,EAAE,UAAU;IAI9B;;OAEG;IACH,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI;IA4B/C,OAAO,CAAC,eAAe;IAiDvB,OAAO,CAAC,mBAAmB;CAoE5B"}
|