gradoptics.optics.mirror

class gradoptics.optics.mirror.BaseMirror(transform=None)

Bases: gradoptics.optics.base_optics.BaseOptics

__init__(transform=None)
Parameters

transform – Transform to orient the mirror (BaseTransform)

intersect(incident_rays, t)

Returns the ray reflected by the mirror :param incident_rays: :param t: :return:

class gradoptics.optics.mirror.FlatMirror(x_mirror, y_mirror, z_mirror, normal, mirror_radii)

Bases: gradoptics.optics.mirror.BaseMirror

Models a flat mirror.

__init__(x_mirror, y_mirror, z_mirror, normal, mirror_radii)
Parameters
  • x_mirror – Position of the center of the mirror along the x axis (float)

  • y_mirror – Position of the center of the mirror along the y axis (float)

  • z_mirror – Position of the center of the mirror along the z axis (float)

  • normal – Normal of the mirror (torch.tensor)

  • mirror_radii – Radii of the mirror (float)

get_ray_intersection(incident_rays, eps=1e-15)

Computes the times t at which the incident rays will intersect the object.

Parameters

incident_rays – The incident rays (Rays)

Returns

Times t (torch.tensor)

plot(ax, show_normal=False, s=0.1, color='lightblue', resolution=100)

Plots the optical element on the provided axes.

Parameters

ax – 3d axes (mpl_toolkits.mplot3d.axes3d.Axes3D)

class gradoptics.optics.mirror.CurvedMirror(R, width, height, transform)

Bases: gradoptics.optics.mirror.BaseMirror

__init__(R, width, height, transform)
Parameters

transform – Transform to orient the mirror (BaseTransform)

get_ray_intersection(incident_rays, eps=1e-15)

Computes the times t at which the incident rays will intersect the object.

Parameters

incident_rays – The incident rays (Rays)

Returns

Times t (torch.tensor)

plot(ax, show_normal=False, s=0.1, color='lightblue', resolution=100)

Plots the optical element on the provided axes.

Parameters

ax – 3d axes (mpl_toolkits.mplot3d.axes3d.Axes3D)