orbit_on_path

Plotter.orbit_on_path(path=None, focus=None, step=0.5, viewup=None, write_frames=False, threaded=False, progress_bar=False)

Orbit on the given path focusing on the focus point.

Parameters
pathpyvista.PolyData

Path of orbital points. The order in the points is the order of travel.

focuslist(float) of length 3, optional

The point of focus the camera.

stepfloat, optional

The timestep between flying to each camera position.

viewuplist(float), optional

The normal to the orbital plane.

write_framesbool, optional

Assume a file is open and write a frame on each camera view during the orbit.

threadedbool, optional

Run this as a background thread. Generally used within a GUI (i.e. PyQt).

progress_barbool, optional

Show the progress bar when proceeding through the path. This can be helpful to show progress when generating movies with off_screen=True.

Examples

Plot an orbit around the earth. Save the gif as a temporary file.

>>> import tempfile
>>> import os
>>> import pyvista
>>> filename = os.path.join(tempfile._get_default_tempdir(),
...                         next(tempfile._get_candidate_names()) + '.gif')
>>> from pyvista import examples
>>> plotter = pyvista.Plotter(window_size=[300, 300])
>>> _ = plotter.add_mesh(examples.load_globe(), smooth_shading=True)
>>> plotter.open_gif(filename)
>>> viewup = [0, 0, 1]
>>> orbit = plotter.generate_orbital_path(factor=2.0, n_points=24,
...                                       shift=0.0, viewup=viewup)
>>> plotter.orbit_on_path(orbit, write_frames=True, viewup=viewup, 
...                       step=0.02)

See Orbiting for a full example using this method.

../../../_images/pyvista-Plotter-orbit_on_path-1_00_00.gif