@bldrs-ai/conway 1.413.1255 → 1.417.1262

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.
Files changed (40) hide show
  1. package/compiled/examples/browser-bundled.cjs +1 -1
  2. package/compiled/examples/cli-bundled.cjs +194 -227
  3. package/compiled/examples/cli-step-bundled.cjs +1 -1
  4. package/compiled/examples/validator-bundled.cjs +1 -1
  5. package/compiled/src/compat/web-ifc/ifc_api.d.ts +20 -0
  6. package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
  7. package/compiled/src/compat/web-ifc/ifc_api.js +29 -0
  8. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +16 -0
  9. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
  10. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +29 -0
  11. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +40 -0
  12. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
  13. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +106 -0
  14. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts +2 -0
  15. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts.map +1 -0
  16. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.js +100 -0
  17. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts +2 -0
  18. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts.map +1 -0
  19. package/compiled/src/ifc/ifc_demand_extraction.test.js +111 -0
  20. package/compiled/src/ifc/ifc_geometry_extraction.d.ts +47 -0
  21. package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
  22. package/compiled/src/ifc/ifc_geometry_extraction.js +223 -269
  23. package/compiled/src/ifc/ifc_stream_open.d.ts +68 -0
  24. package/compiled/src/ifc/ifc_stream_open.d.ts.map +1 -0
  25. package/compiled/src/ifc/ifc_stream_open.js +46 -0
  26. package/compiled/src/ifc/ifc_stream_open.test.d.ts +2 -0
  27. package/compiled/src/ifc/ifc_stream_open.test.d.ts.map +1 -0
  28. package/compiled/src/ifc/ifc_stream_open.test.js +63 -0
  29. package/compiled/src/ifc/ifc_tile_extractor.d.ts +84 -0
  30. package/compiled/src/ifc/ifc_tile_extractor.d.ts.map +1 -0
  31. package/compiled/src/ifc/ifc_tile_extractor.js +134 -0
  32. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts +2 -0
  33. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts.map +1 -0
  34. package/compiled/src/ifc/ifc_tile_extractor.test.js +118 -0
  35. package/compiled/src/index.d.ts +14 -0
  36. package/compiled/src/index.d.ts.map +1 -1
  37. package/compiled/src/index.js +16 -0
  38. package/compiled/src/version/version.js +1 -1
  39. package/compiled/tsconfig.tsbuildinfo +1 -1
  40. 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.413.1255";
33
+ var versionString = "Conway v1.417.1262";
34
34
 
35
35
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
36
36
  var wasmType = "";
