From fe0d4dc11e2d3ca0fa8498c1807fe9bdcc7ea1bf Mon Sep 17 00:00:00 2001 From: Alexander Rose <alexander.rose@weirdbyte.de> Date: Sat, 18 Dec 2021 15:24:52 -0800 Subject: [PATCH] warn (not throw) about erroneous symmetry matrix - #303 --- CHANGELOG.md | 1 + src/mol-math/geometry/symmetry-operator.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f834fc28..a4fa1d6be 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/src/mol-math/geometry/symmetry-operator.ts b/src/mol-math/geometry/symmetry-operator.ts index d1257fc92..1742375dc 100644 --- a/src/mol-math/geometry/symmetry-operator.ts +++ b/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 }; } -- GitLab