From 2ed118604cb1729bc3eeec09a9d07c651515f44a Mon Sep 17 00:00:00 2001 From: JonStargaryen <sebastian.bittrich@rcsb.org> Date: Tue, 26 May 2020 15:38:15 -0700 Subject: [PATCH] cleanup --- src/extensions/membrane-orientation/representation.ts | 3 ++- src/mol-model-props/computed/membrane-orientation/ANVIL.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/extensions/membrane-orientation/representation.ts b/src/extensions/membrane-orientation/representation.ts index b5a571ba2..c4cba9058 100644 --- a/src/extensions/membrane-orientation/representation.ts +++ b/src/extensions/membrane-orientation/representation.ts @@ -66,11 +66,12 @@ function getMembraneSpheres(ctx: RuntimeContext, data: Structure, props: Membran } function createMembraneLayer(spheresBuilder: SpheresBuilder, point: Vec3, normalVector: Vec3, density: number, radius: number) { + Vec3.normalize(normalVector, normalVector); const d = -Vec3.dot(normalVector, point); const rep = Vec3(); for (let i = -1000, il = 1000; i < il; i += density) { for (let j = -1000, jl = 1000; j < jl; j += density) { - Vec3.set(rep, i, j, -(d + i * normalVector[0] + j * normalVector[1]) / normalVector[2]); + Vec3.set(rep, i, j, normalVector[2] === 0 ? 0 : -(d + i * normalVector[0] + j * normalVector[1]) / normalVector[2]); if (Vec3.squaredDistance(rep, point) < radius) { spheresBuilder.add(rep[0], rep[1], rep[2], 0); } diff --git a/src/mol-model-props/computed/membrane-orientation/ANVIL.ts b/src/mol-model-props/computed/membrane-orientation/ANVIL.ts index 57159a4c6..b40e5dccf 100644 --- a/src/mol-model-props/computed/membrane-orientation/ANVIL.ts +++ b/src/mol-model-props/computed/membrane-orientation/ANVIL.ts @@ -160,7 +160,7 @@ namespace MembraneCandidate { } function findMembrane(ctx: ANVILContext, spherePoints: Vec3[], initialStats: HphobHphil, label_comp_id: StructureElement.Property<string>): MembraneCandidate { - const { centroid, stepSize, maxThickness } = ctx; + const { centroid, stepSize, minThickness, maxThickness } = ctx; // best performing membrane let membrane: MembraneCandidate; // score of the best performing membrane @@ -186,7 +186,7 @@ function findMembrane(ctx: ANVILContext, spherePoints: Vec3[], initialStats: Hph qvartemp.push(MembraneCandidate.initial(c1, c2, stats)); } - let jmax = (maxThickness / stepSize) - 1; // TODO should be minThickness but causes weird results if actually in place + let jmax = (minThickness / stepSize) - 1; for (let width = 0, widthl = maxThickness; width < widthl;) { const imax = qvartemp.length - 1 - jmax; -- GitLab