@ifc-lite/export 1.3.0 → 1.6.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/dist/csv-exporter.d.ts +17 -3
- package/dist/csv-exporter.d.ts.map +1 -1
- package/dist/csv-exporter.js +123 -34
- package/dist/csv-exporter.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/step-exporter.d.ts +121 -0
- package/dist/step-exporter.d.ts.map +1 -0
- package/dist/step-exporter.js +393 -0
- package/dist/step-exporter.js.map +1 -0
- package/package.json +5 -4
package/dist/csv-exporter.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CSV exporter for IFC data
|
|
3
|
+
* Uses on-demand property extraction for optimal performance
|
|
3
4
|
*/
|
|
4
|
-
import type
|
|
5
|
+
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
5
6
|
export interface CSVExportOptions {
|
|
6
7
|
includeProperties?: boolean;
|
|
7
8
|
includeQuantities?: boolean;
|
|
@@ -11,6 +12,14 @@ export interface CSVExportOptions {
|
|
|
11
12
|
export declare class CSVExporter {
|
|
12
13
|
private store;
|
|
13
14
|
constructor(store: IfcDataStore);
|
|
15
|
+
/**
|
|
16
|
+
* Get properties for an entity, using on-demand extraction when available
|
|
17
|
+
*/
|
|
18
|
+
private getPropertiesForEntity;
|
|
19
|
+
/**
|
|
20
|
+
* Get quantities for an entity, using on-demand extraction when available
|
|
21
|
+
*/
|
|
22
|
+
private getQuantitiesForEntity;
|
|
14
23
|
/**
|
|
15
24
|
* Export entities to CSV format
|
|
16
25
|
* @param entityIds Optional array of entity IDs to export. If not provided, exports all entities.
|
|
@@ -24,6 +33,10 @@ export declare class CSVExporter {
|
|
|
24
33
|
* Export quantities to CSV format (one row per quantity)
|
|
25
34
|
*/
|
|
26
35
|
exportQuantities(entityIds?: number[], options?: CSVExportOptions): string;
|
|
36
|
+
/**
|
|
37
|
+
* Export spatial hierarchy to CSV
|
|
38
|
+
*/
|
|
39
|
+
exportSpatialHierarchy(options?: CSVExportOptions): string;
|
|
27
40
|
/**
|
|
28
41
|
* Get all entity IDs from the store
|
|
29
42
|
*/
|
|
@@ -33,8 +46,9 @@ export declare class CSVExporter {
|
|
|
33
46
|
*/
|
|
34
47
|
private escapeValue;
|
|
35
48
|
/**
|
|
36
|
-
*
|
|
49
|
+
* Join pre-escaped values into a CSV row
|
|
50
|
+
* Note: Values should already be escaped before calling this
|
|
37
51
|
*/
|
|
38
|
-
private
|
|
52
|
+
private joinRow;
|
|
39
53
|
}
|
|
40
54
|
//# sourceMappingURL=csv-exporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csv-exporter.d.ts","sourceRoot":"","sources":["../src/csv-exporter.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"csv-exporter.d.ts","sourceRoot":"","sources":["../src/csv-exporter.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAAe;gBAEhB,KAAK,EAAE,YAAY;IAI/B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAS9B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAS9B;;;OAGG;IACH,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM;IAuF5E;;OAEG;IACH,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM;IAqC9E;;OAEG;IACH,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM;IAsC9E;;OAEG;IACH,sBAAsB,CAAC,OAAO,GAAE,gBAAqB,GAAG,MAAM;IAmC9D;;OAEG;IACH,OAAO,CAAC,eAAe;IASvB;;OAEG;IACH,OAAO,CAAC,WAAW;IAenB;;;OAGG;IACH,OAAO,CAAC,OAAO;CAGhB"}
|
package/dist/csv-exporter.js
CHANGED
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* CSV exporter for IFC data
|
|
6
|
+
* Uses on-demand property extraction for optimal performance
|
|
7
|
+
*/
|
|
8
|
+
import { extractPropertiesOnDemand, extractQuantitiesOnDemand, } from '@ifc-lite/parser';
|
|
4
9
|
export class CSVExporter {
|
|
5
10
|
store;
|
|
6
11
|
constructor(store) {
|
|
7
12
|
this.store = store;
|
|
8
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Get properties for an entity, using on-demand extraction when available
|
|
16
|
+
*/
|
|
17
|
+
getPropertiesForEntity(entityId) {
|
|
18
|
+
// Use on-demand extraction (works with client-side WASM parsing)
|
|
19
|
+
if (this.store.onDemandPropertyMap && this.store.source?.length > 0) {
|
|
20
|
+
return extractPropertiesOnDemand(this.store, entityId);
|
|
21
|
+
}
|
|
22
|
+
// Fallback to pre-built property table (server-parsed data or cached)
|
|
23
|
+
return this.store.properties?.getForEntity(entityId) ?? [];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get quantities for an entity, using on-demand extraction when available
|
|
27
|
+
*/
|
|
28
|
+
getQuantitiesForEntity(entityId) {
|
|
29
|
+
// Use on-demand extraction (works with client-side WASM parsing)
|
|
30
|
+
if (this.store.onDemandQuantityMap && this.store.source?.length > 0) {
|
|
31
|
+
return extractQuantitiesOnDemand(this.store, entityId);
|
|
32
|
+
}
|
|
33
|
+
// Fallback to pre-built quantity table
|
|
34
|
+
return this.store.quantities?.getForEntity(entityId) ?? [];
|
|
35
|
+
}
|
|
9
36
|
/**
|
|
10
37
|
* Export entities to CSV format
|
|
11
38
|
* @param entityIds Optional array of entity IDs to export. If not provided, exports all entities.
|
|
@@ -14,14 +41,22 @@ export class CSVExporter {
|
|
|
14
41
|
const delimiter = options.delimiter ?? ',';
|
|
15
42
|
const includeProperties = options.includeProperties ?? false;
|
|
16
43
|
const flattenProperties = options.flattenProperties ?? false;
|
|
17
|
-
// Build header row
|
|
18
|
-
const headers = [
|
|
44
|
+
// Build header row with more columns
|
|
45
|
+
const headers = [
|
|
46
|
+
'expressId',
|
|
47
|
+
'globalId',
|
|
48
|
+
'name',
|
|
49
|
+
'type',
|
|
50
|
+
'description',
|
|
51
|
+
'objectType',
|
|
52
|
+
'hasGeometry',
|
|
53
|
+
];
|
|
19
54
|
// Collect all unique property set names and property names (if flattening properties)
|
|
20
55
|
const psetProps = new Map();
|
|
21
56
|
if (includeProperties && flattenProperties) {
|
|
22
57
|
const allEntityIds = entityIds ?? this.getAllEntityIds();
|
|
23
58
|
for (const id of allEntityIds) {
|
|
24
|
-
const properties = this.
|
|
59
|
+
const properties = this.getPropertiesForEntity(id);
|
|
25
60
|
for (const pset of properties) {
|
|
26
61
|
if (!psetProps.has(pset.name)) {
|
|
27
62
|
psetProps.set(pset.name, new Set());
|
|
@@ -38,19 +73,22 @@ export class CSVExporter {
|
|
|
38
73
|
}
|
|
39
74
|
}
|
|
40
75
|
}
|
|
41
|
-
const rows = [this.
|
|
76
|
+
const rows = [this.joinRow(headers.map((h) => this.escapeValue(h)), delimiter)];
|
|
42
77
|
// Get entity IDs to export
|
|
43
78
|
const ids = entityIds ?? this.getAllEntityIds();
|
|
44
79
|
// Build data rows
|
|
45
80
|
for (const id of ids) {
|
|
46
81
|
const row = [
|
|
47
|
-
|
|
48
|
-
this.escapeValue(this.store.entities.getGlobalId(id)),
|
|
49
|
-
this.escapeValue(this.store.entities.getName(id)),
|
|
50
|
-
this.escapeValue(this.store.entities.getTypeName(id)),
|
|
82
|
+
this.escapeValue(id),
|
|
83
|
+
this.escapeValue(this.store.entities.getGlobalId(id) || ''),
|
|
84
|
+
this.escapeValue(this.store.entities.getName(id) || ''),
|
|
85
|
+
this.escapeValue(this.store.entities.getTypeName(id) || ''),
|
|
86
|
+
this.escapeValue(this.store.entities.getDescription(id) || ''),
|
|
87
|
+
this.escapeValue(this.store.entities.getObjectType(id) || ''),
|
|
88
|
+
this.escapeValue(this.store.entities.hasGeometry(id) ? 'true' : 'false'),
|
|
51
89
|
];
|
|
52
90
|
if (includeProperties && flattenProperties) {
|
|
53
|
-
const properties = this.
|
|
91
|
+
const properties = this.getPropertiesForEntity(id);
|
|
54
92
|
const propMap = new Map();
|
|
55
93
|
// Build map of pset -> prop -> value
|
|
56
94
|
for (const pset of properties) {
|
|
@@ -68,7 +106,7 @@ export class CSVExporter {
|
|
|
68
106
|
}
|
|
69
107
|
}
|
|
70
108
|
}
|
|
71
|
-
rows.push(this.
|
|
109
|
+
rows.push(this.joinRow(row, delimiter));
|
|
72
110
|
}
|
|
73
111
|
return rows.join('\n');
|
|
74
112
|
}
|
|
@@ -77,21 +115,31 @@ export class CSVExporter {
|
|
|
77
115
|
*/
|
|
78
116
|
exportProperties(entityIds, options = {}) {
|
|
79
117
|
const delimiter = options.delimiter ?? ',';
|
|
80
|
-
const headers = ['entityId', 'psetName', 'propName', 'value', 'type'];
|
|
81
|
-
const rows = [this.
|
|
118
|
+
const headers = ['entityId', 'globalId', 'entityName', 'entityType', 'psetName', 'propName', 'value', 'type'];
|
|
119
|
+
const rows = [this.joinRow(headers.map((h) => this.escapeValue(h)), delimiter)];
|
|
82
120
|
const ids = entityIds ?? this.getAllEntityIds();
|
|
83
121
|
for (const id of ids) {
|
|
84
|
-
const properties = this.
|
|
122
|
+
const properties = this.getPropertiesForEntity(id);
|
|
123
|
+
if (!properties || properties.length === 0)
|
|
124
|
+
continue;
|
|
125
|
+
const globalId = this.store.entities.getGlobalId(id) || '';
|
|
126
|
+
const entityName = this.store.entities.getName(id) || '';
|
|
127
|
+
const entityType = this.store.entities.getTypeName(id) || '';
|
|
85
128
|
for (const pset of properties) {
|
|
129
|
+
if (!pset.properties || pset.properties.length === 0)
|
|
130
|
+
continue;
|
|
86
131
|
for (const prop of pset.properties) {
|
|
87
132
|
const row = [
|
|
88
|
-
|
|
89
|
-
this.escapeValue(
|
|
90
|
-
this.escapeValue(
|
|
133
|
+
this.escapeValue(id),
|
|
134
|
+
this.escapeValue(globalId),
|
|
135
|
+
this.escapeValue(entityName),
|
|
136
|
+
this.escapeValue(entityType),
|
|
137
|
+
this.escapeValue(pset.name || ''),
|
|
138
|
+
this.escapeValue(prop.name || ''),
|
|
91
139
|
this.escapeValue(prop.value),
|
|
92
|
-
|
|
140
|
+
this.escapeValue(prop.type ?? ''),
|
|
93
141
|
];
|
|
94
|
-
rows.push(this.
|
|
142
|
+
rows.push(this.joinRow(row, delimiter));
|
|
95
143
|
}
|
|
96
144
|
}
|
|
97
145
|
}
|
|
@@ -102,35 +150,75 @@ export class CSVExporter {
|
|
|
102
150
|
*/
|
|
103
151
|
exportQuantities(entityIds, options = {}) {
|
|
104
152
|
const delimiter = options.delimiter ?? ',';
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const headers = ['entityId', 'qsetName', 'quantityName', 'value', 'type'];
|
|
109
|
-
const rows = [this.escapeRow(headers, delimiter)];
|
|
153
|
+
const headers = ['entityId', 'globalId', 'entityName', 'entityType', 'qsetName', 'quantityName', 'value', 'type'];
|
|
154
|
+
const headerRow = this.joinRow(headers.map((h) => this.escapeValue(h)), delimiter);
|
|
155
|
+
const rows = [headerRow];
|
|
110
156
|
const ids = entityIds ?? this.getAllEntityIds();
|
|
111
157
|
for (const id of ids) {
|
|
112
|
-
const quantities = this.
|
|
158
|
+
const quantities = this.getQuantitiesForEntity(id);
|
|
159
|
+
if (!quantities || quantities.length === 0)
|
|
160
|
+
continue;
|
|
161
|
+
const globalId = this.store.entities.getGlobalId(id) || '';
|
|
162
|
+
const entityName = this.store.entities.getName(id) || '';
|
|
163
|
+
const entityType = this.store.entities.getTypeName(id) || '';
|
|
113
164
|
for (const qset of quantities) {
|
|
165
|
+
if (!qset.quantities || qset.quantities.length === 0)
|
|
166
|
+
continue;
|
|
114
167
|
for (const quant of qset.quantities) {
|
|
115
168
|
const row = [
|
|
116
|
-
|
|
117
|
-
this.escapeValue(
|
|
118
|
-
this.escapeValue(
|
|
119
|
-
|
|
120
|
-
|
|
169
|
+
this.escapeValue(id),
|
|
170
|
+
this.escapeValue(globalId),
|
|
171
|
+
this.escapeValue(entityName),
|
|
172
|
+
this.escapeValue(entityType),
|
|
173
|
+
this.escapeValue(qset.name || ''),
|
|
174
|
+
this.escapeValue(quant.name || ''),
|
|
175
|
+
this.escapeValue(quant.value),
|
|
176
|
+
this.escapeValue(quant.type ?? ''),
|
|
121
177
|
];
|
|
122
|
-
rows.push(this.
|
|
178
|
+
rows.push(this.joinRow(row, delimiter));
|
|
123
179
|
}
|
|
124
180
|
}
|
|
125
181
|
}
|
|
126
182
|
return rows.join('\n');
|
|
127
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* Export spatial hierarchy to CSV
|
|
186
|
+
*/
|
|
187
|
+
exportSpatialHierarchy(options = {}) {
|
|
188
|
+
const delimiter = options.delimiter ?? ',';
|
|
189
|
+
const headers = ['expressId', 'globalId', 'name', 'type', 'parentId', 'level'];
|
|
190
|
+
const rows = [this.joinRow(headers.map((h) => this.escapeValue(h)), delimiter)];
|
|
191
|
+
// Get spatial hierarchy
|
|
192
|
+
const spatialHierarchy = this.store.spatialHierarchy;
|
|
193
|
+
if (!spatialHierarchy?.project) {
|
|
194
|
+
return rows[0];
|
|
195
|
+
}
|
|
196
|
+
const traverse = (node, parentId, level) => {
|
|
197
|
+
const row = [
|
|
198
|
+
this.escapeValue(node.expressId),
|
|
199
|
+
this.escapeValue(this.store.entities.getGlobalId(node.expressId) || ''),
|
|
200
|
+
this.escapeValue(node.name || ''),
|
|
201
|
+
this.escapeValue(this.store.entities.getTypeName(node.expressId) || ''),
|
|
202
|
+
this.escapeValue(parentId ?? ''),
|
|
203
|
+
this.escapeValue(level),
|
|
204
|
+
];
|
|
205
|
+
rows.push(this.joinRow(row, delimiter));
|
|
206
|
+
if (node.children) {
|
|
207
|
+
for (const child of node.children) {
|
|
208
|
+
traverse(child, node.expressId, level + 1);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
traverse(spatialHierarchy.project, null, 0);
|
|
213
|
+
return rows.join('\n');
|
|
214
|
+
}
|
|
128
215
|
/**
|
|
129
216
|
* Get all entity IDs from the store
|
|
130
217
|
*/
|
|
131
218
|
getAllEntityIds() {
|
|
132
219
|
const ids = [];
|
|
133
|
-
|
|
220
|
+
const count = this.store.entities?.count ?? 0;
|
|
221
|
+
for (let i = 0; i < count; i++) {
|
|
134
222
|
ids.push(this.store.entities.expressId[i]);
|
|
135
223
|
}
|
|
136
224
|
return ids;
|
|
@@ -150,10 +238,11 @@ export class CSVExporter {
|
|
|
150
238
|
return str;
|
|
151
239
|
}
|
|
152
240
|
/**
|
|
153
|
-
*
|
|
241
|
+
* Join pre-escaped values into a CSV row
|
|
242
|
+
* Note: Values should already be escaped before calling this
|
|
154
243
|
*/
|
|
155
|
-
|
|
156
|
-
return values.
|
|
244
|
+
joinRow(values, delimiter) {
|
|
245
|
+
return values.join(delimiter);
|
|
157
246
|
}
|
|
158
247
|
}
|
|
159
248
|
//# sourceMappingURL=csv-exporter.js.map
|
package/dist/csv-exporter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csv-exporter.js","sourceRoot":"","sources":["../src/csv-exporter.ts"],"names":[],"mappings":"AAAA;;+DAE+D;
|
|
1
|
+
{"version":3,"file":"csv-exporter.js","sourceRoot":"","sources":["../src/csv-exporter.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;GAGG;AAEH,OAAO,EAEL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAU1B,MAAM,OAAO,WAAW;IACd,KAAK,CAAe;IAE5B,YAAY,KAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,QAAgB;QAC7C,iEAAiE;QACjE,IAAI,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;YACpE,OAAO,yBAAyB,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAkB,CAAC;QAC1E,CAAC;QACD,sEAAsE;QACtE,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC7D,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,QAAgB;QAC7C,iEAAiE;QACjE,IAAI,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;YACpE,OAAO,yBAAyB,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAkB,CAAC;QAC1E,CAAC;QACD,uCAAuC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,SAAoB,EAAE,UAA4B,EAAE;QACjE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,GAAG,CAAC;QAC3C,MA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;IAChC,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { GLTFExporter, type GLTFExportOptions } from './gltf-exporter.js';
|
|
|
5
5
|
export { ParquetExporter, type ParquetExportOptions } from './parquet-exporter.js';
|
|
6
6
|
export { CSVExporter, type CSVExportOptions } from './csv-exporter.js';
|
|
7
7
|
export { JSONLDExporter, type JSONLDExportOptions } from './jsonld-exporter.js';
|
|
8
|
+
export { StepExporter, exportToStep, type StepExportOptions, type StepExportResult } from './step-exporter.js';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export { GLTFExporter } from './gltf-exporter.js';
|
|
|
8
8
|
export { ParquetExporter } from './parquet-exporter.js';
|
|
9
9
|
export { CSVExporter } from './csv-exporter.js';
|
|
10
10
|
export { JSONLDExporter } from './jsonld-exporter.js';
|
|
11
|
+
export { StepExporter, exportToStep } from './step-exporter.js';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;GAEG;AAEH,OAAO,EAAE,YAAY,EAA0B,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAA6B,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,cAAc,EAA4B,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;GAEG;AAEH,OAAO,EAAE,YAAY,EAA0B,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAA6B,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,cAAc,EAA4B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAiD,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IFC STEP file exporter
|
|
3
|
+
*
|
|
4
|
+
* Exports IFC data store to ISO 10303-21 STEP format.
|
|
5
|
+
* Supports applying property mutations before export.
|
|
6
|
+
*/
|
|
7
|
+
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
8
|
+
import type { MutablePropertyView } from '@ifc-lite/mutations';
|
|
9
|
+
/**
|
|
10
|
+
* Options for STEP export
|
|
11
|
+
*/
|
|
12
|
+
export interface StepExportOptions {
|
|
13
|
+
/** IFC schema version */
|
|
14
|
+
schema: 'IFC2X3' | 'IFC4' | 'IFC4X3';
|
|
15
|
+
/** File description */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Author name */
|
|
18
|
+
author?: string;
|
|
19
|
+
/** Organization name */
|
|
20
|
+
organization?: string;
|
|
21
|
+
/** Application name (defaults to 'ifc-lite') */
|
|
22
|
+
application?: string;
|
|
23
|
+
/** Output filename */
|
|
24
|
+
filename?: string;
|
|
25
|
+
/** Include original geometry entities (default: true) */
|
|
26
|
+
includeGeometry?: boolean;
|
|
27
|
+
/** Include property sets (default: true) */
|
|
28
|
+
includeProperties?: boolean;
|
|
29
|
+
/** Include quantity sets (default: true) */
|
|
30
|
+
includeQuantities?: boolean;
|
|
31
|
+
/** Include relationships (default: true) */
|
|
32
|
+
includeRelationships?: boolean;
|
|
33
|
+
/** Apply mutations from MutablePropertyView (default: true if provided) */
|
|
34
|
+
applyMutations?: boolean;
|
|
35
|
+
/** Only export entities with mutations (delta export) */
|
|
36
|
+
deltaOnly?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Result of STEP export
|
|
40
|
+
*/
|
|
41
|
+
export interface StepExportResult {
|
|
42
|
+
/** STEP file content */
|
|
43
|
+
content: string;
|
|
44
|
+
/** Statistics about the export */
|
|
45
|
+
stats: {
|
|
46
|
+
/** Total entities exported */
|
|
47
|
+
entityCount: number;
|
|
48
|
+
/** New entities created for mutations */
|
|
49
|
+
newEntityCount: number;
|
|
50
|
+
/** Entities modified by mutations */
|
|
51
|
+
modifiedEntityCount: number;
|
|
52
|
+
/** File size in bytes */
|
|
53
|
+
fileSize: number;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* IFC STEP file exporter
|
|
58
|
+
*/
|
|
59
|
+
export declare class StepExporter {
|
|
60
|
+
private dataStore;
|
|
61
|
+
private mutationView;
|
|
62
|
+
private nextExpressId;
|
|
63
|
+
constructor(dataStore: IfcDataStore, mutationView?: MutablePropertyView);
|
|
64
|
+
/**
|
|
65
|
+
* Export to STEP format
|
|
66
|
+
*/
|
|
67
|
+
export(options: StepExportOptions): StepExportResult;
|
|
68
|
+
/**
|
|
69
|
+
* Export only property/quantity changes (lightweight export)
|
|
70
|
+
*/
|
|
71
|
+
exportPropertiesOnly(options: Omit<StepExportOptions, 'includeGeometry'>): StepExportResult;
|
|
72
|
+
/**
|
|
73
|
+
* Generate STEP entities for property sets
|
|
74
|
+
*/
|
|
75
|
+
private generatePropertySetEntities;
|
|
76
|
+
/**
|
|
77
|
+
* Serialize a property value to STEP format
|
|
78
|
+
*/
|
|
79
|
+
private serializePropertyValue;
|
|
80
|
+
/**
|
|
81
|
+
* Escape a string for STEP format
|
|
82
|
+
*/
|
|
83
|
+
private escapeStepString;
|
|
84
|
+
/**
|
|
85
|
+
* Generate a new IFC GlobalId (22 character base64)
|
|
86
|
+
*/
|
|
87
|
+
private generateGlobalId;
|
|
88
|
+
/**
|
|
89
|
+
* Find the maximum EXPRESS ID in the data store
|
|
90
|
+
*/
|
|
91
|
+
private findMaxExpressId;
|
|
92
|
+
/**
|
|
93
|
+
* Find a unit entity ID by name (simplified - returns null for now)
|
|
94
|
+
*/
|
|
95
|
+
private findUnitId;
|
|
96
|
+
/**
|
|
97
|
+
* Check if an entity type is a geometry-related type
|
|
98
|
+
*/
|
|
99
|
+
private isGeometryEntity;
|
|
100
|
+
/**
|
|
101
|
+
* Get entity IDs related by IfcRelDefinesByProperties (the related objects)
|
|
102
|
+
*/
|
|
103
|
+
private getRelatedEntities;
|
|
104
|
+
/**
|
|
105
|
+
* Get the property set ID from IfcRelDefinesByProperties
|
|
106
|
+
*/
|
|
107
|
+
private getRelatedPropertySet;
|
|
108
|
+
/**
|
|
109
|
+
* Get the name of a property set by parsing the entity
|
|
110
|
+
*/
|
|
111
|
+
private getPropertySetName;
|
|
112
|
+
/**
|
|
113
|
+
* Get IDs of properties in a property set
|
|
114
|
+
*/
|
|
115
|
+
private getPropertyIdsInSet;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Quick export function for simple use cases
|
|
119
|
+
*/
|
|
120
|
+
export declare function exportToStep(dataStore: IfcDataStore, options?: Partial<StepExportOptions>): string;
|
|
121
|
+
//# sourceMappingURL=step-exporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-exporter.d.ts","sourceRoot":"","sources":["../src/step-exporter.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI/D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;IACrC,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4CAA4C;IAC5C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,2EAA2E;IAC3E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,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AC,GACnC,MAAM,CAOR"}
|
|
@@ -0,0 +1,393 @@
|
|
|
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 { generateHeader, serializeValue, ref, } from '@ifc-lite/parser';
|
|
5
|
+
import { PropertyValueType } from '@ifc-lite/data';
|
|
6
|
+
/**
|
|
7
|
+
* IFC STEP file exporter
|
|
8
|
+
*/
|
|
9
|
+
export class StepExporter {
|
|
10
|
+
dataStore;
|
|
11
|
+
mutationView;
|
|
12
|
+
nextExpressId;
|
|
13
|
+
constructor(dataStore, mutationView) {
|
|
14
|
+
this.dataStore = dataStore;
|
|
15
|
+
this.mutationView = mutationView || null;
|
|
16
|
+
// Start new IDs after the highest existing ID
|
|
17
|
+
this.nextExpressId = this.findMaxExpressId() + 1;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Export to STEP format
|
|
21
|
+
*/
|
|
22
|
+
export(options) {
|
|
23
|
+
const entities = [];
|
|
24
|
+
let newEntityCount = 0;
|
|
25
|
+
let modifiedEntityCount = 0;
|
|
26
|
+
// Determine schema from data store if not specified
|
|
27
|
+
const schema = options.schema || this.dataStore.schemaVersion || 'IFC4';
|
|
28
|
+
// Generate header
|
|
29
|
+
const header = generateHeader({
|
|
30
|
+
schema,
|
|
31
|
+
description: options.description || 'Exported from ifc-lite',
|
|
32
|
+
author: options.author || '',
|
|
33
|
+
organization: options.organization || '',
|
|
34
|
+
application: options.application || 'ifc-lite',
|
|
35
|
+
filename: options.filename || 'export.ifc',
|
|
36
|
+
});
|
|
37
|
+
// Collect entities that need to be modified or created
|
|
38
|
+
const modifiedEntities = new Set();
|
|
39
|
+
const modifiedPsets = new Map(); // entityId -> psetNames being modified
|
|
40
|
+
const newPropertySets = [];
|
|
41
|
+
// Track property set IDs and relationship IDs to skip
|
|
42
|
+
const skipPropertySetIds = new Set();
|
|
43
|
+
const skipRelationshipIds = new Set();
|
|
44
|
+
// Process mutations if we have a mutation view
|
|
45
|
+
if (this.mutationView && (options.applyMutations !== false)) {
|
|
46
|
+
const mutations = this.mutationView.getMutations();
|
|
47
|
+
// Group mutations by entity
|
|
48
|
+
const entityMutations = new Map();
|
|
49
|
+
for (const mutation of mutations) {
|
|
50
|
+
if (!entityMutations.has(mutation.entityId)) {
|
|
51
|
+
entityMutations.set(mutation.entityId, new Set());
|
|
52
|
+
}
|
|
53
|
+
if (mutation.psetName) {
|
|
54
|
+
entityMutations.get(mutation.entityId).add(mutation.psetName);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Collect modified property sets and find original psets to skip
|
|
58
|
+
for (const [entityId, psetNames] of entityMutations) {
|
|
59
|
+
modifiedEntities.add(entityId);
|
|
60
|
+
modifiedPsets.set(entityId, psetNames);
|
|
61
|
+
modifiedEntityCount++;
|
|
62
|
+
// Get the FULL mutated property sets for this entity (merged base + mutations)
|
|
63
|
+
const allPsets = this.mutationView.getForEntity(entityId);
|
|
64
|
+
const relevantPsets = allPsets.filter(pset => psetNames.has(pset.name));
|
|
65
|
+
if (relevantPsets.length > 0) {
|
|
66
|
+
newPropertySets.push({ entityId, psets: relevantPsets });
|
|
67
|
+
}
|
|
68
|
+
// Find original property set IDs and relationship IDs to skip
|
|
69
|
+
// Look for IfcRelDefinesByProperties that reference this entity
|
|
70
|
+
for (const [relId, relRef] of this.dataStore.entityIndex.byId) {
|
|
71
|
+
const relType = relRef.type.toUpperCase();
|
|
72
|
+
if (relType === 'IFCRELDEFINESBYPROPERTIES') {
|
|
73
|
+
// Parse the relationship to check if it references our entity
|
|
74
|
+
const relatedEntities = this.getRelatedEntities(relId);
|
|
75
|
+
const relatedPsetId = this.getRelatedPropertySet(relId);
|
|
76
|
+
if (relatedEntities.includes(entityId) && relatedPsetId) {
|
|
77
|
+
// Check if this pset is one we're modifying
|
|
78
|
+
const psetName = this.getPropertySetName(relatedPsetId);
|
|
79
|
+
if (psetName && psetNames.has(psetName)) {
|
|
80
|
+
skipRelationshipIds.add(relId);
|
|
81
|
+
skipPropertySetIds.add(relatedPsetId);
|
|
82
|
+
// Also skip the individual properties in this pset
|
|
83
|
+
const propIds = this.getPropertyIdsInSet(relatedPsetId);
|
|
84
|
+
for (const propId of propIds) {
|
|
85
|
+
skipPropertySetIds.add(propId);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// If delta only, only export modified entities
|
|
94
|
+
if (options.deltaOnly && modifiedEntities.size === 0) {
|
|
95
|
+
return {
|
|
96
|
+
content: header + 'DATA;\nENDSEC;\nEND-ISO-10303-21;\n',
|
|
97
|
+
stats: {
|
|
98
|
+
entityCount: 0,
|
|
99
|
+
newEntityCount: 0,
|
|
100
|
+
modifiedEntityCount: 0,
|
|
101
|
+
fileSize: 0,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// Export original entities from source buffer, SKIPPING modified property sets
|
|
106
|
+
if (!options.deltaOnly && this.dataStore.source) {
|
|
107
|
+
const decoder = new TextDecoder();
|
|
108
|
+
const source = this.dataStore.source;
|
|
109
|
+
// Extract existing entities from source
|
|
110
|
+
for (const [expressId, entityRef] of this.dataStore.entityIndex.byId) {
|
|
111
|
+
// Skip property sets/relationships that are being replaced
|
|
112
|
+
if (skipPropertySetIds.has(expressId) || skipRelationshipIds.has(expressId)) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
// Skip if we're only doing geometry or specific types
|
|
116
|
+
const entityType = entityRef.type.toUpperCase();
|
|
117
|
+
// Skip geometry if not included
|
|
118
|
+
if (options.includeGeometry === false && this.isGeometryEntity(entityType)) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
// Get original entity text
|
|
122
|
+
const entityText = decoder.decode(source.subarray(entityRef.byteOffset, entityRef.byteOffset + entityRef.byteLength));
|
|
123
|
+
entities.push(entityText);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// Generate new property entities for mutations (these REPLACE the skipped ones)
|
|
127
|
+
for (const { entityId, psets } of newPropertySets) {
|
|
128
|
+
const newEntities = this.generatePropertySetEntities(entityId, psets);
|
|
129
|
+
entities.push(...newEntities.lines);
|
|
130
|
+
newEntityCount += newEntities.count;
|
|
131
|
+
}
|
|
132
|
+
// Assemble final file
|
|
133
|
+
const dataSection = entities.join('\n');
|
|
134
|
+
const content = `${header}DATA;\n${dataSection}\nENDSEC;\nEND-ISO-10303-21;\n`;
|
|
135
|
+
return {
|
|
136
|
+
content,
|
|
137
|
+
stats: {
|
|
138
|
+
entityCount: entities.length,
|
|
139
|
+
newEntityCount,
|
|
140
|
+
modifiedEntityCount,
|
|
141
|
+
fileSize: new TextEncoder().encode(content).length,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Export only property/quantity changes (lightweight export)
|
|
147
|
+
*/
|
|
148
|
+
exportPropertiesOnly(options) {
|
|
149
|
+
return this.export({
|
|
150
|
+
...options,
|
|
151
|
+
includeGeometry: false,
|
|
152
|
+
deltaOnly: true,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Generate STEP entities for property sets
|
|
157
|
+
*/
|
|
158
|
+
generatePropertySetEntities(entityId, psets) {
|
|
159
|
+
const lines = [];
|
|
160
|
+
let count = 0;
|
|
161
|
+
for (const pset of psets) {
|
|
162
|
+
const propertyIds = [];
|
|
163
|
+
// Create IfcPropertySingleValue for each property
|
|
164
|
+
for (const prop of pset.properties) {
|
|
165
|
+
const propId = this.nextExpressId++;
|
|
166
|
+
count++;
|
|
167
|
+
const valueStr = this.serializePropertyValue(prop.value, prop.type);
|
|
168
|
+
const unitStr = prop.unit ? ref(this.findUnitId(prop.unit)) : null;
|
|
169
|
+
// #ID=IFCPROPERTYSINGLEVALUE('Name',$,Value,Unit);
|
|
170
|
+
const line = `#${propId}=IFCPROPERTYSINGLEVALUE('${this.escapeStepString(prop.name)}',$,${valueStr},${unitStr ? serializeValue(unitStr) : '$'});`;
|
|
171
|
+
lines.push(line);
|
|
172
|
+
propertyIds.push(propId);
|
|
173
|
+
}
|
|
174
|
+
// Create IfcPropertySet
|
|
175
|
+
const psetId = this.nextExpressId++;
|
|
176
|
+
count++;
|
|
177
|
+
const propRefs = propertyIds.map(id => `#${id}`).join(',');
|
|
178
|
+
const globalId = this.generateGlobalId();
|
|
179
|
+
// #ID=IFCPROPERTYSET('GlobalId',$,'Name',$,(#props));
|
|
180
|
+
const psetLine = `#${psetId}=IFCPROPERTYSET('${globalId}',$,'${this.escapeStepString(pset.name)}',$,(${propRefs}));`;
|
|
181
|
+
lines.push(psetLine);
|
|
182
|
+
// Create IfcRelDefinesByProperties to link pset to entity
|
|
183
|
+
const relId = this.nextExpressId++;
|
|
184
|
+
count++;
|
|
185
|
+
const relGlobalId = this.generateGlobalId();
|
|
186
|
+
// #ID=IFCRELDEFINESBYPROPERTIES('GlobalId',$,$,$,(#entity),#pset);
|
|
187
|
+
const relLine = `#${relId}=IFCRELDEFINESBYPROPERTIES('${relGlobalId}',$,$,$,(#${entityId}),#${psetId});`;
|
|
188
|
+
lines.push(relLine);
|
|
189
|
+
}
|
|
190
|
+
return { lines, count };
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Serialize a property value to STEP format
|
|
194
|
+
*/
|
|
195
|
+
serializePropertyValue(value, type) {
|
|
196
|
+
if (value === null || value === undefined) {
|
|
197
|
+
return '$';
|
|
198
|
+
}
|
|
199
|
+
switch (type) {
|
|
200
|
+
case PropertyValueType.String:
|
|
201
|
+
case PropertyValueType.Label:
|
|
202
|
+
case PropertyValueType.Text:
|
|
203
|
+
return `IFCLABEL('${this.escapeStepString(String(value))}')`;
|
|
204
|
+
case PropertyValueType.Identifier:
|
|
205
|
+
return `IFCIDENTIFIER('${this.escapeStepString(String(value))}')`;
|
|
206
|
+
case PropertyValueType.Real:
|
|
207
|
+
const num = Number(value);
|
|
208
|
+
if (!Number.isFinite(num))
|
|
209
|
+
return '$';
|
|
210
|
+
return `IFCREAL(${num.toString().includes('.') ? num : num + '.'})`;
|
|
211
|
+
case PropertyValueType.Integer:
|
|
212
|
+
return `IFCINTEGER(${Math.round(Number(value))})`;
|
|
213
|
+
case PropertyValueType.Boolean:
|
|
214
|
+
case PropertyValueType.Logical:
|
|
215
|
+
if (value === true)
|
|
216
|
+
return `IFCBOOLEAN(.T.)`;
|
|
217
|
+
if (value === false)
|
|
218
|
+
return `IFCBOOLEAN(.F.)`;
|
|
219
|
+
return `IFCLOGICAL(.U.)`;
|
|
220
|
+
case PropertyValueType.Enum:
|
|
221
|
+
return `.${String(value).toUpperCase()}.`;
|
|
222
|
+
case PropertyValueType.List:
|
|
223
|
+
if (Array.isArray(value)) {
|
|
224
|
+
const items = value.map(v => this.serializePropertyValue(v, PropertyValueType.String));
|
|
225
|
+
return `(${items.join(',')})`;
|
|
226
|
+
}
|
|
227
|
+
return '$';
|
|
228
|
+
default:
|
|
229
|
+
return `IFCLABEL('${this.escapeStepString(String(value))}')`;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Escape a string for STEP format
|
|
234
|
+
*/
|
|
235
|
+
escapeStepString(str) {
|
|
236
|
+
return str
|
|
237
|
+
.replace(/\\/g, '\\\\')
|
|
238
|
+
.replace(/'/g, "''");
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Generate a new IFC GlobalId (22 character base64)
|
|
242
|
+
*/
|
|
243
|
+
generateGlobalId() {
|
|
244
|
+
const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$';
|
|
245
|
+
let result = '';
|
|
246
|
+
for (let i = 0; i < 22; i++) {
|
|
247
|
+
result += chars[Math.floor(Math.random() * 64)];
|
|
248
|
+
}
|
|
249
|
+
return result;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Find the maximum EXPRESS ID in the data store
|
|
253
|
+
*/
|
|
254
|
+
findMaxExpressId() {
|
|
255
|
+
let max = 0;
|
|
256
|
+
for (const [id] of this.dataStore.entityIndex.byId) {
|
|
257
|
+
if (id > max)
|
|
258
|
+
max = id;
|
|
259
|
+
}
|
|
260
|
+
return max;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Find a unit entity ID by name (simplified - returns null for now)
|
|
264
|
+
*/
|
|
265
|
+
findUnitId(_unitName) {
|
|
266
|
+
// TODO: Implement unit lookup from data store
|
|
267
|
+
return 0;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Check if an entity type is a geometry-related type
|
|
271
|
+
*/
|
|
272
|
+
isGeometryEntity(type) {
|
|
273
|
+
const geometryTypes = new Set([
|
|
274
|
+
'IFCCARTESIANPOINT',
|
|
275
|
+
'IFCDIRECTION',
|
|
276
|
+
'IFCAXIS2PLACEMENT2D',
|
|
277
|
+
'IFCAXIS2PLACEMENT3D',
|
|
278
|
+
'IFCLOCALPLACEMENT',
|
|
279
|
+
'IFCSHAPEREPRESENTATION',
|
|
280
|
+
'IFCPRODUCTDEFINITIONSHAPE',
|
|
281
|
+
'IFCGEOMETRICREPRESENTATIONCONTEXT',
|
|
282
|
+
'IFCGEOMETRICREPRESENTATIONSUBCONTEXT',
|
|
283
|
+
'IFCEXTRUDEDAREASOLID',
|
|
284
|
+
'IFCFACETEDBREP',
|
|
285
|
+
'IFCPOLYLOOP',
|
|
286
|
+
'IFCFACE',
|
|
287
|
+
'IFCFACEOUTERBOUND',
|
|
288
|
+
'IFCCLOSEDSHELL',
|
|
289
|
+
'IFCRECTANGLEPROFILEDEF',
|
|
290
|
+
'IFCCIRCLEPROFILEDEF',
|
|
291
|
+
'IFCARBITRARYCLOSEDPROFILEDEF',
|
|
292
|
+
'IFCPOLYLINE',
|
|
293
|
+
'IFCTRIMMEDCURVE',
|
|
294
|
+
'IFCBSPLINECURVE',
|
|
295
|
+
'IFCBSPLINESURFACE',
|
|
296
|
+
'IFCTRIANGULATEDFACESET',
|
|
297
|
+
'IFCPOLYGONALFACE',
|
|
298
|
+
'IFCINDEXEDPOLYGONALFACE',
|
|
299
|
+
'IFCPOLYGONALFACESET',
|
|
300
|
+
'IFCSTYLEDITEM',
|
|
301
|
+
'IFCPRESENTATIONSTYLEASSIGNMENT',
|
|
302
|
+
'IFCSURFACESTYLE',
|
|
303
|
+
'IFCSURFACESTYLERENDERING',
|
|
304
|
+
'IFCCOLOURRGB',
|
|
305
|
+
]);
|
|
306
|
+
return geometryTypes.has(type);
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Get entity IDs related by IfcRelDefinesByProperties (the related objects)
|
|
310
|
+
*/
|
|
311
|
+
getRelatedEntities(relId) {
|
|
312
|
+
const entityRef = this.dataStore.entityIndex.byId.get(relId);
|
|
313
|
+
if (!entityRef || !this.dataStore.source)
|
|
314
|
+
return [];
|
|
315
|
+
const decoder = new TextDecoder();
|
|
316
|
+
const entityText = decoder.decode(this.dataStore.source.subarray(entityRef.byteOffset, entityRef.byteOffset + entityRef.byteLength));
|
|
317
|
+
// Parse IfcRelDefinesByProperties: #ID=IFCRELDEFINESBYPROPERTIES('guid',$,$,$,(#objects),#pset);
|
|
318
|
+
// The 5th argument (index 4) is the list of related objects
|
|
319
|
+
const match = entityText.match(/\(([^)]+)\)\s*,\s*#(\d+)\s*\)\s*;/);
|
|
320
|
+
if (!match)
|
|
321
|
+
return [];
|
|
322
|
+
const objectsList = match[1];
|
|
323
|
+
const refs = [];
|
|
324
|
+
const refMatches = objectsList.matchAll(/#(\d+)/g);
|
|
325
|
+
for (const m of refMatches) {
|
|
326
|
+
refs.push(parseInt(m[1], 10));
|
|
327
|
+
}
|
|
328
|
+
return refs;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Get the property set ID from IfcRelDefinesByProperties
|
|
332
|
+
*/
|
|
333
|
+
getRelatedPropertySet(relId) {
|
|
334
|
+
const entityRef = this.dataStore.entityIndex.byId.get(relId);
|
|
335
|
+
if (!entityRef || !this.dataStore.source)
|
|
336
|
+
return null;
|
|
337
|
+
const decoder = new TextDecoder();
|
|
338
|
+
const entityText = decoder.decode(this.dataStore.source.subarray(entityRef.byteOffset, entityRef.byteOffset + entityRef.byteLength));
|
|
339
|
+
// Last #ID before the closing );
|
|
340
|
+
const match = entityText.match(/,\s*#(\d+)\s*\)\s*;$/);
|
|
341
|
+
if (!match)
|
|
342
|
+
return null;
|
|
343
|
+
return parseInt(match[1], 10);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Get the name of a property set by parsing the entity
|
|
347
|
+
*/
|
|
348
|
+
getPropertySetName(psetId) {
|
|
349
|
+
const entityRef = this.dataStore.entityIndex.byId.get(psetId);
|
|
350
|
+
if (!entityRef || !this.dataStore.source)
|
|
351
|
+
return null;
|
|
352
|
+
const decoder = new TextDecoder();
|
|
353
|
+
const entityText = decoder.decode(this.dataStore.source.subarray(entityRef.byteOffset, entityRef.byteOffset + entityRef.byteLength));
|
|
354
|
+
// Parse: IFCPROPERTYSET('guid',$,'Name',$,...) - Name is 3rd argument
|
|
355
|
+
const match = entityText.match(/IFCPROPERTYSET\s*\([^,]*,[^,]*,'([^']*)'/i);
|
|
356
|
+
if (!match)
|
|
357
|
+
return null;
|
|
358
|
+
return match[1];
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Get IDs of properties in a property set
|
|
362
|
+
*/
|
|
363
|
+
getPropertyIdsInSet(psetId) {
|
|
364
|
+
const entityRef = this.dataStore.entityIndex.byId.get(psetId);
|
|
365
|
+
if (!entityRef || !this.dataStore.source)
|
|
366
|
+
return [];
|
|
367
|
+
const decoder = new TextDecoder();
|
|
368
|
+
const entityText = decoder.decode(this.dataStore.source.subarray(entityRef.byteOffset, entityRef.byteOffset + entityRef.byteLength));
|
|
369
|
+
// Parse: IFCPROPERTYSET(...,(#prop1,#prop2,...)); - Last argument is properties list
|
|
370
|
+
const match = entityText.match(/\(\s*(#[^)]+)\s*\)\s*\)\s*;$/);
|
|
371
|
+
if (!match)
|
|
372
|
+
return [];
|
|
373
|
+
const propsList = match[1];
|
|
374
|
+
const ids = [];
|
|
375
|
+
const refMatches = propsList.matchAll(/#(\d+)/g);
|
|
376
|
+
for (const m of refMatches) {
|
|
377
|
+
ids.push(parseInt(m[1], 10));
|
|
378
|
+
}
|
|
379
|
+
return ids;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Quick export function for simple use cases
|
|
384
|
+
*/
|
|
385
|
+
export function exportToStep(dataStore, options) {
|
|
386
|
+
const exporter = new StepExporter(dataStore);
|
|
387
|
+
const result = exporter.export({
|
|
388
|
+
schema: 'IFC4',
|
|
389
|
+
...options,
|
|
390
|
+
});
|
|
391
|
+
return result.content;
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=step-exporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-exporter.js","sourceRoot":"","sources":["../src/step-exporter.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAU/D,OAAO,EACL,cAAc,EACd,cAAc,EACd,GAAG,GAIJ,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAqDnD;;GAEG;AACH,MAAM,OAAO,YAAY;IACf,SAAS,CAAe;IACxB,YAAY,CAA6B;IACzC,aAAa,CAAS;IAE9B,YAAY,SAAuB,EAAE,YAAkC;QACrE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;QACzC,8CAA8C;QAC9C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,MAAM,C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AEpC,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC7B,MAAM,EAAE,MAAM;QACd,GAAG,OAAO;KACX,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/export",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Export formats for IFC-Lite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
"parquet-wasm": "^0.5.0",
|
|
16
16
|
"apache-arrow": "^14.0.0",
|
|
17
17
|
"jszip": "^3.10.0",
|
|
18
|
-
"@ifc-lite/geometry": "^1.
|
|
19
|
-
"@ifc-lite/data": "^1.
|
|
20
|
-
"@ifc-lite/parser": "^1.
|
|
18
|
+
"@ifc-lite/geometry": "^1.6.0",
|
|
19
|
+
"@ifc-lite/data": "^1.6.0",
|
|
20
|
+
"@ifc-lite/parser": "^1.6.0",
|
|
21
|
+
"@ifc-lite/mutations": "^1.6.0"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"typescript": "^5.3.0",
|