Does anyone have (preferably Matlab) code that cycles through global optimization output files and compiles custom outputs? For example, I’d like to save out 2d layout images for each file as a quick way to identify interesting design forms rather individually opening each file.
Compile global optimization output files
Best answer by MichaelH
Hi John,
I don’t have Matlab code, but I do have a ZPL script which will cycle through all *.zmx files in a selected directory, save the 3D Layout and extract some basic information about the lenses (saved in an XML format). The only things to make sure before running the code is:
- Your files are either sequential or mixed mode (it doesn’t work with non-sequential files...I don’t know if it will skip the files or if it will crash since I haven’t tested with NSQ files)
- You have your L3D.cfg file saved from your 3D Layout window. You can make sure you have your ray pattern, fields, wavelengths, etc setup as well so the saved layouts will be what you’re expecting.
The outputs are in an XML format which you can use to input into other programs for more analysis. The data generated includes basic inputs like min/max fields, min/max/primary wavelengths, EPDI, ENPP, EXPD, EXPP, EFFL, WFNO, TOTR, number of surfaces, 3rd order wavefront coefficients, geometric/rms spot size, geometric/rms wavefront error, and Hy=[0, 0.707, 1] for 30lp/mm & 50lp/mm MTF.
To make the XML file more useful, you can use Excel to import the XML file and make it more into a 2D table format.

Ideally, the Design Templates would be updated to allow for a user to generate the images/data from custom locations, but I don’t think this is on the roadmap.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.