The scientific visualization toolbox (SVT) is a Python package that contains a collection of tools for creating static and interactive renderings and dashboards for scientific visualization purposes.
-
uv for dependency management.
-
POV-Ray — SVT generates POV-Ray scene scripts and shells out to the
povraybinary to render them, so it must be installed separately and available on yourPATH.- Debian/Ubuntu:
sudo apt install povray - macOS:
brew install povray - Windows: download an installer from the POV-Ray downloads page
Any POV-Ray 3.6+ install works.
- Debian/Ubuntu:
-
FFmpeg — after rendering per-frame PNGs, SVT calls
ffmpegto stitch them into a video, so it also needs to be on yourPATH.- Debian/Ubuntu:
sudo apt install ffmpeg - macOS:
brew install ffmpeg - Windows: download a build from gyan.dev or ffmpeg.org/download.html and add the
binfolder to yourPATH
SVT encodes videos as ProRes 4444 (
.mov, with an alpha channel viayuva444p10le) to preserve transparency for compositing. Standard FFmpeg builds from the sources above includeprores_kssupport out of the box; no extra build flags are needed. - Debian/Ubuntu:
git clone https://github.com/Ali-7800/SVT.git
cd svt
uv syncThis installs SVT and its dependencies into a local .venv managed by uv. Run any script or the test suite through uv run, e.g.:
uv run python my_scene.pyA minimal example: build a scene, add a camera and light, drop in a couple of primitives with different textures, and render it.
from svt import Scene, Sphere, Plane
scene = Scene()
scene.background.color = [0.02, 0.02, 0.05, 0]
camera_id = scene.add_camera(
name="main",
location=[0, 5, -14],
angle=50,
look_at=[0, 1, 0],
)
scene.add_light(location=[-8, 12, -10], color=[1, 1, 1])
ground = Plane("ground", normal=[0, 1, 0], distance=-1)
ground.color = [0.6, 0.6, 0.6]
scene.append(ground)
sphere = Sphere("sphere", position=[0, 1, 0], radius=1)
sphere.color = [0.2, 0.6, 0.9]
sphere.finish.metallic = True
sphere.finish.reflection = 0.4
scene.append(sphere)
if __name__ == "__main__":
scene.render_frames(
output_images_directory="",
times=[0],
name="Frame",
)
- Primitives:
Sphere,Cylinder,Cone,Plane,SphereSweep,Mesh - Stage:
Scene(cameras, lights, and the objects to render)
Every object supports a shared texture/finish API:
color,transmit— base pigmentimage_map— UV/planar/spherical/cylindrical/torus image texturesbump_map— normal mappingfinish—ambient,diffuse,specular,roughness,phong,metallic,reflection,iridescence, and related parameters
Most numeric attributes accept either a static value or a time-varying callable, so scenes can be animated across frames.
TBD.