[3d] Set view only when object exists (#1912)

* [3d] Set view only when object exists

* Update locales [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Terry Jia
2024-12-15 13:57:34 -05:00
committed by GitHub
parent 59b62eadf1
commit 7b64bfa173
11 changed files with 524 additions and 0 deletions

View File

@@ -803,6 +803,10 @@ class Load3d {
}
setViewPosition(position: 'front' | 'top' | 'right' | 'isometric') {
if (!this.currentModel) {
return
}
const box = new THREE.Box3()
let center = new THREE.Vector3()
let size = new THREE.Vector3()