You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to design a lens from components where I have the zmax files for some elements but not for others. When mixing add_from_file() and add_surface() I notice that if I look at the generated sequential model, all the surfaces are correct, but if I look at the element model, the elements created by the add_surface()'s disappear.
In the below block of code I add a zemax file and then call add_surface() to add a lens:
Hello @i2pi ,
Thank you for the detailed report and yes, unfortunately, there's a problem with how ray-optics is moving changes from the sequential model to the element model. The optical model has a method to fix these problems called rebuild_from_seq.
0: Object (DummyInterface): Surface(lbl='Obj', profile=Spherical(c=0.0), interact_mode='dummy')
1: Object space (AirGap): Gap(t=10000000000.0, medium=<opticalglass.opticalmedium.Air object at 0x156f8e610>)
2: CE2 (CementedElement): CementedElement: [1, 2, 3]
3: AG2 (AirGap): Gap(t=5, medium=<opticalglass.opticalmedium.Air object at 0x156f8e610>)
4: E1 (Element): Element: Spherical(c=0.004), Spherical(c=-0.02), t=2.5000, sd=0.3544, glass: 670.420
5: Image space (AirGap): Gap(t=7, medium=<opticalglass.opticalmedium.Air object at 0x158981040>)
6: Image (DummyInterface): Surface(lbl='Img', profile=Spherical(c=0.0), interact_mode='dummy')
r t medium mode zdr sd
Obj: 0.000000 1.00000e+10 air 1 0.0000
1: 27.970000 9.50000 S-BAH11 1 12.000
2: -18.850000 2.50000 N-SF10 1 12.000
3: -152.940000 5.00000 air 1 12.000
4: 250.000000 2.50000 670.420 1 0.35442
5: -50.000000 7.00000 air 1 0.33430
Img: 0.000000 0.00000 1 0.20880
I've had several reports of problems of this kind and have been working on a more robust solution to how model changes of various kinds are handled. The solution I've come up with seems very solid, but not all (existing) test models pass yet.
Sorry for the trouble. Feel free to ask further questions.
Regards
Mike
I'm trying to design a lens from components where I have the zmax files for some elements but not for others. When mixing
add_from_file()
andadd_surface()
I notice that if I look at the generated sequential model, all the surfaces are correct, but if I look at the element model, the elements created by theadd_surface()
's disappear.In the below block of code I add a zemax file and then call add_surface() to add a lens:
In the output of
list_elements()
the manually added lens doesn't appear, but it does appear in the output oflist_model()
:As a sanity check, removing the
add_from_file()
code and then callinglist_elements()
shows the element correctly:Producing:
The text was updated successfully, but these errors were encountered: