rayoptics.zemax.zmxread module
- read_lens_file(filename, **kwargs)[source]
given a Zemax .zmx filename, return an OpticalModel
It appears that Zemax .zmx files are written in UTF-16 encoding. Test against what seem to be common encodings. If other encodings are used in ‘files in the wild’, please add them to the list.
- Parameters:
filename (pathlib.Path) – a Zemax .zmx file path
kwargs (dict) – keyword args passed to the reader functions
- Returns:
an OpticalModel instance and a info tuple
- read_lens(filename, inpt, **kwargs)[source]
given inpt str of a Zemax .zmx file, return an OpticalModel
- class ZmxGlassHandler(filename)[source]
Bases:
GlassHandlerBase
Handle glass restoration during Zemax zmx import.
This class relies on GlassHandlerBase to provide most of the functionality needed to find the requested glass or a substitute.