Skip to content

Commit

Permalink
Merge pull request #1661 from xeokit/XEOK-111-prevent-LASLoaderPlugin…
Browse files Browse the repository at this point in the history
…-infinite-loop

XEOK-111 Prevent LASLoaderPlugin infinite loop
  • Loading branch information
xeolabs authored Sep 9, 2024
2 parents 10c97cb + 4b94859 commit fef2b27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/plugins/LASLoaderPlugin/LASLoaderPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ class LASLoaderPlugin extends Plugin {
}

const sceneModel = new SceneModel(this.viewer.scene, utils.apply(params, {
maxGeometryBatchSize: MAX_VERTICES,
isModel: true
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class VBOBatchingPointsLayer {

this._renderers = getRenderers(cfg.model.scene);

const maxGeometryBatchSize = Math.min(5000000, cfg.maxGeometryBatchSize || window.Infinity);
const maxGeometryBatchSize = cfg.maxGeometryBatchSize || 5000000;

const attribute = function() {
const portions = [ ];
Expand Down Expand Up @@ -161,7 +161,7 @@ export class VBOBatchingPointsLayer {
if (this._finalized) {
throw "Already finalized";
}
return (this._buffer.vertsIndex + (lenPositions / 3)) < this._buffer.maxVerts;
return (this._buffer.vertsIndex + (lenPositions / 3)) <= this._buffer.maxVerts;
}

/**
Expand Down

0 comments on commit fef2b27

Please sign in to comment.