Skip to content

About

A C++ port of Beam42 / ray-optics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RayOptics-Cpp

This is a C++ port of Beam42 and Michael Hayford's RayOptics. The functionality of this port is almost identical to Beam42's RayOptics component. For full details please refer to that project. Differences are noted below.

Executables

  • LensTool2 as documented in LensTool2. See exceptions below.
  • An optimization run is driven from [trial n] and [pipeline n] sections of the prescription, as documented in Optimizer; --optimize n runs one.

Building

The build uses CMake and a C++20 compiler, and needs no third-party dependencies beyond the bundled Ryu.

cmake -S . -B build
cmake --build build --config Release
ctest --test-dir build -C Release

Single-configuration generators (Makefiles, Ninja) default to a Release build. Multi-configuration generators such as Visual Studio need the configuration given explicitly, as above.

The tests read the prescriptions under Examples/. The optimizer solve tests are slow and off by default; set RAYOPTICS_RUN_SLOW_TESTS=1 to run them.

Differences from Beam42

  • The LensTool2 utility does not support obtaining prescriptions directly from PhotonsToPhotos Optical Bench.
  • Michael Lampton's BeamFour product is not included.
  • Some utilities used during development and verification are not included.

Porting Strategy

  • Beam42 remains the primary development project. Development occurs there first and is then ported here.
  • The C++ port was created using Claude and Codex and aims to be a faithful replica of the Java version, except for details such as memory management.
  • The performance of both projects is comparable. See Performance doc for details. Extreme performance is not a goal for either project.

License

The project includes code derived from several open-source projects. See the individual license notices in the source code and the LICENSE files:

Each source file carries its own notice identifying which of the above it falls under. Code that is not derived from any external project - original Beam42 code, and the helpers written for this port - is marked with a This code is part of Beam42 project header and is licensed under GPL v3 or later, same as the overall project.

The overall license is GNU GPL v3 or later.

About

A C++ port of Beam42 / ray-optics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages