patrickfuller / imolecule

An embeddable webGL molecule viewer and file format converter.
http://patrickfuller.github.io/imolecule/
MIT License
86 stars 18 forks source link

Changing bonding rules #28

Closed CorySimon closed 8 years ago

CorySimon commented 8 years ago

If I visualize a .xyz file, the bonds are inferred from distances between atoms. Is there a way I can modify the bonding rules?

i.e. change the cutoff distance between atom x and y beyond which a bond is declared to be present.

Some of the atoms that should be bonded are not.

patrickfuller commented 8 years ago

The file format converter is powered by openbabel, so that's where you want to look - particularly OBMol.ConnectTheDots. To use open babel in the notebook with imolecule rendering, look at cell 6 in the ipython notebook example.

cortner commented 8 years ago

I just stumbled over this issue: for what it's worth now, I found it very straightforward to generate a JSON file in the format that imolecule reads.