Direkt zu




Baden-Württemberg Stiftung





twip optical solutions GmbH



Institut f. Technische Optik
Universität Stuttgart
Pfaffenwaldring 9
70569 Stuttgart

T: +49 (0)711/685-66074
F: +49 (0)711/685-66586



MacroSim is ITOs open source, GPU accelerated ray tracing engine. Originally developed for fast non-sequential stray light analysis of a spectrometer system [1], it offers the possibility to trace geometric rays sequentially and non sequentially with 64 bit floating point precision. Both tracing modes are fully parallelized either using a variable number of CPU cores or the massively parallel thread units of any nVidia graphics board with compute capability 1.1 or higher. Depending on the specifics of the optical system, that is being analyzed, acceleration factors of up to 100 have been observed comparing the tracing time of the GPU-mode to the CPU-mode [2].

We provide Open Source access under the LGPL license to the source code via BitBucket (link to https://bitbucket.org/itom/macrosim/ ). The source code is organized into two main projects. The first project encapsulates the actual tracing engine, that can either be compiled as an executable command line program or as a static library, that can be linked against a graphical user interface project. This GUI project (see figure 1 for a screenshot) is implemented as a dll for the measurement software project of our institute that is called itom. Itom is another Open Source project of our institute and can be found here (link to . In the meantime a windows installer can be found at our BitBucket repository (link to https://bitbucket.org/itom/itom/ ) as well. The development of the tracer engine has been based on nVidias cross platform application acceleration engine OptiX (link to http://www.nvidia.com/object/optix.html). It should therefore be transferable to linux systems. However it has been developed and tested so far on Windows 7 64bit systems only. The GUI-dll as well as the itom software is based on Qt (link to http://qt-project.org/) and is therefore platform independent as well.

Figure 1: Screenshot of the graphical user interface of the MacroSim-plugin for ITOs measurement-software itom.

Within the GUI of MacroSim, Sources, Geometries and Detectors can be added to the optical scene by double clicking on the respective item in the library tree view on the left. Once added, the items of the scene are listed in the scene tree view on the right. The parameters of these items can be set via the property editor in the lower right after the respective item has been selected by double clicking in the scene tree view. All changes to the optical scene are displayed in real time in the central widget of the GUI. The item that is currently selected in the property editor is highlighted in green. Refracting materials in MacroSim can be parametrized either by directly entering its refractive indices or by specifying its name in a Zemax (link to http://www.radiantzemax.com/en/zemax/) glass catalog, that can be loaded. After starting a simulation via the simulation menu or the run button in the tool bar, the optical scene is translated into a custom xml-format. This xml string is then passed to the tracing engine and the actual tracing is done in a separate thread. During the simulation, status messages of the tracing engine are printed to the status widget in the lower left of the GUI. The result of the simulation is returned as a data object to the itom software, where it can be further processed by means of the script language python3 (link to http://www.python.org/). If using the tracing engine as a standalone command line program, the xml description of the optical scene has to be provided via an appropriate file (the xml-file describing the lithography objective displayed in figure 1 can be viewed here as an example) and the result is stored into another file.

MacroSim is a project under development. It is very likely that a lot of bugs are still present in the code and the results of the tracing are not guaranteed to be correct. However, everybody is encouraged to participate in further developing the software and to contribute to a platform independent, fast and freely accessible ray tracing program for optical design and simulation.

  1. F. Mauch, D. Fleischle, W. Lyda, W. Osten, T. Krug, R. Häring, „Combining rigorous diffraction calculation and GPU accelerated nonsequential raytracing for high precision simulation of a linear grating spectrometer“, Proc. SPIE, 8083, 80830F-2 (2011).
  2. F. Mauch, M. Gronle, W. Lyda, W. Osten, „An open source GPU-accelerated ray tracer for optical simulation“, submitted for publication to Optical Engineering.