diff --git a/packages/viewer-sandbox/src/main.ts b/packages/viewer-sandbox/src/main.ts index 8c927a387..965a1c027 100644 --- a/packages/viewer-sandbox/src/main.ts +++ b/packages/viewer-sandbox/src/main.ts @@ -134,9 +134,11 @@ const createViewer = async (containerName: string, _stream: string) => { const getStream = () => { return ( // prettier-ignore - 'https://app.speckle.systems/projects/1b96a34aae/models/a8698c0c67' + // 'https://app.speckle.systems/projects/1b96a34aae/models/a8698c0c67' // Revit sample house (good for bim-like stuff with many display meshes) - // 'https://app.speckle.systems/streams/da9e320dad/commits/5388ef24b8' + 'https://app.speckle.systems/projects/9638b98615/models/2d8e1ef75b@241c9de8d5' + + // 'https://app.speckle.systems/streams/da9e320dad/commits/5388ef24b8' :'( // 'https://app.speckle.systems/streams/da9e320dad/objects/ee5d160d84090822813bc74188da34a7' //large tower @@ -673,6 +675,8 @@ const getStream = () => { // Texts and empty texts // 'https://app.speckle.systems/projects/8b466869c0/models/d1eabb3c74' + + // 'https://app.speckle.systems/projects/d7d987146d/models/1556042389' ) } diff --git a/packages/viewer/src/modules/extensions/ExplodeExtension.ts b/packages/viewer/src/modules/extensions/ExplodeExtension.ts index 92094a027..f94ad0443 100644 --- a/packages/viewer/src/modules/extensions/ExplodeExtension.ts +++ b/packages/viewer/src/modules/extensions/ExplodeExtension.ts @@ -23,6 +23,7 @@ export class ExplodeExtension extends Extension { /** Similar to SpeckleRenderer's visibleSceneBox, but with static boxes from render views */ public get visibleWorld(): Box3 { const bounds: Box3 = new Box3() + const scratchBox = new Box3() const batches = this.viewer.getRenderer().batcher.getBatches() for (let k = 0; k < batches.length; k++) { const batch = batches[k] @@ -48,7 +49,14 @@ export class ExplodeExtension extends Extension { if (s.batchStart >= qEnd) break const sEnd = s.batchStart + s.batchCount if (s.batchStart >= qStart && sEnd <= qEnd) { - bounds.union(s.aabb) + /** Alex 18.02.2026: There is an issue with using the render view's aabb. + * Instanced render views will always provide incorrect bounds unless transformed + * Which is what we are doing here */ + scratchBox.copy(s.aabb) + s.renderData.geometry.transform && + s.renderData.geometry.instanced && + scratchBox.applyMatrix4(s.renderData.geometry.transform) + bounds.union(scratchBox) } } }