Browse Source

warn (not throw) about erroneous symmetry matrix

- #303
Alexander Rose 3 years ago
parent
commit
fe0d4dc11e
2 changed files with 4 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 3 1
      src/mol-math/geometry/symmetry-operator.ts

+ 1 - 0
CHANGELOG.md

@@ -23,6 +23,7 @@ Note that since we don't clearly distinguish between a public and private interf
 - Add QualityAssessment extension (using data from ma_qa_metric_local mmcif category)
     - pLDDT & qmean score: coloring, repr presets, molql symbol, loci labels (including avg for mutli-residue selections)
     - pLDDT: selection query
+- Warn about erroneous symmetry operator matrix (instead of throwing an error)
 
 ## [v3.0.0-dev.5] - 2021-12-16
 

+ 3 - 1
src/mol-math/geometry/symmetry-operator.ts

@@ -59,7 +59,9 @@ namespace SymmetryOperator {
         ncsId = ncsId || -1;
         const suffix = getSuffix(info);
         if (Mat4.isIdentity(matrix)) return { name, assembly, matrix, inverse: Mat4.identity(), isIdentity: true, hkl: _hkl, spgrOp, ncsId, suffix };
-        if (!Mat4.isRotationAndTranslation(matrix, RotationTranslationEpsilon)) throw new Error(`Symmetry operator (${name}) must be a composition of rotation and translation.`);
+        if (!Mat4.isRotationAndTranslation(matrix, RotationTranslationEpsilon)) {
+            console.warn(`Symmetry operator (${name}) should be a composition of rotation and translation.`);
+        }
         return { name, assembly, matrix, inverse: Mat4.invert(Mat4(), matrix), isIdentity: false, hkl: _hkl, spgrOp, ncsId, suffix };
     }