console.log("Hello JSRUN! \n\n - from NodeJS .");
'use strict';
informatics.getPointsPerAngstrom = function() {
return c.DEFAULT_STYLES.bondLength_2D / c.DEFAULT_STYLES.angstromsPerBondLength;
};
informatics.BondDeducer = function() {
};
let _ = informatics.BondDeducer.prototype;
_.margin = 1.1;
_.deduceCovalentBonds = function(molecule, customPointsPerAngstrom) {
let pointsPerAngstrom = informatics.getPointsPerAngstrom();
if (customPointsPerAngstrom) {
pointsPerAngstrom = customPointsPerAngstrom;
}
for ( let i = 0, ii = molecule.atoms.length; i < ii; i++) {
for ( let j = i + 1; j < ii; j++) {
let first = molecule.atoms[i];
let second = molecule.atoms[j];
if (first.distance3D(second) < (ELEMENT[first.label].covalentRadius + ELEMENT[second.label].covalentRadius) * pointsPerAngstrom * this.margin) {
molecule.bonds.push(new structures.Bond(first, second, 1));
}
}
}
};