JensKrumsieck / CIFLoader3

CIF-File Loader for Three.js
MIT License
4 stars 2 forks source link
3d cif crystallography loader threejs

CIFLoader3

CIF-File Loader for Three.js
npm

CIF-Files are file containing crystallographic information about molecules (which can be obtained here: CCDC)

Install

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']
}

Usage

    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