visualization.system.lens

Lens Visualization Module

This module contains classes for visualizing lenses in 2D and 3D.

Kramer Harrison, 2024

Classes

Lens2D(surfaces)

A class to represent a 2D lens and provide methods for plotting it.

Lens3D(surfaces)

A class used to represent a 3D Lens, inheriting from Lens2D.

class Lens2D(surfaces)[source]

A class to represent a 2D lens and provide methods for plotting it.

Parameters:

surfaces (list) – A list of surface objects that make up the lens.

surfaces

A list of surface objects that make up the lens.

Type:

list

plot(ax)[source]

Plots the lens on the given matplotlib axis.

plot(ax, theme=None, projection='YZ')[source]

Plots the lens on the given matplotlib axis.

Parameters:
  • ax (matplotlib.axes.Axes) – The matplotlib axis on which the lens will be plotted.

  • theme (Theme, optional) – The theme to use for plotting. Defaults to None.

  • projection (str, optional) – The projection plane. Must be ‘XY’, ‘XZ’, or ‘YZ’. Defaults to ‘YZ’.

class Lens3D(surfaces)[source]

A class used to represent a 3D Lens, inheriting from Lens2D.

Parameters:

surfaces (list) – A list of surfaces that make up the lens. Each element is expected to be an object (e.g., Surface3D) that has a surf attribute (the actual Surface object) and an extent attribute.

surfaces

A list of surfaces that make up the lens.

Type:

list

is_symmetric()

Checks if the lens is rotationally symmetric.

plot(renderer)[source]

Plots the lens using the given VTK renderer.

property is_symmetric

Check if all surfaces in the lens are symmetric.

This method iterates through each surface in the lens and checks if the geometry of the surface is symmetric. A surface is considered symmetric if its geometry’s is_symmetric attribute is True and both rx and ry attributes of its coordinate system (cs) are zero.

Returns:

True if all surfaces are symmetric, False otherwise.

Return type:

bool

plot(renderer, theme=None, *args, **kwargs)[source]

Plots the lens or surfaces using the provided renderer.

Parameters:
  • renderer – The rendering engine used to plot the lens or surfaces.

  • theme (Theme, optional) – The theme to use for plotting. Defaults to None.