@@ -14965,7 +14965,7 @@ ${t5.join("\n")}` : "";
14965
14965
  var import_process = require("process");
14966
14966
 
14967
14967
  // compiled/src/version/version.js
14968
- var versionString = "Conway v1.413.1255";
14968
+ var versionString = "Conway v1.417.1262";
14969
14969
 
14970
14970
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
14971
14971
  function pThreadsAllowed() {
@@ -87610,6 +87610,7 @@ var IfcGeometryExtraction = class _IfcGeometryExtraction {
87610
87610
  this.geometryTypeCounts = /* @__PURE__ */ new Map();
87611
87611
  this.csgDepth = 0;
87612
87612
  this.freeVectorPolygonalFaces_ = [];
87613
+ this.extractionMapsPrepared_ = false;
87613
87614
  this.csgMemoization = !this.lowMemoryMode;
87614
87615
  this.materials = model.materials;
87615
87616
  this.scene = new IfcSceneBuilder(model, conwayModel, this.materials);
@@ -91414,6 +91415,195 @@ var IfcGeometryExtraction = class _IfcGeometryExtraction {
91414
91415
  */
91415
91416
  dumpGeometry(outputFilePath, geometry) {
91416
91417
  }
91418
+ /**
91419
+ * One-time extraction setup shared by the whole-model walk and the
91420
+ * per-product demand path (Phase B2): linear scaling factor and the
91421
+ * cross-product maps (materials, material definitions, rel-voids, styled
91422
+ * items). Idempotent.
91423
+ */
91424
+ prepareExtractionMaps_() {
91425
+ if (this.extractionMapsPrepared_) {
91426
+ return;
91427
+ }
91428
+ this.extractionMapsPrepared_ = true;
91429
+ this.extractLinearScalingFactor();
91430
+ const relAssociatesMaterials = this.model.types(IfcRelAssociatesMaterial);
91431
+ for (const relAssociateMaterial of relAssociatesMaterials) {
91432
+ const relatingMaterial = relAssociateMaterial.RelatingMaterial;
91433
+ try {
91434
+ const relatedObjects = relAssociateMaterial.RelatedObjects;
91435
+ for (const relatedObject of relatedObjects) {
91436
+ const product = relatedObject;
91437
+ if (product instanceof IfcProduct) {
91438
+ if (product instanceof IfcOpeningElement || product instanceof IfcSpace || product instanceof IfcOpeningStandardCase) {
91439
+ continue;
91440
+ }
91441
+ this.materials.relMaterialsMap.set(product.localID, relatingMaterial.localID);
91442
+ } else {
91443
+ }
91444
+ }
91445
+ } catch (ex) {
91446
+ if (ex instanceof Error) {
91447
+ if (MATERIAL_RELATED_OBJECTS_PERMISSIVE) {
91448
+ logger_default.error(`Error processing relatingMaterial expressID: ${relatingMaterial.expressID}, error: ${ex.message}`);
91449
+ } else {
91450
+ throw ex;
91451
+ }
91452
+ } else {
91453
+ logger_default.error("Unknown exception processing IfcRelAssociateMaterials.");
91454
+ }
91455
+ }
91456
+ }
91457
+ this.populateMaterialDefinitionsMap();
91458
+ this.populateRelVoidsMap();
91459
+ this.populateStyledItemsMap();
91460
+ }
91461
+ /**
91462
+ * Prepare for per-product demand extraction (Phase B2) without running the
91463
+ * whole-model walk: populates the shared extraction maps so
91464
+ * {@link extractProductGeometryByLocalID} can extract any single product.
91465
+ * Idempotent; the whole-model walk shares the same preparation.
91466
+ */
91467
+ prepareDemandExtraction() {
91468
+ this.prepareExtractionMaps_();
91469
+ }
91470
+ /**
91471
+ * Extract one product's geometry into the scene by local ID — the demand
91472
+ * path's entry (Phase B2). Requires {@link prepareDemandExtraction} (or a
91473
+ * prior whole-model walk) so the shared maps exist.
91474
+ *
91475
+ * Note: products that are targets of IfcRelAggregates whose relating
91476
+ * object carries rel-voids get those master voids only on the whole-model
91477
+ * walk; the demand path extracts the product's own voids. The parity gate
91478
+ * for this seam is the whole-model digest CI.
91479
+ *
91480
+ * @param localID The product's local ID.
91481
+ * @return {boolean} True if the local ID was an IfcProduct and was
91482
+ * extracted; false if it wasn't a product.
91483
+ */
91484
+ extractProductGeometryByLocalID(localID) {
91485
+ this.prepareExtractionMaps_();
91486
+ const element = this.model.getElementByLocalID(localID);
91487
+ if (!(element instanceof IfcProduct)) {
91488
+ return false;
91489
+ }
91490
+ this.extractProductGeometry(element);
91491
+ return true;
91492
+ }
91493
+ /**
91494
+ * Extract one product's geometry into the scene: placement, material /
91495
+ * style extraction, representation items (including mapped items) and
91496
+ * rel-void application. The deduplicated body of the whole-model walk's
91497
+ * two product loops (plain products + rel-aggregates), shared with the
91498
+ * per-product demand path.
91499
+ *
91500
+ * @param product The product to extract.
91501
+ * @param precomputedRelVoids Optional caller-owned rel-voids (the
91502
+ * rel-aggregates "master" case): when supplied the caller retains
91503
+ * ownership and this method does not delete the mesh vector; when
91504
+ * omitted, voids are extracted per product and freed here.
91505
+ */
91506
+ extractProductGeometry(product, precomputedRelVoids) {
91507
+ this.scene.clearParentStack();
91508
+ const isSpace = product instanceof IfcOpeningElement || product instanceof IfcSpace || product instanceof IfcOpeningStandardCase;
91509
+ const objectPlacement = product.ObjectPlacement;
91510
+ if (objectPlacement !== null) {
91511
+ this.extractPlacement(objectPlacement);
91512
+ }
91513
+ const representations = product.Representation;
91514
+ if (representations === null) {
91515
+ return;
91516
+ }
91517
+ const styledItemID = this.extractMaterialStyle(product);
91518
+ let hasRelVoid = false;
91519
+ const extractRelVoidsResult = precomputedRelVoids ?? this.extractRelVoids(product);
91520
+ let relVoidsMeshVector;
91521
+ let relVoidLocalIDs;
91522
+ if (extractRelVoidsResult !== void 0) {
91523
+ [relVoidsMeshVector, relVoidLocalIDs] = extractRelVoidsResult;
91524
+ }
91525
+ if (relVoidsMeshVector !== void 0) {
91526
+ hasRelVoid = true;
91527
+ }
91528
+ if (styledItemID !== void 0) {
91529
+ const styledItem = this.model.getElementByLocalID(styledItemID);
91530
+ let reusableStyleID;
91531
+ for (const representation of representations.Representations) {
91532
+ if (representation instanceof IfcShapeRepresentation) {
91533
+ if (representation.RepresentationIdentifier !== "Body" && representation.RepresentationIdentifier !== "Facetation") {
91534
+ continue;
91535
+ }
91536
+ }
91537
+ for (const item of representation.Items) {
91538
+ if (item instanceof IfcMappedItem) {
91539
+ this.extractMappedItem(item, product, hasRelVoid, isSpace);
91540
+ } else {
91541
+ try {
91542
+ this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
91543
+ if (hasRelVoid) {
91544
+ this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
91545
+ }
91546
+ } catch (error) {
91547
+ if (error instanceof Error) {
91548
+ logger_default.error(`Error extracting representation item
91549
+ ${error.message}
91550
+ Express ID: #${item.expressID}`);
91551
+ } else {
91552
+ logger_default.error(`Error extracting representation item
91553
+ Express ID: #${item.expressID}`);
91554
+ }
91555
+ }
91556
+ }
91557
+ const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
91558
+ if (styledItemLocalID_ !== void 0) {
91559
+ const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
91560
+ this.extractStyledItem(styledItem_);
91561
+ } else if (reusableStyleID !== void 0) {
91562
+ this.materials.addGeometryMapping(item.localID, reusableStyleID);
91563
+ } else if (styledItem instanceof IfcStyledItem) {
91564
+ reusableStyleID = this.extractStyledItem(styledItem, item);
91565
+ }
91566
+ }
91567
+ }
91568
+ } else {
91569
+ for (const representation of representations.Representations) {
91570
+ if (representation instanceof IfcShapeRepresentation) {
91571
+ if (representation.RepresentationIdentifier !== "Body" && representation.RepresentationIdentifier !== "Facetation") {
91572
+ continue;
91573
+ }
91574
+ }
91575
+ for (const item of representation.Items) {
91576
+ if (item instanceof IfcMappedItem) {
91577
+ this.extractMappedItem(item, product, hasRelVoid, isSpace);
91578
+ } else {
91579
+ try {
91580
+ this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
91581
+ if (hasRelVoid) {
91582
+ this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
91583
+ }
91584
+ const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
91585
+ if (styledItemLocalID_ !== void 0) {
91586
+ const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
91587
+ this.extractStyledItem(styledItem_);
91588
+ }
91589
+ } catch (error) {
91590
+ if (error instanceof Error) {
91591
+ logger_default.error(`Error extracting representation item
91592
+ ${error.message}
91593
+ ${error.stack}
91594
+ Express ID: #${item.localID}`);
91595
+ } else {
91596
+ logger_default.error(`Unknown error extracting representation item Express ID: #${item.localID}`);
91597
+ }
91598
+ }
91599
+ }
91600
+ }
91601
+ }
91602
+ }
91603
+ if (precomputedRelVoids === void 0) {
91604
+ relVoidsMeshVector?.delete();
91605
+ }
91606
+ }
91417
91607
  /**
91418
91608
  * Extract the geometry data from the IFC
91419
91609
  *
@@ -91488,144 +91678,19 @@ var IfcGeometryExtraction = class _IfcGeometryExtraction {
91488
91678
  */
