viz3dvideo.surf package

Submodules

viz3dvideo.surf.path module

viz3dvideo.surf.path.animate_path(X, Y, Z, camera_points, output_path='animate_path.mp4', pixel_size=(1920, 1080), dpi=200, colormap='viridis', frames=360, fps=30, cb_enable=False, cb_title='Z')

Creates and saves a 3D animation of the surface Z = f(X, Y) following a camera path defined by camera_points.

Parameters:
  • X (array-like) – 2D array of X coordinates of the surface.

  • Y (array-like) – 2D array of Y coordinates of the surface.

  • Z (array-like) – 2D array of Z values of the surface.

  • camera_points (list of tuple) – List of (elev, azim) tuples defining the camera path.

  • frames (int, optional) – Total number of frames in the animation. Default is 360.

  • pixel_size (tuple, optional) – Figure size in pixels (width, height). Default is (1920, 1080).

  • dpi (int, optional) – Figure resolution in dots per inch. Default is 100.

  • colormap (str, optional) – Colormap for the surface. Default is ‘viridis’.

  • output_path (str, optional) – Output file name. Default is ‘animate_path.mp4’.

  • fps (int, optional) – Frames per second for the video. Default is 30.

Returns:

None

viz3dvideo.surf.rotate module

viz3dvideo.surf.rotate.animate_rotate(X, Y, Z, output_path='animate_rotate.mp4', pixel_size=(1920, 1080), dpi=200, colormap='viridis', frames=360, fps=30, cb_enable=False, cb_title='Z', elev=30, interval=0.5)

Creates and saves a 3D animation of the surface Z = f(X, Y).

Parameters:
  • X (array-like) – 2D array of X coordinates of the surface.

  • Y (array-like) – 2D array of Y coordinates of the surface.

  • Z (array-like) – 2D array of Z values of the surface.

  • output_path (str, optional) – Output file name. Default is ‘animate_rotate.mp4’.

  • pixel_size (tuple, optional) – Figure size in pixels (width, height). Default is (1920, 1080).

  • dpi (int, optional) – Figure resolution in dots per inch. Default is 100.

  • colormap (str, optional) – Colormap for the surface. Default is ‘viridis’.

  • elev (float, optional) – Initial elevation of the camera. Default is 30.

  • frames (int, optional) – Total number of frames in the animation. Default is 360.

  • interval (float, optional) – Angle interval between frames in degrees. Default is 1.0.

  • fps (int, optional) – Frames per second for the video. Default is 30.

  • cb_enable (bool, optional) – Enable colorbar. Default False.

  • cb_title (str, optional) – Title of colorbar. Default “Z”.

Returns:

None

Module contents

viz3dvideo.surf

Subpackage for 3D surface visualizations.

Provides functions to animate 3D surfaces (Z = f(X, Y)). You can either rotate the camera around the surface or follow a custom camera path.

Available functions:

  • animate_rotate(X, Y, Z, …) : Create a rotating 3D surface animation.

  • animate_path(X, Y, Z, camera_points, …) : Animate a surface following a camera path.

Example usage:

from viz3dvideo.surf import animate_path

animate_path(X, Y, Z, camera_points=[(30,0),(45,90)])