gradoptics.optics.base_optics
- class gradoptics.optics.base_optics.BaseOptics
Bases:
abc.ABC
Base class for optical elements.
- abstract get_ray_intersection(incident_rays)
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
)
- abstract intersect(incident_rays, t)
Returns the rays reflected or refracted by the optical element.
- Parameters
incident_rays – The incident rays (
Rays
)t – The times at which the incident rays will intersect the optical element (
torch.tensor
)
- Returns
(
tuple
) - Reflected or refracted rays (Rays
) - A boolean mask that indicates which incident rays were reflected or refracted ― some rays may not bereflected or refracted for example, due to total internal reflection, which is not modelled at this point (
torch.tensor
)
- abstract plot(ax)
Plots the optical element on the provided axes.
- Parameters
ax – 3d axes (
mpl_toolkits.mplot3d.axes3d.Axes3D
)