pyvista.Camera

Contents

pyvista.Camera#

class Camera(renderer=None)[source]#

PyVista wrapper for the VTK Camera class.

Parameters:
rendererpyvista.Renderer, optional

Renderer to attach the camera to.

Examples

Create a camera at the pyvista module level.

>>> import pyvista as pv
>>> camera = pv.Camera()

Access the active camera of a plotter and get the position of the camera.

>>> pl = pv.Plotter()
>>> pl.camera.position
(1.0, 1.0, 1.0)
../../../_images/pyvista-Camera-1_00_00.png

Methods

Camera.copy()

Return a deep copy of the camera.

Camera.disable_parallel_projection()

Disable the use of parallel projection.

Camera.enable_parallel_projection()

Enable parallel projection.

Camera.from_paraview_pvcc(filename)

Load a Paraview camera file (.pvcc extension).

Camera.reset_clipping_range()

Reset the camera clipping range based on the bounds of the visible actors.

Camera.tight([padding, ...])

Adjust the camera position so that the actors fill the entire renderer.

Camera.to_paraview_pvcc(filename)

Write the camera parameters to a Paraview camera file (.pvcc extension).

Camera.view_frustum([aspect])

Get the view frustum.

Camera.zoom(value)

Set the zoom of the camera.

Attributes

Camera.azimuth

Return or set the azimuth of the camera.

Camera.clipping_range

Return or set the location of the clipping planes.

Camera.direction

Vector from the camera position to the focal point.

Camera.distance

Return or set the distance of the focal point from the camera.

Camera.elevation

Return or set the vertical rotation of the scene.

Camera.focal_point

Location of the camera's focus in world coordinates.

Camera.is_set

Get or set whether this camera has been configured.

Camera.model_transform_matrix

Return or set the camera's model transformation matrix.

Camera.parallel_projection

Return the state of the parallel projection.

Camera.parallel_scale

Return or set the scaling used for a parallel projection.

Camera.position

Return or set the position of the camera in world coordinates.

Camera.roll

Return or set the roll of the camera about the direction of projection.

Camera.thickness

Return or set the distance between clipping planes.

Camera.up

Return or set the "up" of the camera.

Camera.view_angle

Return or set the camera view angle.