91489
91679
  *extractIFCGeometryDataIncremental() {
91490
91680
  let result = ExtractResult.INCOMPLETE;
91491
- this.extractLinearScalingFactor();
91492
91681
  const previousMemoizationState = this.model.elementMemoization;
91493
- const relAssociatesMaterials = this.model.types(IfcRelAssociatesMaterial);
91494
91682
  try {
91495
91683
  const MEMOIZATION_THRESHOLD = 256 * 1024 * 1024;
91496
91684
  if (this.lowMemoryMode || this.model.bufferBytesize > MEMOIZATION_THRESHOLD) {
91497
91685
  this.model.elementMemoization = false;
91498
91686
  }
91499
- for (const relAssociateMaterial of relAssociatesMaterials) {
91500
- const relatingMaterial = relAssociateMaterial.RelatingMaterial;
91501
- try {
91502
- const relatedObjects = relAssociateMaterial.RelatedObjects;
91503
- for (const relatedObject of relatedObjects) {
91504
- const product = relatedObject;
91505
- if (product instanceof IfcProduct) {
91506
- if (product instanceof IfcOpeningElement || product instanceof IfcSpace || product instanceof IfcOpeningStandardCase) {
91507
- continue;
91508
- }
91509
- this.materials.relMaterialsMap.set(product.localID, relatingMaterial.localID);
91510
- } else {
91511
- }
91512
- }
91513
- } catch (ex) {
91514
- if (ex instanceof Error) {
91515
- if (MATERIAL_RELATED_OBJECTS_PERMISSIVE) {
91516
- logger_default.error(`Error processing relatingMaterial expressID: ${relatingMaterial.expressID}, error: ${ex.message}`);
91517
- } else {
91518
- throw ex;
91519
- }
91520
- } else {
91521
- logger_default.error("Unknown exception processing IfcRelAssociateMaterials.");
91522
- }
91523
- }
91524
- }
91525
- this.populateMaterialDefinitionsMap();
91526
- this.populateRelVoidsMap();
91527
- this.populateStyledItemsMap();
91687
+ this.prepareExtractionMaps_();
91528
91688
  const products = this.model.types(IfcProduct);
91529
91689
  const totalItems = this.model.typeCount(IfcProduct) + this.model.typeCount(IfcRelAggregates);
91530
91690
  let completedItems = 0;
91531
91691
  for (const product of products) {
91532
91692
  yield [++completedItems, totalItems];
91533
- this.scene.clearParentStack();
91534
- const isSpace = product instanceof IfcOpeningElement || product instanceof IfcSpace || product instanceof IfcOpeningStandardCase;
91535
- const objectPlacement = product.ObjectPlacement;
91536
- if (objectPlacement !== null) {
91537
- this.extractPlacement(objectPlacement);
91538
- }
91539
- const representations = product.Representation;
91540
- if (representations !== null) {
91541
- const styledItemID = this.extractMaterialStyle(product);
91542
- let hasRelVoid = false;
91543
- const extractRelVoidsResult = this.extractRelVoids(product);
91544
- let relVoidsMeshVector;
91545
- let relVoidLocalIDs;
91546
- if (extractRelVoidsResult !== void 0) {
91547
- [relVoidsMeshVector, relVoidLocalIDs] = extractRelVoidsResult;
91548
- }
91549
- if (relVoidsMeshVector !== void 0) {
91550
- hasRelVoid = true;
91551
- }
91552
- if (styledItemID !== void 0) {
91553
- const styledItem = this.model.getElementByLocalID(styledItemID);
91554
- let reusableStyleID;
91555
- for (const representation of representations.Representations) {
91556
- if (representation instanceof IfcShapeRepresentation) {
91557
- if (representation.RepresentationIdentifier !== "Body" && representation.RepresentationIdentifier !== "Facetation") {
91558
- continue;
91559
- }
91560
- }
91561
- for (const item of representation.Items) {
91562
- if (item instanceof IfcMappedItem) {
91563
- this.extractMappedItem(item, product, hasRelVoid, isSpace);
91564
- } else {
91565
- try {
91566
- this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
91567
- if (hasRelVoid) {
91568
- this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
91569
- }
91570
- } catch (error) {
91571
- if (error instanceof Error) {
91572
- logger_default.error(`Error extracting representation item
91573
- ${error.message}
91574
- Express ID: #${item.expressID}`);
91575
- } else {
91576
- logger_default.error(`Error extracting representation item
91577
- Express ID: #${item.expressID}`);
91578
- }
91579
- }
91580
- }
91581
- const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
91582
- if (styledItemLocalID_ !== void 0) {
91583
- const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
91584
- this.extractStyledItem(styledItem_);
91585
- } else if (reusableStyleID !== void 0) {
91586
- this.materials.addGeometryMapping(item.localID, reusableStyleID);
91587
- } else if (styledItem instanceof IfcStyledItem) {
91588
- reusableStyleID = this.extractStyledItem(styledItem, item);
91589
- }
91590
- }
91591
- }
91592
- } else {
91593
- for (const representation of representations.Representations) {
91594
- if (representation instanceof IfcShapeRepresentation) {
91595
- if (representation.RepresentationIdentifier !== "Body" && representation.RepresentationIdentifier !== "Facetation") {
91596
- continue;
91597
- }
91598
- }
91599
- for (const item of representation.Items) {
91600
- if (item instanceof IfcMappedItem) {
91601
- this.extractMappedItem(item, product, hasRelVoid, isSpace);
91602
- } else {
91603
- try {
91604
- this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
91605
- if (hasRelVoid) {
91606
- this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
91607
- }
91608
- const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
91609
- if (styledItemLocalID_ !== void 0) {
91610
- const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
91611
- this.extractStyledItem(styledItem_);
91612
- }
91613
- } catch (error) {
91614
- if (error instanceof Error) {
91615
- logger_default.error(`Error extracting representation item
91616
- ${error.message}
91617
- ${error.stack}
91618
- Express ID: #${item.localID}`);
91619
- } else {
91620
- logger_default.error(`Unknown error extracting representation item Express ID: #${item.localID}`);
91621
- }
91622
- }
91623
- }
91624
- }
91625
- }
91626
- }
91627
- relVoidsMeshVector?.delete();
91628
- }
91693
+ this.extractProductGeometry(product);
91629
91694
  }
91630
91695
  const relAggregates = this.model.types(IfcRelAggregates);
91631
91696
  for (const relAggregate of relAggregates) {
@@ -91636,105 +91701,7 @@ var IfcGeometryExtraction = class _IfcGeometryExtraction {
91636
91701
  const relatedObjects = relAggregate.RelatedObjects;
91637
91702
  for (const productRepresentation of relatedObjects) {
91638
91703
  if (productRepresentation instanceof IfcProduct) {
91639
- const isSpace = productRepresentation instanceof IfcOpeningElement || productRepresentation instanceof IfcSpace || productRepresentation instanceof IfcOpeningStandardCase;
91640
- const product = productRepresentation;
91641
- this.scene.clearParentStack();
91642
- const objectPlacement = product.ObjectPlacement;
91643
- if (objectPlacement !== null) {
91644
- this.extractPlacement(objectPlacement);
91645
- }
91646
- const representations = product.Representation;
91647
- if (representations !== null) {
91648
- const styledItemID = this.extractMaterialStyle(product);
91649
- const extractRelVoidsResult = masterRelVoids ?? this.extractRelVoids(product);
91650
- let hasRelVoid = false;
91651
- let relVoidsMeshVector;
91652
- let relVoidLocalIDs;
91653
- if (extractRelVoidsResult !== void 0) {
91654
- [relVoidsMeshVector, relVoidLocalIDs] = extractRelVoidsResult;
91655
- }
91656
- if (relVoidsMeshVector !== void 0) {
91657
- hasRelVoid = true;
91658
- }
91659
- if (styledItemID !== void 0) {
91660
- const styledItem = this.model.getElementByLocalID(styledItemID);
91661
- let reusableStyleID;
91662
- for (const representation of representations.Representations) {
91663
- if (representation instanceof IfcShapeRepresentation) {
91664
- if (representation.RepresentationIdentifier !== "Body" && representation.RepresentationIdentifier !== "Facetation") {
91665
- continue;
91666
- }
91667
- }
91668
- for (const item of representation.Items) {
91669
- if (item instanceof IfcMappedItem) {
91670
- this.extractMappedItem(item, product, hasRelVoid, isSpace);
91671
- } else {
91672
- try {
91673
- this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
91674
- if (hasRelVoid) {
91675
- this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
91676
- }
91677
- } catch (error) {
91678
- if (error instanceof Error) {
91679
- logger_default.error(`Error extracting rel aggregate representation item
91680
- ${error.message}
91681
- ${error.stack}
91682
- Express ID: #${item.expressID}`);
91683
- } else {
91684
- logger_default.error(`Unknown error extracting rel aggregate representation item Express ID: #${item.expressID}`);
91685
- }
91686
- }
91687
- }
91688
- const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
91689
- if (styledItemLocalID_ !== void 0) {
91690
- const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
91691
- this.extractStyledItem(styledItem_);
91692
- } else if (reusableStyleID !== void 0) {
91693
- this.materials.addGeometryMapping(item.localID, reusableStyleID);
91694
- } else if (styledItem instanceof IfcStyledItem) {
91695
- reusableStyleID = this.extractStyledItem(styledItem, item);
91696
- }
91697
- }
91698
- }
91699
- } else {
91700
- for (const representation of representations.Representations) {
91701
- if (representation instanceof IfcShapeRepresentation) {
91702
- if (representation.RepresentationIdentifier !== "Body" && representation.RepresentationIdentifier !== "Facetation") {
91703
- continue;
91704
- }
91705
- }
91706
- for (const item of representation.Items) {
91707
- if (item instanceof IfcMappedItem) {
91708
- this.extractMappedItem(item, product, hasRelVoid, isSpace);
91709
- } else {
91710
- try {
91711
- this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
91712
- if (hasRelVoid) {
91713
- this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
91714
- }
91715
- const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
91716
- if (styledItemLocalID_ !== void 0) {
91717
- const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
91718
- this.extractStyledItem(styledItem_);
91719
- }
91720
- } catch (error) {
91721
- if (error instanceof Error) {
91722
- logger_default.error(`Error extracting rel aggregate representation item
91723
- ${error.message}
91724
- ${error.stack}
91725
- Express ID: #${item.expressID}`);
91726
- } else {
91727
- logger_default.error(`Unknown error extracting rel aggregate representation item Express ID: #${item.expressID}`);
91728
- }
91729
- }
91730
- }
91731
- }
91732
- }
91733
- }
91734
- if (masterRelVoids === void 0) {
91735
- relVoidsMeshVector?.delete();
91736
- }
91737
- }
91704
+ this.extractProductGeometry(productRepresentation, masterRelVoids);
91738
91705
  }
91739
91706
  }
91740
91707
  if (masterRelVoids !== void 0) {
@@ -15943,7 +15943,7 @@ var ParsingBuffer = class {
15943
15943
  };
15944
15944
 
15945
15945
  // compiled/src/version/version.js
15946
- var versionString = "Conway v1.413.1255";
15946
+ var versionString = "Conway v1.417.1262";
15947
15947
 
15948
15948
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
15949
15949
  function pThreadsAllowed() {
@@ -944,7 +944,7 @@ var EntityTypesIfcCount = 909;
944
944
  var entity_types_ifc_gen_default = EntityTypesIfc;
945
945
 
946
946
  // compiled/src/version/version.js
947
- var versionString = "Conway v1.413.1255";
947
+ var versionString = "Conway v1.417.1262";
948
948
 
949
949
  // compiled/dependencies/conway-geom/interface/conway_geometry.js
950
950
  var wasmType = "";
@@ -145,6 +145,26 @@ export declare class IfcAPI {
145
145
  * @return {Promise<number>} model ID
146
146
  */
147
147
  OpenModelAsync(data: Uint8Array, settings?: Loadersettings): Promise<number>;
148
+ /**
149
+ * Streamed-open variant of OpenModelAsync (conway extension;
150
+ * feature-detect with typeof api.OpenModelStreamed === 'function').
151
+ * IFC input parses through the streaming columnar indexer, so the
152
+ * model's record index is columnar from birth and the classic
153
+ * per-record object phase — the dominant JS-heap cost of parsing
154
+ * large models — never exists. Everything downstream is identical to
155
+ * OpenModelAsync: same cooperative geometry extraction, same
156
+ * meshes/properties surface, and SpillModelSource works afterwards
157
+ * as usual.
158
+ *
159
+ * Never does worse than OpenModelAsync: non-IFC formats and any
160
+ * streamed-parse failure fall back to the classic path internally,
161
+ * so -1 here means the classic open would have failed too.
162
+ *
163
+ * @param data containing IFC data (bytes)
164
+ * @param settings settings for loading the model
165
+ * @return {Promise<number>} model ID
166
+ */
167
+ OpenModelStreamed(data: Uint8Array, settings?: Loadersettings): Promise<number>;
148
168
  /**
149
169
  * Set conway's console-echo log threshold, web-ifc compatible surface
150
170
  * (numeric LogLevel enum). Embedders (e.g. Share) use this to quiet a
@@ -1 +1 @@
1
- {"version":3,"file":"ifc_api.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,IAAI,mBAAmB,EACjE,MAAM,aAAa,CAAA;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,EAAE,sBAAsB,EA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AAC,EACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IASjD;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAQrC;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;IAsElD;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ;IA6CzD;;;;;OAKG;IACH,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAyBtD;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,UAAQ;IAM1C,sDAAsD;IACtD,gBAAgB,IAAI,MAAM;IAI1B,2FAA2F;IAC3F,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG;CAGpC"}
@@ -144,6 +144,35 @@ export class IfcAPI {
144
144
  this.models.set(modelIdResult, result);
145
145
  return modelIdResult;
146
146
  }
147
+ /**
148
+ * Streamed-open variant of OpenModelAsync (conway extension;
149
+ * feature-detect with typeof api.OpenModelStreamed === 'function').
150
+ * IFC input parses through the streaming columnar indexer, so the
151
+ * model's record index is columnar from birth and the classic
152
+ * per-record object phase — the dominant JS-heap cost of parsing
153
+ * large models — never exists. Everything downstream is identical to
154
+ * OpenModelAsync: same cooperative geometry extraction, same
155
+ * meshes/properties surface, and SpillModelSource works afterwards
156
+ * as usual.
157
+ *
158
+ * Never does worse than OpenModelAsync: non-IFC formats and any
159
+ * streamed-parse failure fall back to the classic path internally,
160
+ * so -1 here means the classic open would have failed too.
161
+ *
162
+ * @param data containing IFC data (bytes)
163
+ * @param settings settings for loading the model
164
+ * @return {Promise<number>} model ID
165
+ */
166
+ async OpenModelStreamed(data, settings) {
167
+ // Reserve the ID before the first await — see OpenModelAsync.
168
+ const modelIdResult = this.globalModelIDCounter++;
169
+ const result = await IfcApiModelPassthroughFactory.fromStreamed(modelIdResult, data, this.wasmModule, settings);
170
+ if (result === void 0) {
171
+ return -1;
172
+ }
173
+ this.models.set(modelIdResult, result);
174
+ return modelIdResult;
175
+ }
147
176
  /**
148
177
  * Set conway's console-echo log threshold, web-ifc compatible surface
149
178
  * (numeric LogLevel enum). Embedders (e.g. Share) use this to quiet a
@@ -13,6 +13,22 @@ export declare class IfcApiModelPassthroughFactory {
13
13
  * @return {IfcApiModelPassthrough | undefined}
14
14
  */
15
15
  static from(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings): IfcApiModelPassthrough | undefined;
16
+ /**
17
+ * Streamed-open twin of fromAsync (used by OpenModelStreamed): IFC
18
+ * models parse through the streaming columnar indexer (no per-record
19
+ * object phase — see IfcApiProxyIfc.createStreamed); everything else
20
+ * behaves like fromAsync. Non-IFC formats and any streamed-open
21
+ * failure fall back to the classic cooperative path, so this never
22
+ * does worse than fromAsync — the safety net behind embedder
23
+ * feature flags.
24
+ *
25
+ * @param modelID
26
+ * @param data
27
+ * @param wasmModule
28
+ * @param settings
29
+ * @return {Promise<IfcApiModelPassthrough | undefined>}
30
+ */
31
+ static fromStreamed(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings): Promise<IfcApiModelPassthrough | undefined>;
16
32
  /**
17
33
  * Cooperative twin of from() (used by OpenModelAsync): the data parse
18
34
  * runs with periodic event-loop yields so progress UI can repaint
@@ -1 +1 @@
1
- {"version":3,"file":"ifc_api_model_passthrough_factory.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_model_passthrough_factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAKpE;;GAEG;AACH,qBAAa,6BAA6B;IAExC;;;;;;;OAOG;WACW,IAAI,CACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,sBAAsB,GAAG,SAAS;IA2EnE;;;;;;;;;;;;OAYG;WACiB,SAAS,CACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;CA+C7E"}
1
+ {"version":3,"file":"ifc_api_model_passthrough_factory.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api_model_passthrough_factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAKpE;;GAEG;AACH,qBAAa,6BAA6B;IAExC;;;;;;;OAOG;WACW,IAAI,CACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,sBAAsB,GAAG,SAAS;IA2EnE;;;;;;;;;;;;;;OAcG;WACiB,YAAY,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;IAuB5E;;;;;;;;;;;;OAYG;WACiB,SAAS,CACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,GAAG,EACf,QAAQ,CAAC,EAAE,cAAc,GAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;CA+C7E"}
@@ -66,6 +66,35 @@ export class IfcApiModelPassthroughFactory {
66
66
  Logger.error("No type detected when constructing model");
67
67
  }
68
68
  }
69
+ /**
70
+ * Streamed-open twin of fromAsync (used by OpenModelStreamed): IFC
71
+ * models parse through the streaming columnar indexer (no per-record
72
+ * object phase — see IfcApiProxyIfc.createStreamed); everything else
73
+ * behaves like fromAsync. Non-IFC formats and any streamed-open
74
+ * failure fall back to the classic cooperative path, so this never
75
+ * does worse than fromAsync — the safety net behind embedder
76
+ * feature flags.
77
+ *
78
+ * @param modelID
79
+ * @param data
80
+ * @param wasmModule
81
+ * @param settings
82
+ * @return {Promise<IfcApiModelPassthrough | undefined>}
83
+ */
84
+ static async fromStreamed(modelID, data, wasmModule, settings) {
85
+ const modelFormat = ModelFormatDetector.detect(new ParsingBuffer(data));
86
+ if (modelFormat === ModelFormatType.IFC) {
87
+ try {
88
+ return await IfcApiProxyIfc.createStreamed(modelID, data, wasmModule, settings);
89
+ }
90
+ catch (e) {
91
+ const message = e instanceof Error ? e.message : String(e);
92
+ Logger.warning(`Streamed open failed for model ${modelID}, ` +
93
+ `falling back to classic open: ${message}`);
94
+ }
95
+ }
96
+ return IfcApiModelPassthroughFactory.fromAsync(modelID, data, wasmModule, settings);
97
+ }
69
98
  /**
70
99
  * Cooperative twin of from() (used by OpenModelAsync): the data parse
71
100
  * runs with periodic event-loop yields so progress UI can repaint