visisipy.plots#

Visualization tools for Visisipy.

Functions#

plot_eye(→ matplotlib.axes.Axes)

Plot an eye.

Module Contents#

visisipy.plots.plot_eye(ax: matplotlib.axes.Axes, geometry: visisipy.models.EyeModel | visisipy.models.EyeGeometry, lens_edge_thickness: float = 0.0, retina_cutoff_position: float | None = None, backend: visisipy.backend.BackendType | None = None, **kwargs) matplotlib.axes.Axes#

Plot an eye.

Plot an eye with geometric parameters specified by an EyeGeometry object. The eye is oriented along the horizontal axis. The location of the origin depends on the reference surface of the backend:

  • For OpticStudio, the origin is at the pupil, so the eye is plotted with the pupil at x=0.

  • For Optiland, the origin is at the anterior cornea, so the cornea apex is plotted at x=0.

Additional translations and rotations can be applied using matplotlib patch transforms. The axis limits are automatically adjusted to fit the eye geometry with some padding, and the aspect ratio is set to equal.

Parameters:
axmatplotlib.pyplot.Axes

Matplotlib axes on which the eye will be drawn.

geometryEyeGeometry

Specification of the eye’s geometrical parameters.

lens_edge_thicknessfloat

Thickness of the lens at its edge, defaults to 0. If specified, the lens will be cut off at the point where its thickness equals this value.

retina_cutoff_positionfloat

Location to which the retina should be drawn. Defaults to the lens’s posterior apex. For a value of 0, the cutoff is located at the pupil.

backendBackendType | None

Type of the backend to determine the reference surface for the plot. If None, uses the current backend.

kwargs

Additional keyword arguments are passed to the PathPatch constructor, allowing customization of the plot.

Returns:
matplotlib.pyplot.Axes

Modified axes with the eye plot

Raises:
ValueError

If lens_edge_thickness is less than 0 or retina_cutoff_position is located behind the retina.