Skip to content

indranilsinharoy/zArrayTrace

Repository files navigation

Experimental code in development for array ray tracing in Zemax from Python.


UPDATE:
======
The array tracing functions have been implemented as a separate module in PyZDDe 
in the branch https://github.com/indranilsinharoy/PyZDDE/tree/arrayTraceUsingZclient. 
The code is currently undergoing more tests, and will soon be integrated into PyZDDE master.

There is also a simple example in the Examples/Scripts/ folder called "arrayTraceSimple.py" (in the above branch).


The code is completely experimental at this stage at the moment. The essential
idea is to use ctypes to create an interface for array ray tracing from
the example code (zclient.c and ArrayDemo.c) provided by Zemax. 

The main files are arrayTraceClient.c, arrayTraceClient.h and arrayTraceClient.py.

Refer to the file "Information.txt" for details on the Visual Studio project
configurations I have used to build the dll.

Things that are currently working
=================================
1. Able to do array ray tracing (independent of PyZDDE). The output matches
   the output of ArrayDemo.c example that comes with Zemax, using the 
   lens file Cooke 40 degree field.zmx. The output of ArrayDemo.c is in the
   file arrayDemoRef.txt. The output of the Python function replicateArrayDemo()
   is in the file arrayDemo.txt 
2. Improved the Python interface for calling array ray tracing.
3. Built both 32 bit and 64 bit dlls and tested on other machines.
5. Removed unnecessary code from arrayTraceClient.c


Credits
=======
The following people deserves special credit (even if we don't end up using
this code). Ian sent me a working code for tracing large number of rays 
sometime back, which gave me some crucial ideas about the implementation. 
Julian, who was also successful in implementing array ray tracing using 
ctypes, communicated several ideas with me about the implementation. 

1. Ian Rousseau
2. Julian Stürmer

License
=======
The MIT License (MIT)

About

Experimental code for bulk ray tracing in Zemax using Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published