Skip to content
Snippets Groups Projects
Commit 08e92f12 authored by Alexander Rose's avatar Alexander Rose
Browse files

improved MolecularSurface calc: projectToriiRange

parent d713ea6a
No related branches found
No related tags found
No related merge requests found
......@@ -291,16 +291,22 @@ export async function calcMolecularSurface(ctx: RuntimeContext, position: Requir
}
}
async function projectTorii () {
for (let i = 0; i < n; ++i) {
function projectToriiRange (begI: number, endI: number) {
for (let i = begI; i < endI; ++i) {
const k = OrderedSet.getAt(indices, i)
lookup3d.find(px[k], py[k], pz[k], radius[k])
for (let j = 0, jl = neighbours.count; j < jl; ++j) {
const l = OrderedSet.getAt(indices, neighbours.indices[j])
if (k < l) projectTorus(k, l)
}
}
}
if (i % updateChunk === 0 && ctx.shouldUpdate) {
async function projectTorii() {
for (let i = 0; i < n; i += updateChunk) {
projectToriiRange(i, Math.min(i + updateChunk, n))
if (ctx.shouldUpdate) {
await ctx.update({ message: 'projecting torii', current: i, max: n })
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment