mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-27 06:43:47 +01:00
16 lines
461 B
JavaScript
16 lines
461 B
JavaScript
|
class GeometriesLoader{
|
||
|
static async loadForAsync(array){
|
||
|
var xyzs=[]
|
||
|
for (const item of array) {
|
||
|
const mymol=mhchemCE.extract(item.molecule).toLowerCase().replace(" ","_")
|
||
|
const myset=item.set.split("#").join("")
|
||
|
try {
|
||
|
const mol=await Geometry.loadXYZAsync(`/${myset}/${mymol}.xyz`)
|
||
|
xyzs.push(mol)
|
||
|
} catch (error) {
|
||
|
console.error("Geometry not found",item)
|
||
|
}
|
||
|
}
|
||
|
return xyzs.flat()
|
||
|
}
|
||
|
}
|