Jelajahi Sumber

Fix gaussian surface bounding sphere radius

David Sehnal 4 tahun lalu
induk
melakukan
0a7b3fa396

+ 3 - 1
src/mol-repr/structure/visual/gaussian-surface-mesh.ts

@@ -49,7 +49,9 @@ async function createGaussianSurfaceMesh(ctx: VisualContext, unit: Unit, structu
     Mesh.transform(surface, transform);
     if (ctx.webgl && !ctx.webgl.isWebGL2) Mesh.uniformTriangleGroup(surface);
 
-    const sphere = Sphere3D.expand(Sphere3D(), unit.boundary.sphere, props.radiusOffset);
+    // Add 3 to the offset so that the surface boundary doesn't get cut off by clipping plane
+    // TODO: is 3 too low/high?
+    const sphere = Sphere3D.expand(Sphere3D(), unit.boundary.sphere, props.radiusOffset + 3);
     surface.setBoundingSphere(sphere);
 
     return surface;

+ 3 - 1
src/mol-repr/structure/visual/gaussian-surface-wireframe.ts

@@ -29,7 +29,9 @@ async function createGaussianWireframe(ctx: VisualContext, unit: Unit, structure
 
     Lines.transform(wireframe, transform);
 
-    const sphere = Sphere3D.expand(Sphere3D(), unit.boundary.sphere, props.radiusOffset);
+    // Add 3 to the offset so that the surface boundary doesn't get cut off by clipping plane
+    // TODO: is 3 too low/high?
+    const sphere = Sphere3D.expand(Sphere3D(), unit.boundary.sphere, props.radiusOffset + 3);
     wireframe.setBoundingSphere(sphere);
 
     return wireframe;