A python interface to zemax config .txt files to import and export prescription data
- Create some solidworks model with some arbitrary distance/angle mates (copy with mates is useful here for multiple configs)
- Select Zemax data and copy in to some .txt files, one for each config
- Run the a script similar to
docs/examples/m_minimal_multiconfig.pyto generate the equations .txt - In solidworks, import the .txt to the equations. Make sure you untick the "export" (first) column on import
- Set each mate to use the global variables and rebuild
- Every time you change zemax, repeat steps 2-3 and hit rebuild
tmp_zemax_to_text.py shows a simple example of how to automate the export from Zemax to the prescription .txt files.
Other applications are also shown in x_get_beam_angles.py and x_get_distances.py. The former shows how to measure some angles without needing solidworks or zemax open (useful for quick checks). The latter shows how to get distances along the beam, with this particular example showing how to compute the effect of motor motions on the beam (and hence make move_image and move_pupil commands).