@bldrs-ai/conway 1.512.1444 → 1.514.1452
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 +247 -18
- package/compiled/examples/cli-bundled.cjs +366 -49
- package/compiled/examples/cli-step-bundled.cjs +247 -18
- package/compiled/examples/validator-bundled.cjs +247 -18
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +9 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +21 -5
- 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 +154 -39
- package/compiled/src/compat/web-ifc/spatial_imposter.d.ts +58 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.js +522 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.js +53 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.d.ts +89 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.js +333 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.js +78 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +19 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/streamed_preview_channel.js +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +20 -2
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +137 -33
- package/compiled/src/ifc/ifc_stream_open.test.js +107 -0
- package/compiled/src/step/parsing/step_parser.d.ts +1 -1
- package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_parser.js +5 -1
- package/compiled/src/step/parsing/streaming_index_builder.d.ts +2 -2
- package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -1
- package/compiled/src/step/step_entity_base.d.ts.map +1 -1
- package/compiled/src/step/step_entity_base.js +8 -0
- package/compiled/src/step/step_model_base.d.ts +84 -1
- package/compiled/src/step/step_model_base.d.ts.map +1 -1
- package/compiled/src/step/step_model_base.js +251 -15
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ var import_node_process = require("node:process");
|
|
|
30
30
|
var readline = __toESM(require("node:readline"), 1);
|
|
31
31
|
|
|
32
32
|
// compiled/src/version/version.js
|
|
33
|
-
var versionString = "Conway v1.
|
|
33
|
+
var versionString = "Conway v1.514.1452";
|
|
34
34
|
|
|
35
35
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
36
36
|
var wasmType = "";
|
|
@@ -2678,7 +2678,10 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2678
2678
|
await next.value;
|
|
2679
2679
|
continue;
|
|
2680
2680
|
}
|
|
2681
|
-
onProgress?.(next.value);
|
|
2681
|
+
const progressed = onProgress?.(next.value);
|
|
2682
|
+
if (progressed !== void 0 && typeof progressed.then === "function") {
|
|
2683
|
+
await progressed;
|
|
2684
|
+
}
|
|
2682
2685
|
if (Date.now() - lastYield >= yieldIntervalMs) {
|
|
2683
2686
|
await yieldToEventLoop();
|
|
2684
2687
|
lastYield = Date.now();
|
|
@@ -5288,7 +5291,7 @@ var InterpolationSearchTable32 = class {
|
|
|
5288
5291
|
};
|
|
5289
5292
|
|
|
5290
5293
|
// compiled/src/step/step_model_base.js
|
|
5291
|
-
var StepModelBase = class {
|
|
5294
|
+
var StepModelBase = class _StepModelBase {
|
|
5292
5295
|
/**
|
|
5293
5296
|
* Construct this step model with its matching schema, a buffer to read from and an element index.
|
|
5294
5297
|
*
|
|
@@ -5538,6 +5541,9 @@ var StepModelBase = class {
|
|
|
5538
5541
|
if (element.vtableIndex === void 0 && !this.populateVtableEntryRaw(element)) {
|
|
5539
5542
|
return void 0;
|
|
5540
5543
|
}
|
|
5544
|
+
if (element.buffer === void 0) {
|
|
5545
|
+
this.populateBufferEntry(localID);
|
|
5546
|
+
}
|
|
5541
5547
|
const vtable = element.vtable;
|
|
5542
5548
|
const buffer = element.buffer;
|
|
5543
5549
|
if (vtable === void 0 || buffer === void 0 || offset >= (element.vtableCount ?? 0)) {
|
|
@@ -5607,6 +5613,11 @@ var StepModelBase = class {
|
|
|
5607
5613
|
}
|
|
5608
5614
|
const element = this.entry(localID);
|
|
5609
5615
|
element.buffer = this.bufferProvider_.acquire(element.address, element.length).buffer;
|
|
5616
|
+
if (element.multiMapping !== void 0) {
|
|
5617
|
+
for (const mapped of element.multiMapping) {
|
|
5618
|
+
mapped.buffer = this.bufferProvider_.acquire(mapped.address, mapped.length).buffer;
|
|
5619
|
+
}
|
|
5620
|
+
}
|
|
5610
5621
|
}
|
|
5611
5622
|
/**
|
|
5612
5623
|
* Get the size in bytes of the backing buffer for this.
|
|
@@ -5634,6 +5645,74 @@ var StepModelBase = class {
|
|
|
5634
5645
|
get residentSourceBytes() {
|
|
5635
5646
|
return this.bufferProvider_.residentBytes;
|
|
5636
5647
|
}
|
|
5648
|
+
/**
|
|
5649
|
+
* Column type of a record, or `undefined` if the id is unknown / untyped.
|
|
5650
|
+
*
|
|
5651
|
+
* @param localID The record.
|
|
5652
|
+
* @return {number | undefined} The schema type id.
|
|
5653
|
+
*/
|
|
5654
|
+
typeIDOf(localID) {
|
|
5655
|
+
if (localID >= this.count_) {
|
|
5656
|
+
return;
|
|
5657
|
+
}
|
|
5658
|
+
const typeID = this.typeID_[localID];
|
|
5659
|
+
return typeID < 0 ? void 0 : typeID;
|
|
5660
|
+
}
|
|
5661
|
+
/**
|
|
5662
|
+
* Absolute source address of a record.
|
|
5663
|
+
*
|
|
5664
|
+
* @param localID The record.
|
|
5665
|
+
* @return {number | undefined} The address.
|
|
5666
|
+
*/
|
|
5667
|
+
recordAddress(localID) {
|
|
5668
|
+
return localID < this.count_ ? this.address_[localID] : void 0;
|
|
5669
|
+
}
|
|
5670
|
+
/**
|
|
5671
|
+
* Source length of a record.
|
|
5672
|
+
*
|
|
5673
|
+
* @param localID The record.
|
|
5674
|
+
* @return {number | undefined} The length.
|
|
5675
|
+
*/
|
|
5676
|
+
recordLength(localID) {
|
|
5677
|
+
return localID < this.count_ ? this.length_[localID] : void 0;
|
|
5678
|
+
}
|
|
5679
|
+
/**
|
|
5680
|
+
* Pin an arbitrary source span (e.g. a faceset's packed Faces[] run).
|
|
5681
|
+
*
|
|
5682
|
+
* @param address Absolute start.
|
|
5683
|
+
* @param length Length in bytes.
|
|
5684
|
+
*/
|
|
5685
|
+
pinAddressRange(address, length) {
|
|
5686
|
+
if (!this.isSourceExternal) {
|
|
5687
|
+
return;
|
|
5688
|
+
}
|
|
5689
|
+
this.bufferProvider_.pinRange?.(address, length);
|
|
5690
|
+
}
|
|
5691
|
+
/**
|
|
5692
|
+
* Drop one {@link pinAddressRange} hold.
|
|
5693
|
+
*
|
|
5694
|
+
* @param address Absolute start.
|
|
5695
|
+
* @param length Length in bytes.
|
|
5696
|
+
*/
|
|
5697
|
+
unpinAddressRange(address, length) {
|
|
5698
|
+
if (!this.isSourceExternal) {
|
|
5699
|
+
return;
|
|
5700
|
+
}
|
|
5701
|
+
this.bufferProvider_.unpinRange?.(address, length);
|
|
5702
|
+
}
|
|
5703
|
+
/**
|
|
5704
|
+
* Page an arbitrary source span.
|
|
5705
|
+
*
|
|
5706
|
+
* @param address Absolute start.
|
|
5707
|
+
* @param length Length in bytes.
|
|
5708
|
+
* @return {Promise<void>} Resolves when resident.
|
|
5709
|
+
*/
|
|
5710
|
+
async ensureResidentRange(address, length) {
|
|
5711
|
+
if (!this.isSourceExternal) {
|
|
5712
|
+
return;
|
|
5713
|
+
}
|
|
5714
|
+
await this.bufferProvider_.ensureResident(address, length);
|
|
5715
|
+
}
|
|
5637
5716
|
/**
|
|
5638
5717
|
* Release the resident source buffer and serve subsequent record
|
|
5639
5718
|
* reads from fixed-size windows paged in from an external store.
|
|
@@ -5721,32 +5800,80 @@ var StepModelBase = class {
|
|
|
5721
5800
|
* @param localID Seed record.
|
|
5722
5801
|
* @param extraLocalIDs Additional seeds (voids, styles, materials).
|
|
5723
5802
|
* @param seen Optional set to extend (also skips already-pinned IDs).
|
|
5803
|
+
* @param descend If set, records for which this returns false are
|
|
5804
|
+
* still visited (pinned, in `seen`) but their `#refs` are not
|
|
5805
|
+
* followed — e.g. an `IfcPolygonalFaceSet` whose Faces[] payload
|
|
5806
|
+
* is paged as one span afterwards.
|
|
5807
|
+
* @param leafSpans Optional out-array of coalesced pin ranges for
|
|
5808
|
+
* {@link spanLeaf} children — caller must {@link unpinAddressRange}
|
|
5809
|
+
* each.
|
|
5810
|
+
* @param spanLeaf If set, matching children are *not* visited
|
|
5811
|
+
* (absent from `seen`); their bytes are one pin span. Packed
|
|
5812
|
+
* extract reads `IfcIndexedPolygonalFace.CoordIndex` as integers —
|
|
5813
|
+
* following those faces pinned ~78k records per PSB product. If
|
|
5814
|
+
* omitted, `!descend` children use this span path (test helper).
|
|
5724
5815
|
* @return {Promise<Set<number>>} The local IDs that were visited.
|
|
5725
5816
|
*/
|
|
5726
|
-
async ensureResidentClosureByLocalID(localID, extraLocalIDs, seen = /* @__PURE__ */ new Set()) {
|
|
5817
|
+
async ensureResidentClosureByLocalID(localID, extraLocalIDs, seen = /* @__PURE__ */ new Set(), descend, leafSpans, spanLeaf) {
|
|
5727
5818
|
if (!this.isSourceExternal) {
|
|
5728
5819
|
return seen;
|
|
5729
5820
|
}
|
|
5730
|
-
const
|
|
5821
|
+
const frontier = [];
|
|
5822
|
+
const enqueue = (id) => {
|
|
5823
|
+
if (id < this.count_ && !seen.has(id)) {
|
|
5824
|
+
frontier.push(id);
|
|
5825
|
+
}
|
|
5826
|
+
};
|
|
5827
|
+
enqueue(localID);
|
|
5731
5828
|
if (extraLocalIDs !== void 0) {
|
|
5732
5829
|
for (const extra of extraLocalIDs) {
|
|
5733
|
-
|
|
5830
|
+
enqueue(extra);
|
|
5734
5831
|
}
|
|
5735
5832
|
}
|
|
5736
|
-
while (
|
|
5737
|
-
const
|
|
5738
|
-
|
|
5739
|
-
|
|
5833
|
+
while (frontier.length > 0) {
|
|
5834
|
+
const wave = [];
|
|
5835
|
+
for (const id of frontier) {
|
|
5836
|
+
if (seen.has(id) || id >= this.count_) {
|
|
5837
|
+
continue;
|
|
5838
|
+
}
|
|
5839
|
+
seen.add(id);
|
|
5840
|
+
this.pinByLocalID(id);
|
|
5841
|
+
wave.push(id);
|
|
5842
|
+
}
|
|
5843
|
+
frontier.length = 0;
|
|
5844
|
+
if (wave.length === 0) {
|
|
5845
|
+
break;
|
|
5740
5846
|
}
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5847
|
+
await Promise.all(wave.map((id) => this.ensureResidentByLocalID(id)));
|
|
5848
|
+
const waveSpans = [];
|
|
5849
|
+
for (const id of wave) {
|
|
5850
|
+
if (descend !== void 0 && !descend(id)) {
|
|
5851
|
+
continue;
|
|
5852
|
+
}
|
|
5853
|
+
const skipped = [];
|
|
5854
|
+
for (const expressID of this.scanRecordRefs_(id)) {
|
|
5855
|
+
const referenced = this.expressIDMap_.get(expressID);
|
|
5856
|
+
if (referenced === void 0 || seen.has(referenced)) {
|
|
5857
|
+
continue;
|
|
5858
|
+
}
|
|
5859
|
+
const leaf = spanLeaf !== void 0 ? spanLeaf(referenced) : descend !== void 0 && !descend(referenced);
|
|
5860
|
+
if (leaf) {
|
|
5861
|
+
skipped.push(referenced);
|
|
5862
|
+
continue;
|
|
5863
|
+
}
|
|
5864
|
+
frontier.push(referenced);
|
|
5865
|
+
}
|
|
5866
|
+
if (skipped.length > 0) {
|
|
5867
|
+
for (const span of this.spansOf_(skipped)) {
|
|
5868
|
+
this.pinAddressRange(span.address, span.length);
|
|
5869
|
+
waveSpans.push(span);
|
|
5870
|
+
leafSpans?.push(span);
|
|
5871
|
+
}
|
|
5748
5872
|
}
|
|
5749
5873
|
}
|
|
5874
|
+
if (waveSpans.length > 0) {
|
|
5875
|
+
await Promise.all(waveSpans.map((span) => this.ensureResidentRange(span.address, span.length)));
|
|
5876
|
+
}
|
|
5750
5877
|
}
|
|
5751
5878
|
return seen;
|
|
5752
5879
|
}
|
|
@@ -5832,6 +5959,99 @@ var StepModelBase = class {
|
|
|
5832
5959
|
}
|
|
5833
5960
|
return this.ensureResidentClosureByLocalID(localID, extraLocalIDs, seen);
|
|
5834
5961
|
}
|
|
5962
|
+
/**
|
|
5963
|
+
* Source spans covering the records referenced by `expressIDs` from
|
|
5964
|
+
* `fromIndex` onward. A packed Faces[] run is consecutive in parse
|
|
5965
|
+
* order — two express-ID lookups then cover the whole range. Sparse
|
|
5966
|
+
* sets are coalesced into tight runs so intervening file is not
|
|
5967
|
+
* pinned.
|
|
5968
|
+
*
|
|
5969
|
+
* @param expressIDs Referenced express IDs (e.g. a faceset's #refs).
|
|
5970
|
+
* @param fromIndex First index to include (skip Coordinates at [0]).
|
|
5971
|
+
* @return {{address: number, length: number}[]} The spans.
|
|
5972
|
+
*/
|
|
5973
|
+
spansOfExpressIDs(expressIDs, fromIndex = 0) {
|
|
5974
|
+
let minExpressID = Infinity;
|
|
5975
|
+
let maxExpressID = 0;
|
|
5976
|
+
let count = 0;
|
|
5977
|
+
for (let i = fromIndex; i < expressIDs.length; ++i) {
|
|
5978
|
+
const expressID = expressIDs[i];
|
|
5979
|
+
if (expressID < minExpressID) {
|
|
5980
|
+
minExpressID = expressID;
|
|
5981
|
+
}
|
|
5982
|
+
if (expressID > maxExpressID) {
|
|
5983
|
+
maxExpressID = expressID;
|
|
5984
|
+
}
|
|
5985
|
+
++count;
|
|
5986
|
+
}
|
|
5987
|
+
if (count === 0 || !Number.isFinite(minExpressID)) {
|
|
5988
|
+
return [];
|
|
5989
|
+
}
|
|
5990
|
+
const minLocal = this.expressIDMap_.get(minExpressID);
|
|
5991
|
+
const maxLocal = this.expressIDMap_.get(maxExpressID);
|
|
5992
|
+
if (minLocal === void 0 || maxLocal === void 0) {
|
|
5993
|
+
return [];
|
|
5994
|
+
}
|
|
5995
|
+
const lo = Math.min(minLocal, maxLocal);
|
|
5996
|
+
const hi = Math.max(minLocal, maxLocal);
|
|
5997
|
+
if (hi - lo + 1 === count) {
|
|
5998
|
+
const address = this.address_[lo];
|
|
5999
|
+
const end = this.address_[hi] + this.length_[hi];
|
|
6000
|
+
if (end <= address) {
|
|
6001
|
+
return [];
|
|
6002
|
+
}
|
|
6003
|
+
return [{ address, length: end - address }];
|
|
6004
|
+
}
|
|
6005
|
+
const locals = [];
|
|
6006
|
+
for (let i = fromIndex; i < expressIDs.length; ++i) {
|
|
6007
|
+
const localID = this.expressIDMap_.get(expressIDs[i]);
|
|
6008
|
+
if (localID !== void 0) {
|
|
6009
|
+
locals.push(localID);
|
|
6010
|
+
}
|
|
6011
|
+
}
|
|
6012
|
+
return this.spansOf_(locals);
|
|
6013
|
+
}
|
|
6014
|
+
/**
|
|
6015
|
+
* Coalesce `localIDs` into tight source runs. Records more than
|
|
6016
|
+
* {@link LEAF_SPAN_COALESCE_GAP_} apart stay separate so a sparse
|
|
6017
|
+
* Faces[] list does not pin the file between them.
|
|
6018
|
+
*
|
|
6019
|
+
* @param localIDs The records.
|
|
6020
|
+
* @return {{address: number, length: number}[]} The spans.
|
|
6021
|
+
*/
|
|
6022
|
+
spansOf_(localIDs) {
|
|
6023
|
+
const items = [];
|
|
6024
|
+
for (const id of localIDs) {
|
|
6025
|
+
if (id >= this.count_) {
|
|
6026
|
+
continue;
|
|
6027
|
+
}
|
|
6028
|
+
items.push({
|
|
6029
|
+
address: this.address_[id],
|
|
6030
|
+
length: this.length_[id]
|
|
6031
|
+
});
|
|
6032
|
+
}
|
|
6033
|
+
items.sort((a2, b) => a2.address - b.address);
|
|
6034
|
+
const spans = [];
|
|
6035
|
+
let run;
|
|
6036
|
+
for (const item of items) {
|
|
6037
|
+
if (run === void 0) {
|
|
6038
|
+
run = { address: item.address, length: item.length };
|
|
6039
|
+
continue;
|
|
6040
|
+
}
|
|
6041
|
+
const runEnd = run.address + run.length;
|
|
6042
|
+
if (item.address <= runEnd + _StepModelBase.LEAF_SPAN_COALESCE_GAP_) {
|
|
6043
|
+
const end = Math.max(runEnd, item.address + item.length);
|
|
6044
|
+
run.length = end - run.address;
|
|
6045
|
+
continue;
|
|
6046
|
+
}
|
|
6047
|
+
spans.push(run);
|
|
6048
|
+
run = { address: item.address, length: item.length };
|
|
6049
|
+
}
|
|
6050
|
+
if (run !== void 0) {
|
|
6051
|
+
spans.push(run);
|
|
6052
|
+
}
|
|
6053
|
+
return spans;
|
|
6054
|
+
}
|
|
5835
6055
|
/**
|
|
5836
6056
|
* Express IDs referenced by a resident record (`#<id>` tokens in its
|
|
5837
6057
|
* text, including multi-mapped class records). The record itself
|
|
@@ -6256,6 +6476,8 @@ var StepModelBase = class {
|
|
|
6256
6476
|
return this.geometry?.getByLocalID(node.localID);
|
|
6257
6477
|
}
|
|
6258
6478
|
};
|
|
6479
|
+
StepModelBase.LEAF_SPAN_COALESCE_GAP_ = 1024;
|
|
6480
|
+
var step_model_base_default = StepModelBase;
|
|
6259
6481
|
|
|
6260
6482
|
// compiled/src/core/entity_field_description.js
|
|
6261
6483
|
var FieldDescriptionKind;
|
|
@@ -11265,6 +11487,7 @@ var StepEntityBase = class {
|
|
|
11265
11487
|
*/
|
|
11266
11488
|
extractParseBuffer(offset, baseOffset, depth, result, module2, optional) {
|
|
11267
11489
|
offset -= this.multiReference_ !== void 0 ? baseOffset : 0;
|
|
11490
|
+
this.guaranteeBuffer();
|
|
11268
11491
|
const internalReference = this.guaranteeVTable(depth);
|
|
11269
11492
|
if (offset >= internalReference.vtableCount) {
|
|
11270
11493
|
throw new Error("Couldn't read field due to too few fields in record");
|
|
@@ -11468,6 +11691,9 @@ var StepEntityBase = class {
|
|
|
11468
11691
|
throw new Error("Entity does not have matching table entry to read from model");
|
|
11469
11692
|
}
|
|
11470
11693
|
}
|
|
11694
|
+
if (classReference.buffer === void 0) {
|
|
11695
|
+
this.model.populateBufferEntry(this.localID);
|
|
11696
|
+
}
|
|
11471
11697
|
this.internalReference_.buffer = classReference.buffer;
|
|
11472
11698
|
return classReference;
|
|
11473
11699
|
}
|
|
@@ -11478,6 +11704,9 @@ var StepEntityBase = class {
|
|
|
11478
11704
|
throw new Error("Entity does not have matching table entry to read from model");
|
|
11479
11705
|
}
|
|
11480
11706
|
}
|
|
11707
|
+
if (internalReference.buffer === void 0) {
|
|
11708
|
+
this.guaranteeBuffer();
|
|
11709
|
+
}
|
|
11481
11710
|
return internalReference;
|
|
11482
11711
|
}
|
|
11483
11712
|
/**
|
|
@@ -71508,7 +71737,7 @@ var IfcMaterialCache = class {
|
|
|
71508
71737
|
|
|
71509
71738
|
// compiled/src/ifc/ifc_step_model.js
|
|
71510
71739
|
var indexerInstance = new StepTypeIndexer(EntityTypesIfcCount);
|
|
71511
|
-
var IfcStepModel = class extends
|
|
71740
|
+
var IfcStepModel = class extends step_model_base_default {
|
|
71512
71741
|
/**
|
|
71513
71742
|
* Construct this model given a buffer containing the data and the parsed data index on that,
|
|
71514
71743
|
* adding the typeIndex on top of that.
|