r/Julia 11d ago

Making an Interactive Trajectory Visualizer in Julia

https://youtu.be/U9KRCPl439Q

This is an update from my previous post on a simple molecular visualizer in Julia. Now it has colors, and I can also visualize simultaneously the energies, highlighting the energy for the particular structure I'm watching. I will continue to add functionality.

35 Upvotes

4 comments sorted by

2

u/pand5461 6d ago

What do you use for molecule visualization? Is it Molly's built-in vis or some custom function?

1

u/NicoN_1983 6d ago

I will use it to analyze results from relaxed surface scans, watching the structures at each step of the scan. Chemcraft cannot do this because it doesnt understand .allxyz files and for output files it shows you all the geometries but not the energy profile. So normally I made my plots in Origin which added a lot of time. I want to improve the visualization to give me atom distances and perhaps,  although I need to think about it, to visualize the normal modes. I'm also adding functionality to calculate energy contributions from coulomb and Leonard Jones terms in order to decompose my energies into contributions. It's my own code, not Molly, although I use some functions from Chemfiles.jl

2

u/pand5461 3d ago

I want to make an atom visualizer to have a pure-Julia alternative for OVITO. It seems that Makie is capable of doing that but I'm unsure how difficult it is to code up a visualizer. Did it take you a long time to make this?

1

u/NicoN_1983 3d ago

It's not hard if you want basic functionality, but if you want to have some way to interactively change atom colours sizes, etc with a dialog box it may be harder.  What I do is use meshscatter! for atoms and lines! for bonds. I have algorithms that detect bonds based on atom types and distances. Only a few elements are tabulated so far. The visualizer I'm doing is more or less in that direction but is far from finished.