VTK volume rendering of an asteroid impacting the ocean. The dataset comes
from LANL's Deep Water Asteroid Impact ensemble. See
docs/MeaningOfDataAsteroid.pdf for
details on the simulated scalars (v02, v03, tev, prs).
The full-quality video is at media/asteroidRendering.mp4.
The simulation timesteps aren't included in the repo (too large). Grab them
from LANL's Deep Water Impact Ensemble
and drop the .vti files into Data/. Each scalar means:
v02: water volume fractionv03: asteroid volume fractiontev: temperatureprs: pressure
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
pip install -r requirements.txtThere are two kinds of scripts here. The Asteroid*.py files are
interactive PyQt5 viewers that let you tune the look of one scalar at a
time on a single VTI file. FolderRendering.py is the batch renderer that
loops over a whole folder of VTI timesteps and writes out PNG frames using
the tuned settings hardcoded in its DataStructure dict.
Each one opens a PyQt5 window with sliders for the transfer function of a single scalar.
| Script | Scalar(s) | Usage |
|---|---|---|
AsteroidV02.py |
water (v02) |
python AsteroidV02.py path/to/timestep.vti |
AsteroidTev.py |
temperature (tev) |
python AsteroidTev.py path/to/timestep.vti |
AsteroidPrs.py |
pressure (prs) |
python AsteroidPrs.py path/to/timestep.vti |
AsteroidIso.py |
isosurface of v02 + prs |
python AsteroidIso.py prs.vti v02.vti data.vti |
AsteroidsCombined.py |
all three combined | python AsteroidsCombined.py prs.vti tev.vti v02.vti data.vti head.vti |
Common flags: -r W H (resolution), -o NAME (frame screenshot prefix),
-v (verbose).
FolderRendering.py is what produced the video. It walks a directory of
VTI timesteps, renders each one with the asteroid, water, and temperature
volumes composited together, and writes sequentially numbered PNGs
(0.png, 1.png, ...) to an output folder.
python FolderRendering.py "path/to/folder/of/vti/timesteps" --output frames/Once that finishes, encode the frames with ffmpeg:
ffmpeg -framerate 30 -i %d.png -c:v libx264 -pix_fmt yuv420p output.mp4.
├── FolderRendering.py # batch renderer (produces video frames)
├── AsteroidV02.py # interactive: water
├── AsteroidTev.py # interactive: temperature
├── AsteroidPrs.py # interactive: pressure
├── AsteroidIso.py # interactive: isosurface
├── AsteroidsCombined.py # interactive: all scalars
├── Data/ # VTI timesteps go here (gitignored)
├── docs/
│ └── MeaningOfDataAsteroid.pdf
├── media/
│ ├── asteroidRendering.gif # preview embedded above
│ └── asteroidRendering.mp4 # full video
├── requirements.txt
└── README.md
