diff --git a/packages/viewer-sandbox/src/main.ts b/packages/viewer-sandbox/src/main.ts index 1e21b2455..f94fac92d 100644 --- a/packages/viewer-sandbox/src/main.ts +++ b/packages/viewer-sandbox/src/main.ts @@ -532,6 +532,9 @@ const getStream = () => { // Large topological stuff // 'https://app.speckle.systems/projects/7a489ac0d4/models/146d5fbe27,3e481c9a58,65b4cf97d5,6d07577256,903850fa6f' + + // Small (microscopic) building + // 'https://app.speckle.systems/projects/26e4c4aab5/models/7d5ff72f5b' ) } diff --git a/packages/viewer/src/modules/extensions/controls/SmoothOrbitControls.ts b/packages/viewer/src/modules/extensions/controls/SmoothOrbitControls.ts index c15667629..8a88927c1 100644 --- a/packages/viewer/src/modules/extensions/controls/SmoothOrbitControls.ts +++ b/packages/viewer/src/modules/extensions/controls/SmoothOrbitControls.ts @@ -316,7 +316,11 @@ export class SmoothOrbitControls extends SpeckleControls { */ const targetPosition = this.getPosition() const targetTarget = this.getTarget() - if (position.equals(targetPosition) && target.equals(targetTarget)) return + const deltaTarget = vector3.subVectors(target, targetTarget).length() + const deltaPosition = vector3.subVectors(position, targetPosition).length() + const epsilon = 1e-7 + if (deltaPosition < epsilon) return + if (deltaTarget < epsilon) return const v0 = new Vector3().copy(position) const v1 = new Vector3().copy(target) diff --git a/packages/viewer/src/modules/extensions/sections/SectionOutlines.ts b/packages/viewer/src/modules/extensions/sections/SectionOutlines.ts index 8b9666e94..4377555bf 100644 --- a/packages/viewer/src/modules/extensions/sections/SectionOutlines.ts +++ b/packages/viewer/src/modules/extensions/sections/SectionOutlines.ts @@ -356,12 +356,13 @@ export class SectionOutlines extends Extension { private setSectionPlaneChanged(planes: Plane[]) { this.sectionPlanesChanged.length = 0 + const epsilon = this.viewer.World.getRelativeOffset(0.0001) for (let k = 0; k < planes.length; k++) { if ( - Math.abs(this.lastSectionPlanes[k].constant - planes[k].constant) > 0.0001 || + Math.abs(this.lastSectionPlanes[k].constant - planes[k].constant) > epsilon || Math.abs( this.lastSectionPlanes[k].normal.length() - planes[k].normal.length() - ) > 0.0001 + ) > epsilon ) this.sectionPlanesChanged.push(planes[k]) this.lastSectionPlanes[k].copy(planes[k])