optrace (OPtics rayTRACEr) is a scripting based optics simulation package, developed at the Institute for Applied Optics and Electronics at the TH Köln - University of Applied Science in Cologne, Germany. It features sequential raytracing, image rendering capabilities and a graphical user interface. This tool is designed with a focus on image simulation with accurate color handling, differentiating it from other raytracers that may prioritize engineering workflows.
optrace is suitable for educational purposes, enabling the creation of interactive applications with custom user interfaces through Python scripting and comprehensive documentation. Its interactive 3D scene viewer allows for hands-on exploration of optical principles.
Furthermore, optrace's automation features and extensibility, including support for custom surfaces and materials, make it a viable tool for research applications.
Features
- Free and open source software
- Programming/scripting approach to simulation
- Sequential raytracing for geometrical optics
- Rendering of colored detector images
- Paraxial analysis (matrix optics, cardinal points/planes and PSF convolution)
- Includes preset and user-definable surface shapes, ray sources, and media
- An additional GUI with an interactive 3D scene viewer
- Automation capabilities
- High performance of 85 ms / surface / million rays (details)
- Comprehensive documentation
Limitations
- Coding-free simulations are not supported
- Wave optics effects such as diffraction and interference are not included
- No non-sequential raytracing for simulating ghost images and reflections
- Mirror or fresnel lens optics are not supported
- No modelling of scattering effects or polarization-dependent media
- No functionality for lens optimization, aberration analysis, and tolerancing
Purpose/Use Cases
- Educational purposes, demonstrating aberrations or simple optical setups
- Introductory tool to paraxial, geometrical optics or image formation
- Simulation of simpler systems: Prism, eye model, telescope, ...
- Estimation of effects where professional software (ZEMAX, OSLO, Quadoa, ...) is overkill for
The Documentation includes examples, usage information, technical details, and an API reference.
The documentation features an Example Gallery that covers a large range of applications.
Installing the latest official release
- Make sure python and pip are installed
- Download the optrace-xxxx.tar.gz archive from the latest release
- Open a terminal and run
pip install <archive>
, where<archive>
is the path to the downloaded file
Installing the latest git version
- Make sure python and pip are installed
- Open a terminal and run
pip install "optrace @ git+https://github.com/drocheam/optrace.git"
More information are provided in the Documentation. This project is not affiliated with a package of the same name on PyPI.
If you encounter any bugs, have feature requests, or want to suggest improvements, please open an issue or pull request. Documentation on testing, packaging and other technical details is located here.
This project is published under the MIT License.
-
Geometrical Optics
- RayOptics by Michael Hayford. Tracing and optical design analysis tool.
- rayopt by QUARTIQ. Tracing and optical design analysis tool.
- RayTracing by DCC-Lab. Paraxial raytracer with beampath visualization.
- Optiland by Harrison Kramer. Optical design and analysis framework.
-
Wave Optics
- diffractsim by Rafael de la Fuente. Wave optics simulation of arbitrary apertures and phase holograms.
- poppy by Space Telescope Science Institute. Fraunhofer and Fresnel propagation for optics.
- prysm by Brandon Dube. Interferometer and diffraction calculations.
-
Geometrical + Wave Optics