M-TRACE: a MATLAB toolkit for animated raytracing based on scalable vector graphics illustration

Patrick Kilcullen, T. Ozaki, Jinyang Liang · Optics Continuum · 2025

Modern optical design and simulation software, while both powerful and feature-rich, requires significant training investment for effective use, even for simple optical design tasks. By contrast, software for two-dimensional (2D) non-sequential raytracing, while sufficient for many optical design tasks and popular for educational purposes, has remained without the benefit of mature computer-aided design (CAD) technologies that are now a key feature of software dedicated to three-dimensional (3D) optical design. To overcome this limitation, we introduce M-TRACE—an open source toolkit for non-sequential 2D raytracing with scripting-based customization and animation capabilities implemented in MATLAB. This toolkit allows users to specify optical designs using tools compatible with free-form 2D illustration via scalable vector graphics (SVG), analogous to the integration of 3D CAD technologies with enterprise optical design software. The intuitive and precise drawing features of SVG illustration software (e.g., Adobe Illustrator, Inkscape) allow for a straightforward means for the creation of system designs. We intend M-TRACE to complement the spectrum of available optical design software for research, development, and education, specifically targeting design cases requiring rich visualization and/or rapid exploration.

Read the paper · More papers on PaperTik