ソースを参照

remove erroneous bounding-box overlap test

Alexander Rose 1 年間 前
コミット
99809d25b9
2 ファイル変更2 行追加9 行削除
  1. 1 1
      CHANGELOG.md
  2. 1 8
      src/mol-model/structure/structure/structure.ts

+ 1 - 1
CHANGELOG.md

@@ -7,7 +7,7 @@ Note that since we don't clearly distinguish between a public and private interf
 ## [Unreleased]
 
 - Make operators in `IndexPairBonds` a directed property
-- Fix bounding-box overlap test in `Structure.eachUnitPair`
+- Remove erroneous bounding-box overlap test in `Structure.eachUnitPair`
 
 ## [v3.35.0] - 2023-05-14
 

+ 1 - 8
src/mol-model/structure/structure/structure.ts

@@ -23,7 +23,7 @@ import { Carbohydrates } from './carbohydrates/data';
 import { computeCarbohydrates } from './carbohydrates/compute';
 import { Vec3, Mat4 } from '../../../mol-math/linear-algebra';
 import { idFactory } from '../../../mol-util/id-factory';
-import { Box3D, GridLookup3D } from '../../../mol-math/geometry';
+import { GridLookup3D } from '../../../mol-math/geometry';
 import { UUID } from '../../../mol-util';
 import { CustomProperties } from '../../custom-property';
 import { AtomicHierarchy } from '../model/properties/atomic';
@@ -1213,23 +1213,16 @@ namespace Structure {
 
         const lookup = structure.lookup3d;
         const imageCenter = Vec3();
-        const bboxA = Box3D();
-        const bboxB = Box3D();
-        const rvec = Vec3.create(maxRadius, maxRadius, maxRadius);
 
         for (const unitA of structure.units) {
             if (!validUnit(unitA)) continue;
 
             const bs = unitA.boundary.sphere;
-            Box3D.expand(bboxA, unitA.boundary.box, rvec);
             Vec3.transformMat4(imageCenter, bs.center, unitA.conformation.operator.matrix);
             const closeUnits = lookup.findUnitIndices(imageCenter[0], imageCenter[1], imageCenter[2], bs.radius + maxRadius);
             for (let i = 0; i < closeUnits.count; i++) {
                 const unitB = structure.units[closeUnits.indices[i]];
                 if (unitA.id >= unitB.id) continue;
-
-                Box3D.expand(bboxB, unitB.boundary.box, rvec);
-                if (!Box3D.overlaps(bboxA, bboxB)) continue;
                 if (!validUnit(unitB) || !validUnitPair(unitA, unitB)) continue;
 
                 if (unitB.elements.length >= unitA.elements.length) callback(unitA, unitB);