visualization.system.optic_viewer_3d

OpticViewer3D: A class for visualizing optical systems in 3D. This module provides the OpticViewer3D class, which extends the BaseViewer class to visualize optical systems using VTK for 3D rendering. It allows for ray tracing and system representation in a 3D space, enabling interactive exploration of optical components and ray paths.

Kramer Harrison, 2024

re-worked by Manuel Fragata Mendes, june 2025

Classes

OpticViewer3D(optic)

A class used to visualize optical systems in 3D.

class OpticViewer3D(optic)[source]

A class used to visualize optical systems in 3D.

Parameters:

optic – The optical system to be visualized.

optic

The optical system to be visualized.

rays

An instance of Rays3D for ray tracing.

system

An instance of OpticalSystem for system representation.

ren_win

The vtkRenderWindow object for visualization.

iren

The vtkRenderWindowInteractor object for interaction.

view(fields='all', wavelengths='primary', num_rays=24,

distribution=’ring’, figsize=(1200, 800), dark_mode=False):

Visualizes the optical system in 3D.

view(fields='all', wavelengths='primary', num_rays=24, distribution='ring', figsize=(1200, 800), dark_mode=False, reference=None, hide_vignetted=False)[source]

Visualizes the optical system in 3D.

Parameters:
  • fields (str, optional) – The fields to be visualized. Defaults to ‘all’.

  • wavelengths (str, optional) – The wavelengths to be visualized. Defaults to ‘primary’.

  • num_rays (int, optional) – The number of rays to be visualized. Defaults to 24.

  • distribution (str, optional) – The distribution of rays. Defaults to ‘ring’.

  • figsize (tuple, optional) – The size of the figure. Defaults to (1200, 800).

  • dark_mode (bool, optional) – Whether to use dark mode. Defaults to False.

  • reference (str, optional) – The reference rays to plot. Options include “chief” and “marginal”. Defaults to None.

  • hide_vignetted (bool, optional) – If True, rays that vignette at any surface are not shown. Defaults to False.