Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📽️ OVITO Rendering Pipeline for Molecular Trajectories

This pipeline batch-renders .xyz trajectory files using OVITO from two perspectives:

  • Top view (looking down Z)
  • 45° front view (XY diagonal)

Each trajectory is rendered in an isolated subprocess to avoid memory leaks and global state issues.

📁 Folder Structure

create_avi_movies_spectroscopies/
├── pp_xyz_movies/              # Input .xyz files
│   ├── movie_S1_h2o_top_o_hb.xyz
│   ├── ...
├── rendered_movies/            # Output .avi files
│   ├── movie_S1_h2o_top_o_hb_top.avi
│   ├── movie_S1_h2o_top_o_hb_front.avi
├── render_one.py               # Renders one trajectory
├── main_render.py              # Loops over and renders all trajectories

🧪 Environment Setup

Always follow the official installation instructions when available.

1. Create a clean environment

conda create -n render_ovito python=3.10
conda activate render_ovito

2. Install OVITO properly (important!)

conda install --strict-channel-priority \
  -c https://conda.ovito.org \
  -c conda-forge \
  ovito=3.12.3

3. (Optional) Add support for Jupyter + ASE

conda install -c conda-forge ase ipython jupyterlab

▶️ How the Code Works

main_render.py

  • Cleans rendered_movies/ (removes files only)
  • Creates TMP/ folder inside pp_xyz_movies/
  • For each .xyz file:
    • Copies it into a temp folder
    • Calls render_one.py as a subprocess
    • Moves resulting movies to rendered_movies/

render_one.py

  • Loads the trajectory using OVITO
  • Hides the simulation cell
  • Renders two perspectives:
    • Top view: camera_dir = (0, 0, -1)
    • Front view: camera_dir = (-1, 1, 0)
  • Uses TachyonRenderer for ray-traced images

✅ Notes

  • Output format is .avi
  • Rendering is sandboxed to avoid OVITO bugs
  • Tested with OVITO 3.12.3 from official channel

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages