This optics manager behaves similarly to the ReflectiveReceiver class, but adds directionality. In this way a simple one-side receiver doesn’t necessitate an extra surface in the back.
This optics manager remembers all of the locations where rays hit it in all iterations, and the energy absorbed from each ray.
Arguments
Aggregate all hits from all stages of tracing into joined arrays.
Returns
Clear the memory of hits (best done before a new trace).
A wrapper around AbsorptionAccountant with LambertianReflector optics
Represents the optics of an ideal diffuse (lambertian) surface, i.e. one that reflects rays in a random direction (uniform distribution of directions in 3D, see tracer.sources.pillbox_sunshape_directions)
Generates a function that represents the optics of an opaque, absorptive surface with specular reflections.
Arguments
Returns
A wrapper around AbsorptionAccountant with a Reflective optics
Represents the optics of a surface bordering homogenous media with constant refractive index on each side. The specific index in which a refracted ray moves is determined by toggling between the two possible indices.
Arguments
n1, n2 - scalars representing the homogenous refractive index on each side of the surface (order doesn’t matter).
Determines which refractive index to use based on the refractive index rays are currently travelling through.
Arguments
Returns
An array of length(n) with the index to use for each ray.