@bldrs-ai/conway 1.375.1183 → 1.377.1188
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/compiled/examples/browser-bundled.cjs +639 -402
- package/compiled/examples/cli-bundled.cjs +4512 -3990
- package/compiled/examples/cli-step-bundled.cjs +12611 -12353
- package/compiled/examples/validator-bundled.cjs +639 -402
- package/compiled/src/AP214E3_2010/ap214_product_structure_extraction.d.ts +89 -3
- package/compiled/src/AP214E3_2010/ap214_product_structure_extraction.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_product_structure_extraction.js +195 -15
- package/compiled/src/AP214E3_2010/ap214_product_structure_extraction.test.js +97 -4
- package/compiled/src/AP214E3_2010/ap214_step_parser.d.ts +16 -2
- package/compiled/src/AP214E3_2010/ap214_step_parser.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_step_parser.js +16 -2
- package/compiled/src/cli/cli_progress_renderer.d.ts +43 -0
- package/compiled/src/cli/cli_progress_renderer.d.ts.map +1 -0
- package/compiled/src/cli/cli_progress_renderer.js +90 -0
- package/compiled/src/compat/web-ifc/ap214_properties.d.ts +16 -2
- package/compiled/src/compat/web-ifc/ap214_properties.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ap214_properties.js +33 -2
- package/compiled/src/compat/web-ifc/ap214_properties.test.js +22 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +41 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +60 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +13 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +30 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +68 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +185 -49
- package/compiled/src/compat/web-ifc/index.d.ts +1 -0
- package/compiled/src/compat/web-ifc/index.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/properties.d.ts +2 -2
- package/compiled/src/compat/web-ifc/properties.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/properties.js +3 -2
- package/compiled/src/compat/web-ifc/properties_passthrough.d.ts +13 -1
- package/compiled/src/compat/web-ifc/properties_passthrough.d.ts.map +1 -1
- package/compiled/src/core/progress.d.ts +113 -0
- package/compiled/src/core/progress.d.ts.map +1 -0
- package/compiled/src/core/progress.js +111 -0
- package/compiled/src/core/progress.test.d.ts +2 -0
- package/compiled/src/core/progress.test.d.ts.map +1 -0
- package/compiled/src/core/progress.test.js +65 -0
- package/compiled/src/ifc/ifc_command_line_main.js +46 -5
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +40 -1
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +84 -1
- package/compiled/src/ifc/ifc_geometry_extraction_progress.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_geometry_extraction_progress.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_geometry_extraction_progress.test.js +55 -0
- package/compiled/src/ifc/ifc_step_parser.d.ts +16 -2
- package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_parser.js +16 -2
- package/compiled/src/index.d.ts +3 -1
- package/compiled/src/index.d.ts.map +1 -1
- package/compiled/src/index.js +2 -1
- package/compiled/src/indexing/multi_index_set.d.ts +13 -0
- package/compiled/src/indexing/multi_index_set.d.ts.map +1 -1
- package/compiled/src/indexing/multi_index_set.js +44 -0
- package/compiled/src/loaders/conway_model_loader.d.ts +21 -1
- package/compiled/src/loaders/conway_model_loader.d.ts.map +1 -1
- package/compiled/src/loaders/conway_model_loader.js +46 -12
- package/compiled/src/logging/logger.d.ts +74 -5
- package/compiled/src/logging/logger.d.ts.map +1 -1
- package/compiled/src/logging/logger.js +116 -3
- package/compiled/src/logging/logger.test.d.ts +2 -0
- package/compiled/src/logging/logger.test.d.ts.map +1 -0
- package/compiled/src/logging/logger.test.js +62 -0
- package/compiled/src/memory/memory.d.ts +8 -0
- package/compiled/src/memory/memory.d.ts.map +1 -1
- package/compiled/src/memory/memory.js +23 -0
- package/compiled/src/statistics/statistics.d.ts +7 -0
- package/compiled/src/statistics/statistics.d.ts.map +1 -1
- package/compiled/src/statistics/statistics.js +11 -2
- package/compiled/src/step/parsing/step_deserialization_functions.d.ts +16 -0
- package/compiled/src/step/parsing/step_deserialization_functions.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_deserialization_functions.js +20 -1
- package/compiled/src/step/parsing/step_deserialization_functions.test.d.ts +2 -0
- package/compiled/src/step/parsing/step_deserialization_functions.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/step_deserialization_functions.test.js +27 -0
- package/compiled/src/step/parsing/step_parser.d.ts +38 -2
- package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_parser.js +67 -2
- package/compiled/src/step/parsing/step_parser_progress.test.d.ts +2 -0
- package/compiled/src/step/parsing/step_parser_progress.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/step_parser_progress.test.js +70 -0
- package/compiled/src/step/step_model_base.d.ts +11 -0
- package/compiled/src/step/step_model_base.d.ts.map +1 -1
- package/compiled/src/step/step_model_base.js +25 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -29,6 +29,517 @@ var import_process = require("process");
|
|
|
29
29
|
var import_node_process = require("node:process");
|
|
30
30
|
var readline = __toESM(require("node:readline"), 1);
|
|
31
31
|
|
|
32
|
+
// compiled/src/version/version.js
|
|
33
|
+
var versionString = "Conway Web-Ifc Shim v1.377.1188";
|
|
34
|
+
|
|
35
|
+
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
36
|
+
var wasmType = "";
|
|
37
|
+
var dynamicImport = new Function("module", "return import(module)");
|
|
38
|
+
|
|
39
|
+
// compiled/dependencies/conway-geom/interface/material_object.js
|
|
40
|
+
var BlendMode;
|
|
41
|
+
(function(BlendMode2) {
|
|
42
|
+
BlendMode2[BlendMode2["OPAQUE"] = 0] = "OPAQUE";
|
|
43
|
+
BlendMode2[BlendMode2["BLEND"] = 1] = "BLEND";
|
|
44
|
+
BlendMode2[BlendMode2["MASK"] = 2] = "MASK";
|
|
45
|
+
})(BlendMode || (BlendMode = {}));
|
|
46
|
+
|
|
47
|
+
// compiled/src/statistics/statistics.js
|
|
48
|
+
var Statistics = class {
|
|
49
|
+
// Getters and setters
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @return {string | undefined} - load status or undefined
|
|
53
|
+
*/
|
|
54
|
+
getLoadStatus() {
|
|
55
|
+
return this.loadStatus;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @param value - load status
|
|
60
|
+
*/
|
|
61
|
+
setLoadStatus(value) {
|
|
62
|
+
this.loadStatus = value;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @return {string | undefined} - project name or undefined
|
|
67
|
+
*/
|
|
68
|
+
getProjectName() {
|
|
69
|
+
return this.projectName;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param value - project name
|
|
74
|
+
*/
|
|
75
|
+
setProjectName(value) {
|
|
76
|
+
this.projectName = value;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @return {string | undefined} - version or undefined
|
|
81
|
+
*/
|
|
82
|
+
getVersion() {
|
|
83
|
+
return this.version;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param value - version
|
|
88
|
+
*/
|
|
89
|
+
setVersion(value) {
|
|
90
|
+
this.version = value;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @return {number | undefined} - parse time or undefined
|
|
95
|
+
*/
|
|
96
|
+
getParseTime() {
|
|
97
|
+
return this.parseTime;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @param value - parse time
|
|
102
|
+
*/
|
|
103
|
+
setParseTime(value) {
|
|
104
|
+
this.parseTime = value;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @return {number | undefined} - geometry parse time or undefined
|
|
109
|
+
*/
|
|
110
|
+
getGeometryTime() {
|
|
111
|
+
return this.geometryTime;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @param value - geometry parse time
|
|
116
|
+
*/
|
|
117
|
+
setGeometryTime(value) {
|
|
118
|
+
this.geometryTime = value;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
* @return {number | undefined} - total execution time or undefined
|
|
123
|
+
*/
|
|
124
|
+
getTotalTime() {
|
|
125
|
+
return this.totalTime;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* @param value - total execution time
|
|
130
|
+
*/
|
|
131
|
+
setTotalTime(value) {
|
|
132
|
+
this.totalTime = value;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
*
|
|
136
|
+
* @return {number | undefined} - geometry memory or undefined
|
|
137
|
+
*/
|
|
138
|
+
getGeometryMemory() {
|
|
139
|
+
return this.geometryMemory;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param value - geometry memory
|
|
144
|
+
*/
|
|
145
|
+
setGeometryMemory(value) {
|
|
146
|
+
this.geometryMemory = value;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
*
|
|
150
|
+
* @return {string | undefined} - preprocessor version or undefined
|
|
151
|
+
*/
|
|
152
|
+
getPreprocessorVersion() {
|
|
153
|
+
return this.preprocessorVersion;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
*
|
|
157
|
+
* @param value - preprocessor version
|
|
158
|
+
*/
|
|
159
|
+
setPreprocessorVersion(value) {
|
|
160
|
+
this.preprocessorVersion = value;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @return {string | undefined} - originating system or undefined
|
|
165
|
+
*/
|
|
166
|
+
getOriginatingSystem() {
|
|
167
|
+
return this.originatingSystem;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
*
|
|
171
|
+
* @param value - originating system
|
|
172
|
+
*/
|
|
173
|
+
setOriginatingSystem(value) {
|
|
174
|
+
this.originatingSystem = value;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
* @return {string | undefined} - memory statistics or undefined
|
|
179
|
+
*/
|
|
180
|
+
getMemoryStatistics() {
|
|
181
|
+
return this.memoryStatistics;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
*
|
|
185
|
+
* @param value - memory statistics
|
|
186
|
+
*/
|
|
187
|
+
setMemoryStatistics(value) {
|
|
188
|
+
this.memoryStatistics = value;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* prints statistics
|
|
192
|
+
*/
|
|
193
|
+
printStatistics() {
|
|
194
|
+
console.log(this.format());
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Format the load-summary line (Logger routes this through its sink so
|
|
198
|
+
* the CLI can keep stdout clean — issue #301).
|
|
199
|
+
*
|
|
200
|
+
* @return {string} the single-line load summary
|
|
201
|
+
*/
|
|
202
|
+
format() {
|
|
203
|
+
const date = /* @__PURE__ */ new Date();
|
|
204
|
+
const options = {
|
|
205
|
+
year: "numeric",
|
|
206
|
+
month: "short",
|
|
207
|
+
day: "numeric",
|
|
208
|
+
hour: "2-digit",
|
|
209
|
+
minute: "2-digit",
|
|
210
|
+
second: "2-digit",
|
|
211
|
+
timeZone: "UTC"
|
|
212
|
+
};
|
|
213
|
+
const dateString = date.toLocaleDateString("en-US", options).replace(/,/g, "");
|
|
214
|
+
const versionMatch = versionString.match(/v(\d+\.\d+\.\d+)/);
|
|
215
|
+
let conwayVersionNumber;
|
|
216
|
+
if (versionMatch !== null) {
|
|
217
|
+
conwayVersionNumber = versionMatch[1];
|
|
218
|
+
} else {
|
|
219
|
+
conwayVersionNumber = "Version Not Found";
|
|
220
|
+
}
|
|
221
|
+
let versionStr;
|
|
222
|
+
if (this.version !== void 0) {
|
|
223
|
+
const match = this.version.match(/'([^']+)'/);
|
|
224
|
+
if (match) {
|
|
225
|
+
versionStr = match[1];
|
|
226
|
+
} else {
|
|
227
|
+
versionStr = "No match found";
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
versionStr = "Version not defined";
|
|
231
|
+
}
|
|
232
|
+
return `[${dateString}]: Load Status: ${this.loadStatus}, Project Name: ${this.projectName}, Version: ${versionStr}, Conway Version: ${conwayVersionNumber}-${wasmType}, Parse Time: ${this.parseTime} ms, Geometry Time: ${this.geometryTime} ms, Total Time: ${this.totalTime} ms, Geometry Memory: ${this.geometryMemory?.toFixed(3)} MB, Memory Statistics: ${this.memoryStatistics}, Preprocessor Version: ${this.preprocessorVersion}, Originating System: ${this.originatingSystem}`;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// compiled/src/logging/logger.js
|
|
237
|
+
var LogLevel;
|
|
238
|
+
(function(LogLevel2) {
|
|
239
|
+
LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
|
|
240
|
+
LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
|
|
241
|
+
LogLevel2[LogLevel2["WARNING"] = 2] = "WARNING";
|
|
242
|
+
LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
|
|
243
|
+
LogLevel2[LogLevel2["OFF"] = 4] = "OFF";
|
|
244
|
+
})(LogLevel || (LogLevel = {}));
|
|
245
|
+
var LOG_LEVEL_BY_NAME = {
|
|
246
|
+
"debug": LogLevel.DEBUG,
|
|
247
|
+
"info": LogLevel.INFO,
|
|
248
|
+
"warning": LogLevel.WARNING,
|
|
249
|
+
"error": LogLevel.ERROR
|
|
250
|
+
};
|
|
251
|
+
var defaultSink = (level, message) => {
|
|
252
|
+
switch (level) {
|
|
253
|
+
case "error":
|
|
254
|
+
console.error(message);
|
|
255
|
+
break;
|
|
256
|
+
case "warning":
|
|
257
|
+
console.warn(message);
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
console.log(message);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
var Logger = class _Logger {
|
|
264
|
+
/**
|
|
265
|
+
* Detects environment and initializes wasm callbacks
|
|
266
|
+
*/
|
|
267
|
+
static initializeWasmCallbacks() {
|
|
268
|
+
const environment = environment_default.environmentType;
|
|
269
|
+
if (environment === EnvironmentType.BROWSER) {
|
|
270
|
+
const globalScope = window;
|
|
271
|
+
globalScope.logInfo = _Logger.info;
|
|
272
|
+
globalScope.logWarning = _Logger.warning;
|
|
273
|
+
globalScope.logError = _Logger.error;
|
|
274
|
+
} else if (environment === EnvironmentType.NODE || environment === EnvironmentType.BOTH_FEATURES) {
|
|
275
|
+
const globalScope = global;
|
|
276
|
+
globalScope.logInfo = _Logger.info;
|
|
277
|
+
globalScope.logWarning = _Logger.warning;
|
|
278
|
+
globalScope.logError = _Logger.error;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Set the console-echo threshold. Embedders (e.g. Share) call this to
|
|
283
|
+
* quiet or expand conway's console output; the CLI maps -q/-v/-vv here.
|
|
284
|
+
*
|
|
285
|
+
* @param level - new threshold
|
|
286
|
+
*/
|
|
287
|
+
static setLogLevel(level) {
|
|
288
|
+
_Logger.threshold = level;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
*
|
|
292
|
+
* @return {LogLevel} the current console-echo threshold
|
|
293
|
+
*/
|
|
294
|
+
static getLogLevel() {
|
|
295
|
+
return _Logger.threshold;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Is a given level at or above the current threshold?
|
|
299
|
+
*
|
|
300
|
+
* @param level - level to test
|
|
301
|
+
* @return {boolean} true when messages at this level echo to the console
|
|
302
|
+
*/
|
|
303
|
+
static isLevelEnabled(level) {
|
|
304
|
+
return level >= _Logger.threshold && _Logger.threshold !== LogLevel.OFF;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Replace the console sink (e.g. the CLI routes all echoes to stderr so
|
|
308
|
+
* stdout stays parseable). Pass undefined to restore the default.
|
|
309
|
+
*
|
|
310
|
+
* @param sink - replacement sink or undefined
|
|
311
|
+
*/
|
|
312
|
+
static setSink(sink) {
|
|
313
|
+
_Logger.sink = sink ?? defaultSink;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
* @param message - log message
|
|
318
|
+
* @param level - log level
|
|
319
|
+
* @return {number} log index
|
|
320
|
+
*/
|
|
321
|
+
static findLogIndex(message, level) {
|
|
322
|
+
return _Logger.logs.findIndex((log) => log.message === message && log.level === level);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
*
|
|
326
|
+
* @param level - log level
|
|
327
|
+
* @param message - log message
|
|
328
|
+
*/
|
|
329
|
+
static log(level, message) {
|
|
330
|
+
const baseMessage = message.split(" expressID: ")[0];
|
|
331
|
+
const data = message.split(" expressID: ")[1];
|
|
332
|
+
const index = _Logger.findLogIndex(baseMessage, level);
|
|
333
|
+
let logEntry;
|
|
334
|
+
let firstOccurrence = false;
|
|
335
|
+
if (index >= 0) {
|
|
336
|
+
_Logger.logs[index].count += 1;
|
|
337
|
+
if (data !== void 0) {
|
|
338
|
+
_Logger.logs[index].expressIDs = _Logger.logs[index].expressIDs || /* @__PURE__ */ new Set();
|
|
339
|
+
_Logger.logs[index].expressIDs.add(data);
|
|
340
|
+
}
|
|
341
|
+
logEntry = _Logger.logs[index];
|
|
342
|
+
} else {
|
|
343
|
+
firstOccurrence = true;
|
|
344
|
+
logEntry = {
|
|
345
|
+
level,
|
|
346
|
+
message: baseMessage,
|
|
347
|
+
count: 1,
|
|
348
|
+
expressIDs: data ? /* @__PURE__ */ new Set([data]) : /* @__PURE__ */ new Set()
|
|
349
|
+
};
|
|
350
|
+
_Logger.logs.push(logEntry);
|
|
351
|
+
}
|
|
352
|
+
if (firstOccurrence && _Logger.isLevelEnabled(LOG_LEVEL_BY_NAME[level])) {
|
|
353
|
+
_Logger.sink(level, baseMessage);
|
|
354
|
+
}
|
|
355
|
+
_Logger.proxies.forEach((proxy) => proxy.log(logEntry));
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Compresses similar logs to a single line
|
|
359
|
+
*/
|
|
360
|
+
static compressLogs() {
|
|
361
|
+
const compressedLogs = [];
|
|
362
|
+
_Logger.logs.forEach((log) => {
|
|
363
|
+
const existingLog = compressedLogs.find((l) => l.message === log.message && l.level === log.level);
|
|
364
|
+
if (existingLog !== void 0) {
|
|
365
|
+
existingLog.count += log.count;
|
|
366
|
+
if (log.expressIDs !== void 0) {
|
|
367
|
+
log.expressIDs.forEach((d) => existingLog.expressIDs?.add(d));
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
compressedLogs.push({
|
|
371
|
+
...log,
|
|
372
|
+
expressIDs: log.expressIDs ? new Set(log.expressIDs) : /* @__PURE__ */ new Set()
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
_Logger.logs = compressedLogs;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
*
|
|
380
|
+
* @param proxy - a log proxy
|
|
381
|
+
*/
|
|
382
|
+
static addProxy(proxy) {
|
|
383
|
+
_Logger.proxies.push(proxy);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Remove a previously added proxy (no-op if absent).
|
|
387
|
+
*
|
|
388
|
+
* @param proxy - the proxy to remove
|
|
389
|
+
*/
|
|
390
|
+
static removeProxy(proxy) {
|
|
391
|
+
const index = _Logger.proxies.indexOf(proxy);
|
|
392
|
+
if (index >= 0) {
|
|
393
|
+
_Logger.proxies.splice(index, 1);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
*
|
|
398
|
+
* @param message - log message
|
|
399
|
+
*/
|
|
400
|
+
static debug(message) {
|
|
401
|
+
_Logger.log("debug", message);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
*
|
|
405
|
+
* @param message - log message
|
|
406
|
+
*/
|
|
407
|
+
static info(message) {
|
|
408
|
+
_Logger.log("info", message);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
*
|
|
412
|
+
* @param modelID
|
|
413
|
+
* @return {Statistics | undefined}
|
|
414
|
+
*/
|
|
415
|
+
static getStatistics(modelID) {
|
|
416
|
+
return this.statistics.get(modelID);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Create the statistics for a model ID.
|
|
420
|
+
*
|
|
421
|
+
* @param modelID The model ID to create statistics for
|
|
422
|
+
*
|
|
423
|
+
* @return {Statistics} The created statistics object.
|
|
424
|
+
*/
|
|
425
|
+
static createStatistics(modelID) {
|
|
426
|
+
const statistics = new Statistics();
|
|
427
|
+
this.statistics.set(modelID, statistics);
|
|
428
|
+
return statistics;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
*
|
|
432
|
+
* @param modelID
|
|
433
|
+
*/
|
|
434
|
+
static printStatistics(modelID) {
|
|
435
|
+
if (!_Logger.isLevelEnabled(LogLevel.INFO)) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
const statistics_ = this.statistics.get(modelID);
|
|
439
|
+
if (statistics_ !== void 0) {
|
|
440
|
+
_Logger.sink("info", statistics_.format());
|
|
441
|
+
} else {
|
|
442
|
+
_Logger.error(`No statistics for modelID: ${modelID}`);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Compresses the logs if they haven't been compressed,
|
|
447
|
+
* then returns a list of just the errors.
|
|
448
|
+
*
|
|
449
|
+
* @return {LogEntry[]} The errors.
|
|
450
|
+
*/
|
|
451
|
+
static getErrors() {
|
|
452
|
+
_Logger.compressLogs();
|
|
453
|
+
return this.logs.filter((where) => where.level === "error");
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
*
|
|
457
|
+
* @param message - log message
|
|
458
|
+
*/
|
|
459
|
+
static warning(message) {
|
|
460
|
+
_Logger.log("warning", message);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
*
|
|
464
|
+
* @param message - log message
|
|
465
|
+
*/
|
|
466
|
+
static error(message) {
|
|
467
|
+
_Logger.log("error", message);
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
*
|
|
471
|
+
* @return {LogEntry[]} - list of logs
|
|
472
|
+
*/
|
|
473
|
+
static getLogs() {
|
|
474
|
+
return _Logger.logs;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Display the deduplicated log buffer in a table.
|
|
478
|
+
*
|
|
479
|
+
* Gated behind the DEBUG threshold by default — a clean load should leave
|
|
480
|
+
* a quiet console (issue #301); pass force for explicit dumps (CLI -v).
|
|
481
|
+
*
|
|
482
|
+
* @param force - dump regardless of the current threshold
|
|
483
|
+
*/
|
|
484
|
+
static displayLogs(force = false) {
|
|
485
|
+
if (!force && !_Logger.isLevelEnabled(LogLevel.DEBUG)) {
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
_Logger.compressLogs();
|
|
489
|
+
console.table(_Logger.logs);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* clear logs
|
|
493
|
+
*/
|
|
494
|
+
static clearLogs() {
|
|
495
|
+
_Logger.logs = [];
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
Logger.logs = [];
|
|
499
|
+
Logger.proxies = [];
|
|
500
|
+
Logger.statistics = /* @__PURE__ */ new Map();
|
|
501
|
+
Logger.threshold = LogLevel.INFO;
|
|
502
|
+
Logger.sink = defaultSink;
|
|
503
|
+
var logger_default = Logger;
|
|
504
|
+
|
|
505
|
+
// compiled/src/utilities/environment.js
|
|
506
|
+
var EnvironmentType;
|
|
507
|
+
(function(EnvironmentType2) {
|
|
508
|
+
EnvironmentType2[EnvironmentType2["BROWSER"] = 0] = "BROWSER";
|
|
509
|
+
EnvironmentType2[EnvironmentType2["NODE"] = 1] = "NODE";
|
|
510
|
+
EnvironmentType2[EnvironmentType2["BOTH_FEATURES"] = 2] = "BOTH_FEATURES";
|
|
511
|
+
EnvironmentType2[EnvironmentType2["UNKNOWN"] = 3] = "UNKNOWN";
|
|
512
|
+
})(EnvironmentType || (EnvironmentType = {}));
|
|
513
|
+
var Environment = class {
|
|
514
|
+
/**
|
|
515
|
+
* determines the runtime environment
|
|
516
|
+
*/
|
|
517
|
+
static checkEnvironment() {
|
|
518
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
519
|
+
const isNode = typeof global !== "undefined" && typeof global.process !== "undefined" && global.process.versions && global.process.versions.node;
|
|
520
|
+
if (isBrowser && isNode) {
|
|
521
|
+
logger_default.info("This environment has features of both Node.js and a web browser.");
|
|
522
|
+
this.environmentType = EnvironmentType.BOTH_FEATURES;
|
|
523
|
+
} else if (isNode) {
|
|
524
|
+
this.environmentType = EnvironmentType.NODE;
|
|
525
|
+
} else if (isBrowser) {
|
|
526
|
+
this.environmentType = EnvironmentType.BROWSER;
|
|
527
|
+
} else {
|
|
528
|
+
logger_default.info("ENVIRONMENT === unknown");
|
|
529
|
+
this.environmentType = EnvironmentType.UNKNOWN;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
Environment.environmentType = EnvironmentType.UNKNOWN;
|
|
534
|
+
var environment_default = Environment;
|
|
535
|
+
|
|
536
|
+
// compiled/src/core/progress.js
|
|
537
|
+
function yieldToEventLoop() {
|
|
538
|
+
return new Promise((resolve) => {
|
|
539
|
+
setTimeout(resolve, 0);
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
|
|
32
543
|
// compiled/src/parsing/token_parsing.js
|
|
33
544
|
var encoder = new TextEncoder();
|
|
34
545
|
function encodeToken(from) {
|
|
@@ -1426,7 +1937,11 @@ var stringParser = step_string_parser_default.Instance.match;
|
|
|
1426
1937
|
var HASH = parsing_constants_default.HASH;
|
|
1427
1938
|
var ZERO4 = parsing_constants_default.ZERO;
|
|
1428
1939
|
var SLASH2 = parsing_constants_default.SLASH;
|
|
1429
|
-
var
|
|
1940
|
+
var EMPTY_PARSING_BYTES = new Uint8Array(1);
|
|
1941
|
+
var parsingBufferReusable = new ParsingBuffer(EMPTY_PARSING_BYTES, 0, 1);
|
|
1942
|
+
function releaseScratchParsingBuffer() {
|
|
1943
|
+
parsingBufferReusable.reinit(EMPTY_PARSING_BYTES, 0, 1);
|
|
1944
|
+
}
|
|
1430
1945
|
function NVL(testValue, replaceValue) {
|
|
1431
1946
|
return testValue ?? replaceValue;
|
|
1432
1947
|
}
|
|
@@ -1730,6 +2245,8 @@ var binaryParser = hex_parser_default.Instance.step;
|
|
|
1730
2245
|
var attributeMap = step_attribute_map_default.Instance.get;
|
|
1731
2246
|
var commentParser2 = step_comment_parser_default.Instance.match;
|
|
1732
2247
|
var stringParser2 = step_string_parser_default.Instance.match;
|
|
2248
|
+
var PARSE_PROGRESS_ELEMENT_MASK = 4095;
|
|
2249
|
+
var DEFAULT_PARSE_YIELD_INTERVAL_MS = 50;
|
|
1733
2250
|
var StepHeaderParser = class _StepHeaderParser {
|
|
1734
2251
|
/**
|
|
1735
2252
|
* Get the singleton static instance of this.
|
|
@@ -1952,12 +2469,64 @@ var StepParser = class extends StepHeaderParser {
|
|
|
1952
2469
|
return vtableBuilder.complete(cursor);
|
|
1953
2470
|
}
|
|
1954
2471
|
/**
|
|
1955
|
-
* Parse the data block of a step file, indexing it
|
|
2472
|
+
* Parse the data block of a step file, indexing it.
|
|
2473
|
+
*
|
|
2474
|
+
* Synchronous driver over parseDataBlockIncremental — see
|
|
2475
|
+
* parseDataBlockAsync for the cooperative (repaint-friendly) variant.
|
|
2476
|
+
*
|
|
2477
|
+
* @param input The input parsing buffer, in the data section.
|
|
2478
|
+
* @param onProgress Optional byte-cursor progress callback, invoked
|
|
2479
|
+
* roughly every PARSE_PROGRESS_ELEMENT_MASK + 1 elements.
|
|
2480
|
+
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
2481
|
+
*/
|
|
2482
|
+
parseDataBlock(input2, onProgress) {
|
|
2483
|
+
const parser211 = this.parseDataBlockIncremental(input2);
|
|
2484
|
+
while (true) {
|
|
2485
|
+
const next = parser211.next();
|
|
2486
|
+
if (next.done === true) {
|
|
2487
|
+
return next.value;
|
|
2488
|
+
}
|
|
2489
|
+
onProgress?.(next.value);
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Cooperative variant of parseDataBlock: identical parse (same generator
|
|
2494
|
+
* body), but periodically awaits a macrotask so the event loop can run —
|
|
2495
|
+
* browsers repaint progress UI, watchdog timers fire, and the tab is not
|
|
2496
|
+
* flagged as stalled during a large parse. Issue #301 §2.
|
|
1956
2497
|
*
|
|
1957
2498
|
* @param input The input parsing buffer, in the data section.
|
|
2499
|
+
* @param onProgress Optional byte-cursor progress callback.
|
|
2500
|
+
* @param yieldIntervalMs Minimum ms between event-loop yields.
|
|
2501
|
+
* @return {Promise<BlockParseResult>} The parsing result, including the
|
|
2502
|
+
* index and result enum.
|
|
2503
|
+
*/
|
|
2504
|
+
async parseDataBlockAsync(input2, onProgress, yieldIntervalMs = DEFAULT_PARSE_YIELD_INTERVAL_MS) {
|
|
2505
|
+
const parser211 = this.parseDataBlockIncremental(input2);
|
|
2506
|
+
let lastYield = Date.now();
|
|
2507
|
+
while (true) {
|
|
2508
|
+
const next = parser211.next();
|
|
2509
|
+
if (next.done === true) {
|
|
2510
|
+
return next.value;
|
|
2511
|
+
}
|
|
2512
|
+
onProgress?.(next.value);
|
|
2513
|
+
if (Date.now() - lastYield >= yieldIntervalMs) {
|
|
2514
|
+
await yieldToEventLoop();
|
|
2515
|
+
lastYield = Date.now();
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
/**
|
|
2520
|
+
* Parse the data block of a step file, indexing it, suspending with the
|
|
2521
|
+
* current byte cursor every PARSE_PROGRESS_ELEMENT_MASK + 1 elements so
|
|
2522
|
+
* drivers can report progress (and optionally yield to the event loop)
|
|
2523
|
+
* without the loop body diverging between sync and async paths.
|
|
2524
|
+
*
|
|
2525
|
+
* @param input The input parsing buffer, in the data section.
|
|
2526
|
+
* @yields {number} The current byte cursor within the input buffer.
|
|
1958
2527
|
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
1959
2528
|
*/
|
|
1960
|
-
|
|
2529
|
+
*parseDataBlockIncremental(input2) {
|
|
1961
2530
|
const indexResult = { elements: [] };
|
|
1962
2531
|
const match = input2.match;
|
|
1963
2532
|
const comment = () => match(commentParser2);
|
|
@@ -2093,7 +2662,11 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2093
2662
|
});
|
|
2094
2663
|
}
|
|
2095
2664
|
};
|
|
2665
|
+
let parsedElementCount = 0;
|
|
2096
2666
|
while (input2.unfinished) {
|
|
2667
|
+
if ((++parsedElementCount & PARSE_PROGRESS_ELEMENT_MASK) === 0) {
|
|
2668
|
+
yield input2.cursor;
|
|
2669
|
+
}
|
|
2097
2670
|
if (!charws(HASH2)) {
|
|
2098
2671
|
if (tokenws(END_SECTION)) {
|
|
2099
2672
|
return parseResult2(ParseResult.COMPLETE);
|
|
@@ -4417,6 +4990,7 @@ var StepModelBase = class {
|
|
|
4417
4990
|
invalidate(dropVtable = false) {
|
|
4418
4991
|
if (dropVtable) {
|
|
4419
4992
|
this.vtableBuilder_.clear(true);
|
|
4993
|
+
releaseScratchParsingBuffer();
|
|
4420
4994
|
this.descriptorCache_ = [];
|
|
4421
4995
|
if (this.complexEntries_ !== void 0) {
|
|
4422
4996
|
for (const item of this.complexEntries_.values()) {
|
|
@@ -4815,6 +5389,20 @@ var StepModelBase = class {
|
|
|
4815
5389
|
const distinctTypes = types.length === 1 ? types[0].query : new Set(types.flatMap((type) => type.query));
|
|
4816
5390
|
return this.from(this.typeIndex.cursor(...distinctTypes), true);
|
|
4817
5391
|
}
|
|
5392
|
+
/**
|
|
5393
|
+
* Count entities of a set of types (including sub-types) without iterating
|
|
5394
|
+
* or materializing them — reads the type index's prefix sums, so it's cheap
|
|
5395
|
+
* enough to call up front for progress totals (see core/progress.ts).
|
|
5396
|
+
* Multi-mapped elements can be counted once per matching mapping, so treat
|
|
5397
|
+
* this as an upper bound; see MultiIndexSet.count.
|
|
5398
|
+
*
|
|
5399
|
+
* @param types The list of types to count.
|
|
5400
|
+
* @return {number} The number of matching entities.
|
|
5401
|
+
*/
|
|
5402
|
+
typeCount(...types) {
|
|
5403
|
+
const distinctTypes = types.length === 1 ? types[0].query : new Set(types.flatMap((type) => type.query));
|
|
5404
|
+
return this.typeIndex.count(...distinctTypes);
|
|
5405
|
+
}
|
|
4818
5406
|
/**
|
|
4819
5407
|
* Get the non empty type IDs for this.
|
|
4820
5408
|
*
|
|
@@ -69264,6 +69852,12 @@ var SingleIndexSetCursor = class _SingleIndexSetCursor {
|
|
|
69264
69852
|
};
|
|
69265
69853
|
|
|
69266
69854
|
// compiled/src/indexing/multi_index_set.js
|
|
69855
|
+
function popCount32(value) {
|
|
69856
|
+
let result = value - (value >> 1 & 1431655765);
|
|
69857
|
+
result = (result & 858993459) + (result >> 2 & 858993459);
|
|
69858
|
+
result = result + (result >> 4) & 252645135;
|
|
69859
|
+
return result * 16843009 >> 24;
|
|
69860
|
+
}
|
|
69267
69861
|
var MultiIndexSet = class {
|
|
69268
69862
|
/**
|
|
69269
69863
|
* Construct this with a prefix sum table and matching elements table.
|
|
@@ -69309,6 +69903,34 @@ var MultiIndexSet = class {
|
|
|
69309
69903
|
const indexEnd = prefixSum[indexType + 1] * 2;
|
|
69310
69904
|
return indexSetPointQuery32(localID, this.elements_, indexOffset, indexEnd);
|
|
69311
69905
|
}
|
|
69906
|
+
/**
|
|
69907
|
+
* Count of items for a set of types without materializing entities —
|
|
69908
|
+
* popcounts the packed one-hot blocks per type (the prefix sums index
|
|
69909
|
+
* 32-element blocks, not items), so it's O(blocks), thousands of times
|
|
69910
|
+
* cheaper than iterating a cursor. Per-type ranges are disjoint, but an
|
|
69911
|
+
* element multi-mapped under several of the queried types counts once per
|
|
69912
|
+
* mapping (matching what a cursor union would visit), so treat multi-type
|
|
69913
|
+
* counts as an upper bound (fine for progress totals, its motivating use).
|
|
69914
|
+
*
|
|
69915
|
+
* @param indexTypes The list of types to count.
|
|
69916
|
+
* @return {number} The summed count for the given types.
|
|
69917
|
+
*/
|
|
69918
|
+
count(...indexTypes) {
|
|
69919
|
+
const prefixSum = this.prefixSumTable_;
|
|
69920
|
+
const elements = this.elements_;
|
|
69921
|
+
let result = 0;
|
|
69922
|
+
for (const indexType of indexTypes) {
|
|
69923
|
+
if (indexType >= prefixSum.length - 1) {
|
|
69924
|
+
continue;
|
|
69925
|
+
}
|
|
69926
|
+
const blockStart = prefixSum[indexType] * 2;
|
|
69927
|
+
const blockEnd = prefixSum[indexType + 1] * 2;
|
|
69928
|
+
for (let where = blockStart; where < blockEnd; where += 2) {
|
|
69929
|
+
result += popCount32(elements[where + 1]);
|
|
69930
|
+
}
|
|
69931
|
+
}
|
|
69932
|
+
return result;
|
|
69933
|
+
}
|
|
69312
69934
|
/**
|
|
69313
69935
|
* Get a cursor that lets you iterate over the union of the sets of multiple indices.
|
|
69314
69936
|
*
|
|
@@ -69406,18 +70028,6 @@ var CanonicalMeshType;
|
|
|
69406
70028
|
CanonicalMeshType2[CanonicalMeshType2["BUFFER_GEOMETRY"] = 0] = "BUFFER_GEOMETRY";
|
|
69407
70029
|
})(CanonicalMeshType || (CanonicalMeshType = {}));
|
|
69408
70030
|
|
|
69409
|
-
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
69410
|
-
var wasmType = "";
|
|
69411
|
-
var dynamicImport = new Function("module", "return import(module)");
|
|
69412
|
-
|
|
69413
|
-
// compiled/dependencies/conway-geom/interface/material_object.js
|
|
69414
|
-
var BlendMode;
|
|
69415
|
-
(function(BlendMode2) {
|
|
69416
|
-
BlendMode2[BlendMode2["OPAQUE"] = 0] = "OPAQUE";
|
|
69417
|
-
BlendMode2[BlendMode2["BLEND"] = 1] = "BLEND";
|
|
69418
|
-
BlendMode2[BlendMode2["MASK"] = 2] = "MASK";
|
|
69419
|
-
})(BlendMode || (BlendMode = {}));
|
|
69420
|
-
|
|
69421
70031
|
// compiled/src/core/canonical_material.js
|
|
69422
70032
|
var ROUGNESS_CONVERSION_FACTOR = 2;
|
|
69423
70033
|
function roughnessToExponent(roughness) {
|
|
@@ -70030,403 +70640,30 @@ var IfcStepParser = class extends StepParser {
|
|
|
70030
70640
|
* Parse data to the model
|
|
70031
70641
|
*
|
|
70032
70642
|
* @param input The parsing buffer, set to user data, to read.
|
|
70643
|
+
* @param onProgress Optional byte-cursor progress callback for the data parse.
|
|
70033
70644
|
* @return {[ParseResult, IfcStepModel | undefined]} The parse result as well as the model,
|
|
70034
70645
|
* if it can be extracted.
|
|
70035
70646
|
*/
|
|
70036
|
-
parseDataToModel(input2) {
|
|
70037
|
-
const [itemIndex, parseResult2] = this.parseDataBlock(input2);
|
|
70647
|
+
parseDataToModel(input2, onProgress) {
|
|
70648
|
+
const [itemIndex, parseResult2] = this.parseDataBlock(input2, onProgress);
|
|
70038
70649
|
return [parseResult2, new IfcStepModel(input2.buffer, itemIndex.elements)];
|
|
70039
70650
|
}
|
|
70040
|
-
};
|
|
70041
|
-
IfcStepParser.Instance = new IfcStepParser();
|
|
70042
|
-
var ifc_step_parser_default = IfcStepParser;
|
|
70043
|
-
|
|
70044
|
-
// compiled/src/version/version.js
|
|
70045
|
-
var versionString = "Conway Web-Ifc Shim v1.375.1183";
|
|
70046
|
-
|
|
70047
|
-
// compiled/src/statistics/statistics.js
|
|
70048
|
-
var Statistics = class {
|
|
70049
|
-
// Getters and setters
|
|
70050
|
-
/**
|
|
70051
|
-
*
|
|
70052
|
-
* @return {string | undefined} - load status or undefined
|
|
70053
|
-
*/
|
|
70054
|
-
getLoadStatus() {
|
|
70055
|
-
return this.loadStatus;
|
|
70056
|
-
}
|
|
70057
|
-
/**
|
|
70058
|
-
*
|
|
70059
|
-
* @param value - load status
|
|
70060
|
-
*/
|
|
70061
|
-
setLoadStatus(value) {
|
|
70062
|
-
this.loadStatus = value;
|
|
70063
|
-
}
|
|
70064
|
-
/**
|
|
70065
|
-
*
|
|
70066
|
-
* @return {string | undefined} - project name or undefined
|
|
70067
|
-
*/
|
|
70068
|
-
getProjectName() {
|
|
70069
|
-
return this.projectName;
|
|
70070
|
-
}
|
|
70071
|
-
/**
|
|
70072
|
-
*
|
|
70073
|
-
* @param value - project name
|
|
70074
|
-
*/
|
|
70075
|
-
setProjectName(value) {
|
|
70076
|
-
this.projectName = value;
|
|
70077
|
-
}
|
|
70078
|
-
/**
|
|
70079
|
-
*
|
|
70080
|
-
* @return {string | undefined} - version or undefined
|
|
70081
|
-
*/
|
|
70082
|
-
getVersion() {
|
|
70083
|
-
return this.version;
|
|
70084
|
-
}
|
|
70085
|
-
/**
|
|
70086
|
-
*
|
|
70087
|
-
* @param value - version
|
|
70088
|
-
*/
|
|
70089
|
-
setVersion(value) {
|
|
70090
|
-
this.version = value;
|
|
70091
|
-
}
|
|
70092
|
-
/**
|
|
70093
|
-
*
|
|
70094
|
-
* @return {number | undefined} - parse time or undefined
|
|
70095
|
-
*/
|
|
70096
|
-
getParseTime() {
|
|
70097
|
-
return this.parseTime;
|
|
70098
|
-
}
|
|
70099
|
-
/**
|
|
70100
|
-
*
|
|
70101
|
-
* @param value - parse time
|
|
70102
|
-
*/
|
|
70103
|
-
setParseTime(value) {
|
|
70104
|
-
this.parseTime = value;
|
|
70105
|
-
}
|
|
70106
|
-
/**
|
|
70107
|
-
*
|
|
70108
|
-
* @return {number | undefined} - geometry parse time or undefined
|
|
70109
|
-
*/
|
|
70110
|
-
getGeometryTime() {
|
|
70111
|
-
return this.geometryTime;
|
|
70112
|
-
}
|
|
70113
|
-
/**
|
|
70114
|
-
*
|
|
70115
|
-
* @param value - geometry parse time
|
|
70116
|
-
*/
|
|
70117
|
-
setGeometryTime(value) {
|
|
70118
|
-
this.geometryTime = value;
|
|
70119
|
-
}
|
|
70120
|
-
/**
|
|
70121
|
-
*
|
|
70122
|
-
* @return {number | undefined} - total execution time or undefined
|
|
70123
|
-
*/
|
|
70124
|
-
getTotalTime() {
|
|
70125
|
-
return this.totalTime;
|
|
70126
|
-
}
|
|
70127
|
-
/**
|
|
70128
|
-
*
|
|
70129
|
-
* @param value - total execution time
|
|
70130
|
-
*/
|
|
70131
|
-
setTotalTime(value) {
|
|
70132
|
-
this.totalTime = value;
|
|
70133
|
-
}
|
|
70134
|
-
/**
|
|
70135
|
-
*
|
|
70136
|
-
* @return {number | undefined} - geometry memory or undefined
|
|
70137
|
-
*/
|
|
70138
|
-
getGeometryMemory() {
|
|
70139
|
-
return this.geometryMemory;
|
|
70140
|
-
}
|
|
70141
|
-
/**
|
|
70142
|
-
*
|
|
70143
|
-
* @param value - geometry memory
|
|
70144
|
-
*/
|
|
70145
|
-
setGeometryMemory(value) {
|
|
70146
|
-
this.geometryMemory = value;
|
|
70147
|
-
}
|
|
70148
|
-
/**
|
|
70149
|
-
*
|
|
70150
|
-
* @return {string | undefined} - preprocessor version or undefined
|
|
70151
|
-
*/
|
|
70152
|
-
getPreprocessorVersion() {
|
|
70153
|
-
return this.preprocessorVersion;
|
|
70154
|
-
}
|
|
70155
|
-
/**
|
|
70156
|
-
*
|
|
70157
|
-
* @param value - preprocessor version
|
|
70158
|
-
*/
|
|
70159
|
-
setPreprocessorVersion(value) {
|
|
70160
|
-
this.preprocessorVersion = value;
|
|
70161
|
-
}
|
|
70162
|
-
/**
|
|
70163
|
-
*
|
|
70164
|
-
* @return {string | undefined} - originating system or undefined
|
|
70165
|
-
*/
|
|
70166
|
-
getOriginatingSystem() {
|
|
70167
|
-
return this.originatingSystem;
|
|
70168
|
-
}
|
|
70169
|
-
/**
|
|
70170
|
-
*
|
|
70171
|
-
* @param value - originating system
|
|
70172
|
-
*/
|
|
70173
|
-
setOriginatingSystem(value) {
|
|
70174
|
-
this.originatingSystem = value;
|
|
70175
|
-
}
|
|
70176
|
-
/**
|
|
70177
|
-
*
|
|
70178
|
-
* @return {string | undefined} - memory statistics or undefined
|
|
70179
|
-
*/
|
|
70180
|
-
getMemoryStatistics() {
|
|
70181
|
-
return this.memoryStatistics;
|
|
70182
|
-
}
|
|
70183
|
-
/**
|
|
70184
|
-
*
|
|
70185
|
-
* @param value - memory statistics
|
|
70186
|
-
*/
|
|
70187
|
-
setMemoryStatistics(value) {
|
|
70188
|
-
this.memoryStatistics = value;
|
|
70189
|
-
}
|
|
70190
|
-
/**
|
|
70191
|
-
* prints statistics
|
|
70192
|
-
*/
|
|
70193
|
-
printStatistics() {
|
|
70194
|
-
const date = /* @__PURE__ */ new Date();
|
|
70195
|
-
const options = {
|
|
70196
|
-
year: "numeric",
|
|
70197
|
-
month: "short",
|
|
70198
|
-
day: "numeric",
|
|
70199
|
-
hour: "2-digit",
|
|
70200
|
-
minute: "2-digit",
|
|
70201
|
-
second: "2-digit",
|
|
70202
|
-
timeZone: "UTC"
|
|
70203
|
-
};
|
|
70204
|
-
const dateString = date.toLocaleDateString("en-US", options).replace(/,/g, "");
|
|
70205
|
-
const versionMatch = versionString.match(/v(\d+\.\d+\.\d+)/);
|
|
70206
|
-
let conwayVersionNumber;
|
|
70207
|
-
if (versionMatch !== null) {
|
|
70208
|
-
conwayVersionNumber = versionMatch[1];
|
|
70209
|
-
} else {
|
|
70210
|
-
conwayVersionNumber = "Version Not Found";
|
|
70211
|
-
}
|
|
70212
|
-
let versionStr;
|
|
70213
|
-
if (this.version !== void 0) {
|
|
70214
|
-
const match = this.version.match(/'([^']+)'/);
|
|
70215
|
-
if (match) {
|
|
70216
|
-
versionStr = match[1];
|
|
70217
|
-
} else {
|
|
70218
|
-
versionStr = "No match found";
|
|
70219
|
-
}
|
|
70220
|
-
} else {
|
|
70221
|
-
versionStr = "Version not defined";
|
|
70222
|
-
}
|
|
70223
|
-
console.log(`[${dateString}]: Load Status: ${this.loadStatus}, Project Name: ${this.projectName}, Version: ${versionStr}, Conway Version: ${conwayVersionNumber}-${wasmType}, Parse Time: ${this.parseTime} ms, Geometry Time: ${this.geometryTime} ms, Total Time: ${this.totalTime} ms, Geometry Memory: ${this.geometryMemory?.toFixed(3)} MB, Memory Statistics: ${this.memoryStatistics}, Preprocessor Version: ${this.preprocessorVersion}, Originating System: ${this.originatingSystem}`);
|
|
70224
|
-
}
|
|
70225
|
-
};
|
|
70226
|
-
|
|
70227
|
-
// compiled/src/utilities/environment.js
|
|
70228
|
-
var EnvironmentType;
|
|
70229
|
-
(function(EnvironmentType2) {
|
|
70230
|
-
EnvironmentType2[EnvironmentType2["BROWSER"] = 0] = "BROWSER";
|
|
70231
|
-
EnvironmentType2[EnvironmentType2["NODE"] = 1] = "NODE";
|
|
70232
|
-
EnvironmentType2[EnvironmentType2["BOTH_FEATURES"] = 2] = "BOTH_FEATURES";
|
|
70233
|
-
EnvironmentType2[EnvironmentType2["UNKNOWN"] = 3] = "UNKNOWN";
|
|
70234
|
-
})(EnvironmentType || (EnvironmentType = {}));
|
|
70235
|
-
var Environment = class {
|
|
70236
|
-
/**
|
|
70237
|
-
* determines the runtime environment
|
|
70238
|
-
*/
|
|
70239
|
-
static checkEnvironment() {
|
|
70240
|
-
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
70241
|
-
const isNode = typeof global !== "undefined" && typeof global.process !== "undefined" && global.process.versions && global.process.versions.node;
|
|
70242
|
-
if (isBrowser && isNode) {
|
|
70243
|
-
logger_default.info("This environment has features of both Node.js and a web browser.");
|
|
70244
|
-
this.environmentType = EnvironmentType.BOTH_FEATURES;
|
|
70245
|
-
} else if (isNode) {
|
|
70246
|
-
this.environmentType = EnvironmentType.NODE;
|
|
70247
|
-
} else if (isBrowser) {
|
|
70248
|
-
this.environmentType = EnvironmentType.BROWSER;
|
|
70249
|
-
} else {
|
|
70250
|
-
logger_default.info("ENVIRONMENT === unknown");
|
|
70251
|
-
this.environmentType = EnvironmentType.UNKNOWN;
|
|
70252
|
-
}
|
|
70253
|
-
}
|
|
70254
|
-
};
|
|
70255
|
-
Environment.environmentType = EnvironmentType.UNKNOWN;
|
|
70256
|
-
var environment_default = Environment;
|
|
70257
|
-
|
|
70258
|
-
// compiled/src/logging/logger.js
|
|
70259
|
-
var Logger = class _Logger {
|
|
70260
|
-
/**
|
|
70261
|
-
* Detects environment and initializes wasm callbacks
|
|
70262
|
-
*/
|
|
70263
|
-
static initializeWasmCallbacks() {
|
|
70264
|
-
const environment = environment_default.environmentType;
|
|
70265
|
-
if (environment === EnvironmentType.BROWSER) {
|
|
70266
|
-
const globalScope = window;
|
|
70267
|
-
globalScope.logInfo = _Logger.info;
|
|
70268
|
-
globalScope.logWarning = _Logger.warning;
|
|
70269
|
-
globalScope.logError = _Logger.error;
|
|
70270
|
-
} else if (environment === EnvironmentType.NODE || environment === EnvironmentType.BOTH_FEATURES) {
|
|
70271
|
-
const globalScope = global;
|
|
70272
|
-
globalScope.logInfo = _Logger.info;
|
|
70273
|
-
globalScope.logWarning = _Logger.warning;
|
|
70274
|
-
globalScope.logError = _Logger.error;
|
|
70275
|
-
}
|
|
70276
|
-
}
|
|
70277
|
-
/**
|
|
70278
|
-
*
|
|
70279
|
-
* @param message - log message
|
|
70280
|
-
* @param level - log level
|
|
70281
|
-
* @return {number} log index
|
|
70282
|
-
*/
|
|
70283
|
-
static findLogIndex(message, level) {
|
|
70284
|
-
return _Logger.logs.findIndex((log) => log.message === message && log.level === level);
|
|
70285
|
-
}
|
|
70286
|
-
/**
|
|
70287
|
-
*
|
|
70288
|
-
* @param level - log level
|
|
70289
|
-
* @param message - log message
|
|
70290
|
-
*/
|
|
70291
|
-
static log(level, message) {
|
|
70292
|
-
const baseMessage = message.split(" expressID: ")[0];
|
|
70293
|
-
const data = message.split(" expressID: ")[1];
|
|
70294
|
-
const index = _Logger.findLogIndex(baseMessage, level);
|
|
70295
|
-
let logEntry;
|
|
70296
|
-
if (index >= 0) {
|
|
70297
|
-
_Logger.logs[index].count += 1;
|
|
70298
|
-
if (data !== void 0) {
|
|
70299
|
-
_Logger.logs[index].expressIDs = _Logger.logs[index].expressIDs || /* @__PURE__ */ new Set();
|
|
70300
|
-
_Logger.logs[index].expressIDs.add(data);
|
|
70301
|
-
}
|
|
70302
|
-
logEntry = _Logger.logs[index];
|
|
70303
|
-
} else {
|
|
70304
|
-
logEntry = {
|
|
70305
|
-
level,
|
|
70306
|
-
message: baseMessage,
|
|
70307
|
-
count: 1,
|
|
70308
|
-
expressIDs: data ? /* @__PURE__ */ new Set([data]) : /* @__PURE__ */ new Set()
|
|
70309
|
-
};
|
|
70310
|
-
_Logger.logs.push(logEntry);
|
|
70311
|
-
}
|
|
70312
|
-
_Logger.proxies.forEach((proxy) => proxy.log(logEntry));
|
|
70313
|
-
}
|
|
70314
|
-
/**
|
|
70315
|
-
* Compresses similar logs to a single line
|
|
70316
|
-
*/
|
|
70317
|
-
static compressLogs() {
|
|
70318
|
-
const compressedLogs = [];
|
|
70319
|
-
_Logger.logs.forEach((log) => {
|
|
70320
|
-
const existingLog = compressedLogs.find((l) => l.message === log.message && l.level === log.level);
|
|
70321
|
-
if (existingLog !== void 0) {
|
|
70322
|
-
existingLog.count += log.count;
|
|
70323
|
-
if (log.expressIDs !== void 0) {
|
|
70324
|
-
log.expressIDs.forEach((d) => existingLog.expressIDs?.add(d));
|
|
70325
|
-
}
|
|
70326
|
-
} else {
|
|
70327
|
-
compressedLogs.push({
|
|
70328
|
-
...log,
|
|
70329
|
-
expressIDs: log.expressIDs ? new Set(log.expressIDs) : /* @__PURE__ */ new Set()
|
|
70330
|
-
});
|
|
70331
|
-
}
|
|
70332
|
-
});
|
|
70333
|
-
_Logger.logs = compressedLogs;
|
|
70334
|
-
}
|
|
70335
|
-
/**
|
|
70336
|
-
*
|
|
70337
|
-
* @param proxy - a log proxy
|
|
70338
|
-
*/
|
|
70339
|
-
static addProxy(proxy) {
|
|
70340
|
-
_Logger.proxies.push(proxy);
|
|
70341
|
-
}
|
|
70342
|
-
/**
|
|
70343
|
-
*
|
|
70344
|
-
* @param message - log message
|
|
70345
|
-
*/
|
|
70346
|
-
static info(message) {
|
|
70347
|
-
_Logger.log("info", message);
|
|
70348
|
-
}
|
|
70349
|
-
/**
|
|
70350
|
-
*
|
|
70351
|
-
* @param modelID
|
|
70352
|
-
* @return {Statistics | undefined}
|
|
70353
|
-
*/
|
|
70354
|
-
static getStatistics(modelID) {
|
|
70355
|
-
return this.statistics.get(modelID);
|
|
70356
|
-
}
|
|
70357
|
-
/**
|
|
70358
|
-
* Create the statistics for a model ID.
|
|
70359
|
-
*
|
|
70360
|
-
* @param modelID The model ID to create statistics for
|
|
70361
|
-
*
|
|
70362
|
-
* @return {Statistics} The created statistics object.
|
|
70363
|
-
*/
|
|
70364
|
-
static createStatistics(modelID) {
|
|
70365
|
-
const statistics = new Statistics();
|
|
70366
|
-
this.statistics.set(modelID, statistics);
|
|
70367
|
-
return statistics;
|
|
70368
|
-
}
|
|
70369
|
-
/**
|
|
70370
|
-
*
|
|
70371
|
-
* @param modelID
|
|
70372
|
-
*/
|
|
70373
|
-
static printStatistics(modelID) {
|
|
70374
|
-
const statistics_ = this.statistics.get(modelID);
|
|
70375
|
-
if (statistics_ !== void 0) {
|
|
70376
|
-
statistics_.printStatistics();
|
|
70377
|
-
} else {
|
|
70378
|
-
_Logger.error(`No statistics for modelID: ${modelID}`);
|
|
70379
|
-
}
|
|
70380
|
-
}
|
|
70381
|
-
/**
|
|
70382
|
-
* Compresses the logs if they haven't been compressed,
|
|
70383
|
-
* then returns a list of just the errors.
|
|
70384
|
-
*
|
|
70385
|
-
* @return {LogEntry[]} The errors.
|
|
70386
|
-
*/
|
|
70387
|
-
static getErrors() {
|
|
70388
|
-
_Logger.compressLogs();
|
|
70389
|
-
return this.logs.filter((where) => where.level === "error");
|
|
70390
|
-
}
|
|
70391
70651
|
/**
|
|
70652
|
+
* Cooperative variant of parseDataToModel — periodically yields to the
|
|
70653
|
+
* event loop mid-parse (see StepParser.parseDataBlockAsync, issue #301 §2).
|
|
70392
70654
|
*
|
|
70393
|
-
* @param
|
|
70394
|
-
|
|
70395
|
-
|
|
70396
|
-
|
|
70397
|
-
}
|
|
70398
|
-
/**
|
|
70399
|
-
*
|
|
70400
|
-
* @param message - log message
|
|
70401
|
-
*/
|
|
70402
|
-
static error(message) {
|
|
70403
|
-
_Logger.log("error", message);
|
|
70404
|
-
}
|
|
70405
|
-
/**
|
|
70406
|
-
*
|
|
70407
|
-
* @return {LogEntry[]} - list of logs
|
|
70408
|
-
*/
|
|
70409
|
-
static getLogs() {
|
|
70410
|
-
return _Logger.logs;
|
|
70411
|
-
}
|
|
70412
|
-
/**
|
|
70413
|
-
* display logs in a table
|
|
70414
|
-
*/
|
|
70415
|
-
static displayLogs() {
|
|
70416
|
-
_Logger.compressLogs();
|
|
70417
|
-
console.table(_Logger.logs);
|
|
70418
|
-
}
|
|
70419
|
-
/**
|
|
70420
|
-
* clear logs
|
|
70655
|
+
* @param input The parsing buffer, set to user data, to read.
|
|
70656
|
+
* @param onProgress Optional byte-cursor progress callback for the data parse.
|
|
70657
|
+
* @return {Promise<[ParseResult, IfcStepModel | undefined]>} The parse result as well
|
|
70658
|
+
* as the model, if it can be extracted.
|
|
70421
70659
|
*/
|
|
70422
|
-
|
|
70423
|
-
|
|
70660
|
+
async parseDataToModelAsync(input2, onProgress) {
|
|
70661
|
+
const [itemIndex, parseResult2] = await this.parseDataBlockAsync(input2, onProgress);
|
|
70662
|
+
return [parseResult2, new IfcStepModel(input2.buffer, itemIndex.elements)];
|
|
70424
70663
|
}
|
|
70425
70664
|
};
|
|
70426
|
-
|
|
70427
|
-
|
|
70428
|
-
Logger.statistics = /* @__PURE__ */ new Map();
|
|
70429
|
-
var logger_default = Logger;
|
|
70665
|
+
IfcStepParser.Instance = new IfcStepParser();
|
|
70666
|
+
var ifc_step_parser_default = IfcStepParser;
|
|
70430
70667
|
|
|
70431
70668
|
// compiled/examples/browser.js
|
|
70432
70669
|
environment_default.checkEnvironment();
|