pygfx.objects.Volume

class pygfx.objects.Volume(geometry=None, material=None, *, visible=True, render_order=0, render_mask='auto', name='')

Bases: WorldObject

A 3D image.

The geometry for this object consists only of geometry.grid: a texture with the 3D data.

The picking info of a Volume (the result of renderer.get_pick_info()) will for most materials include index (tuple of 3 int), and voxel_coord (tuple of float subpixel coordinates).

Parameters:
  • geometry (Geometry) – The data defining the shape of the object.

  • material (Material) – The data defining the appearance of the object.

  • visible (bool) – Whether the object is visible.

  • render_order (int) – The render order (when applicable for the renderer’s blend mode).

  • render_mask (str) – Determines the render passes that the object is rendered in. It’s recommended to let the renderer decide, using “auto”.

  • position (Vector) – The position of the object in the world. Default (0, 0, 0).

Examples

Isosurface Volume Rendering

Isosurface Volume Rendering

Minip Volume Rendering

Minip Volume Rendering

Bounding Box Coordinates

Bounding Box Coordinates

Volume Rendering 2

Volume Rendering 2

Volume Slice 3

Volume Slice 3

Volume Rendering 1

Volume Rendering 1

Mesh and Volume Slicing 2

Mesh and Volume Slicing 2

Volume and Volume Slice Rendering

Volume and Volume Slice Rendering