@thatopen/components 2.4.0-alpha.15 → 2.4.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -24685,14 +24685,21 @@ const _IfcGeometryTiler = class _IfcGeometryTiler extends Component {
24685
24685
  this._assets = [];
24686
24686
  }
24687
24687
  async streamGeometries() {
24688
- let buffer = this._streamSerializer.export(this._geometries);
24689
- let data = {};
24690
- for (const [id, { boundingBox: boundingBox2, hasHoles }] of this._geometries) {
24691
- data[id] = { boundingBox: boundingBox2, hasHoles };
24692
- }
24693
- await this.onGeometryStreamed.trigger({ data, buffer });
24694
- data = null;
24695
- buffer = null;
24688
+ const exportMap = /* @__PURE__ */ new Map();
24689
+ for (const [id, value] of this._geometries) {
24690
+ exportMap.set(id, value);
24691
+ if (exportMap.size > this.settings.minGeometrySize) {
24692
+ let buffer = this._streamSerializer.export(exportMap);
24693
+ let data = {};
24694
+ for (const [id2, { boundingBox: boundingBox2, hasHoles }] of this._geometries) {
24695
+ data[id2] = { boundingBox: boundingBox2, hasHoles };
24696
+ }
24697
+ await this.onGeometryStreamed.trigger({ data, buffer });
24698
+ data = null;
24699
+ buffer = null;
24700
+ exportMap.clear();
24701
+ }
24702
+ }
24696
24703
  this._geometries.clear();
24697
24704
  this._geometryCount = 0;
24698
24705
  }