Commit b9899826 authored by Daniel Brown's avatar Daniel Brown

Fixing lens ABCD when setting diopters to zero

parent 18da7346
...@@ -1440,6 +1440,9 @@ class lens(Component): ...@@ -1440,6 +1440,9 @@ class lens(Component):
if self.f.value is not None: if self.f.value is not None:
return ABCD.lens(self.f.value) return ABCD.lens(self.f.value)
else:
if self.p.value == 0:
return ABCD.lens(np.inf)
else: else:
return ABCD.lens(1/self.p.value) return ABCD.lens(1/self.p.value)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment