Parcourir la source

fix high resolution molecular surface artefacts

- adjust probePositions prop with quality
Alexander Rose il y a 3 ans
Parent
commit
fe702a8c63
2 fichiers modifiés avec 11 ajouts et 1 suppressions
  1. 1 1
      src/mol-math/geometry/molecular-surface.ts
  2. 10 0
      src/mol-repr/util.ts

+ 1 - 1
src/mol-math/geometry/molecular-surface.ts

@@ -49,7 +49,7 @@ function getAngleTables (probePositions: number): AnglesTables {
 export const MolecularSurfaceCalculationParams = {
     probeRadius: PD.Numeric(1.4, { min: 0, max: 10, step: 0.1 }, { description: 'Radius of the probe tracing the molecular surface.' }),
     resolution: PD.Numeric(0.5, { min: 0.01, max: 20, step: 0.01 }, { description: 'Grid resolution/cell spacing.', ...BaseGeometry.CustomQualityParamInfo }),
-    probePositions: PD.Numeric(30, { min: 12, max: 90, step: 1 }, { description: 'Number of positions tested for probe target intersection.', ...BaseGeometry.CustomQualityParamInfo }),
+    probePositions: PD.Numeric(36, { min: 12, max: 90, step: 1 }, { description: 'Number of positions tested for probe target intersection.', ...BaseGeometry.CustomQualityParamInfo }),
 };
 export const DefaultMolecularSurfaceCalculationProps = PD.getDefaultValues(MolecularSurfaceCalculationParams);
 export type MolecularSurfaceCalculationProps = typeof DefaultMolecularSurfaceCalculationProps

+ 10 - 0
src/mol-repr/util.ts

@@ -53,6 +53,7 @@ export interface QualityProps {
     radialSegments: number
     linearSegments: number
     resolution: number
+    probePositions: number
     doubleSided: boolean
     xrayShaded: boolean
     alpha: number
@@ -110,6 +111,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
     let radialSegments = defaults(props.radialSegments, 12);
     let linearSegments = defaults(props.linearSegments, 8);
     let resolution = defaults(props.resolution, 2);
+    let probePositions = defaults(props.probePositions, 12);
     let doubleSided = defaults(props.doubleSided, true);
 
     let volume = 0;
@@ -130,6 +132,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
             radialSegments = 36;
             linearSegments = 18;
             resolution = 0.1;
+            probePositions = 72;
             doubleSided = true;
             break;
         case 'higher':
@@ -137,6 +140,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
             radialSegments = 28;
             linearSegments = 14;
             resolution = 0.3;
+            probePositions = 48;
             doubleSided = true;
             break;
         case 'high':
@@ -144,6 +148,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
             radialSegments = 20;
             linearSegments = 10;
             resolution = 0.5;
+            probePositions = 36;
             doubleSided = true;
             break;
         case 'medium':
@@ -151,6 +156,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
             radialSegments = 12;
             linearSegments = 8;
             resolution = 0.8;
+            probePositions = 24;
             doubleSided = true;
             break;
         case 'low':
@@ -158,6 +164,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
             radialSegments = 8;
             linearSegments = 3;
             resolution = 1.3;
+            probePositions = 24;
             doubleSided = false;
             break;
         case 'lower':
@@ -165,6 +172,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
             radialSegments = 4;
             linearSegments = 2;
             resolution = 3;
+            probePositions = 12;
             doubleSided = false;
             break;
         case 'lowest':
@@ -172,6 +180,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
             radialSegments = 2;
             linearSegments = 1;
             resolution = 8;
+            probePositions = 12;
             doubleSided = false;
             break;
         case 'custom':
@@ -192,6 +201,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
         radialSegments,
         linearSegments,
         resolution,
+        probePositions,
         doubleSided
     };
 }