Generate "bonds" and "bondvisibility" files for the H + H2 reaction
In the game, we wish to show bonds breaking and forming.
Since everything is easier in Python than in C#, the best option is to generate the bonds in Python and save them to a text file. This will give us full control over how we want the bonds displayed. (for instance, what if we want to color the bonds different colors in future, etc).
New file format specifications
Each reaction (eg "HplusH2") should have the following files (generated by a Python script).
-
HplusH2.atoms.txt(plain text file ): the the number of atoms (eg 3), followed by a list of atomic symbols. -
HplusH2.bonds.txt(plain text file ): the number of bonds (eg 2), followed by a list of pairs of atom numbers (starting from zero of course) and a bond type (eg"single"). Not all the bonds need to be visible at any one time. -
HplusH2.bondvisibility.bytes(binary file): the number of bonds (eg 2) followed by the number of points in the X direction on the PES (eg 100) followed by the number of points in the Y direction (eg 100) followed by an array of booleans with shape (nX,nY,nBonds) specifying which bonds are visible. -
HplusH2.atompositions.bytes(binary file): the number of atoms (eg 3) followed by the number of points in the X direction on the PES (eg 100) followed by the number of points in the Y direction (eg 100) followed by an array of 32-bit floats with shape (nX,nY,nAtoms, 3) specifying the atomic positions.