CIF-Files are file containing crystallographic information about molecules (which can be obtained here: CCDC)
npm install cifloader3
Notice: If you're using it in Nuxt.js like me don't forget to transpile three and cifloader3
build: {
transpile: ['three', 'cifloader3']
}
import * as THREE from 'three'
import { CIFLoader } from 'cifloader3'
var loader = new CIFLoader();
loader.load(filename, function(cif) {
//do stuff here
},
function(xhr) {
//show loading progress here
},
function(error) {
//handle errors here
});
For further information have a look at the three.js examples directory: THREE