Skip to content

Commit

Permalink
Added reflection_threshold and transmission_threshold attributes to t…
Browse files Browse the repository at this point in the history
…he GeneralLens class
  • Loading branch information
bryancole committed Jun 16, 2022
1 parent 526c3dc commit 1e784a7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions raypier/general_optic.py
Expand Up @@ -58,6 +58,9 @@ class GeneralLens(BaseLens):
glass_colour = Tuple((204,204,255,102))
mirror_colour = Tuple((104,64,104,255))

###These are ignored for Mirror faces.
reflection_threshold = Float(0.1)
transmission_threshold = Float(0.1)


traits_view = View(Group(
Expand Down Expand Up @@ -221,7 +224,8 @@ def config_cfaces(self):
if face.mirror:
cface.material = PECMaterial()
else:
mat = CoatedDispersiveMaterial()
mat = CoatedDispersiveMaterial(reflection_threshold=self.reflection_threshold,
transmission_threshold=self.transmission_threshold)
mat.dispersion_inside = mats[i].dispersion_curve
mat.dispersion_outside = mats[i+1].dispersion_curve
if i in {0, len(surfaces)-1}:
Expand All @@ -233,7 +237,8 @@ def config_cfaces(self):
cfaces.append(face.cface)
self.faces.faces = cfaces

@observe("materials.items.dispersion_curve, coating_material.dispersion_curve, coating_thickness")
@observe("materials.items.dispersion_curve, coating_material.dispersion_curve, "
"coating_thickness, reflection_threshold, transmission_threshold")
def on_material_change(self, evt):
self.config_cfaces()
self.update = True
Expand Down

0 comments on commit 1e784a7

Please sign in to comment.