Beispiel #1
0
 def __init__(self, refractive_index: np.ndarray,
              absorption_coefficient: np.ndarray):
     super(LossyDielectric, self).__init__(absorption_coefficient,
                                           refractive_index)
     self._transit_mechanism = FresnelRefraction()
     self._return_mechanism = FresnelReflection()
     self._path_mechanism = Absorption()
     self._emit_mechanism = None
Beispiel #2
0
 def __init__(self, refractive_index: np.ndarray, lumophores: [Lumophore]):
     super(Host, self).__init__(
         refractive_index=refractive_index,
         lumophores=lumophores
     )
     self._transit_mechanism = FresnelRefraction()
     self._return_mechanism = FresnelReflection()
     self._path_mechanism = Absorption()
     self._emit_mechanism = Emission()
Beispiel #3
0
 def test_normal_reflection(self):
     n1 = 1.0
     n2 = 1.5
     normal = (0.0, 0.0, 1.0)
     angle = 0.0
     ray = Ray(position=(0.0, 0.0, 0.0),
               direction=(0.0, 0.0, 1.0),
               wavelength=None)
     fresnel = FresnelReflection()
     assert np.isclose(fresnel.reflectivity(angle, n1, n2), 0.04)
     new_ray = fresnel.transform(ray, {"normal": normal})
     assert np.allclose(flip(ray.direction), new_ray.direction)
Beispiel #4
0
 def test_antinormal_reflection(self):
     """ FresnelReflection takes the smallest angle between the ray direction and 
     the normal. Thus the flipped normal will also work.
     """
     n1 = 1.0
     n2 = 1.5
     normal = (0.0, 0.0, -1.0)
     angle = 0.0
     ray = Ray(position=(0.0, 0.0, 0.0),
               direction=(0.0, 0.0, 1.0),
               wavelength=None)
     fresnel = FresnelReflection()
     assert np.isclose(fresnel.reflectivity(angle, n1, n2), 0.04)
     new_ray = fresnel.transform(ray, {"normal": normal})
     assert np.allclose(flip(ray.direction), new_ray.direction)
Beispiel #5
0
 def __init__(self, refractive_index):
     super(Dielectric, self).__init__(refractive_index)
     self._transit_mechanism = FresnelRefraction()
     self._return_mechanism = FresnelReflection()
     self._path_mechanism = TravelPath()
     self._emit_mechanism = None
Beispiel #6
0
 def test_init(self):
     assert type(FresnelReflection()) == FresnelReflection