Browse Source

better box3d calculation in boundary-helper

Alexander Rose 5 years ago
parent
commit
9c97fc258d
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/mol-math/geometry/boundary-helper.ts

+ 5 - 2
src/mol-math/geometry/boundary-helper.ts

@@ -77,9 +77,12 @@ export class BoundaryHelper {
     }
 
     getBox(box?: Box3D) {
-        // TODO can we get a tighter box from the extrema???
         if (!box) box = Box3D()
-        return Box3D.fromSphere3D(box, this.centroidHelper.getSphere())
+        Box3D.setEmpty(box)
+        for (let i = 0; i < this.extrema.length; i++) {
+            Box3D.add(box, this.extrema[i])
+        }
+        return box
     }
 
     reset() {