Physically accurate forward ray tracing for optics simulation and optimization with FreeCAD workbench frontend
Project description
Optics Design Workbench
This workbench was inspired by the (OpticsWorkbench)[https://github.com/chbergmann/OpticsWorkbench] by Christian Bergmann.
Installation
Because running import freecad.something
causes a Segfault in many python interpreters, the workbench installs both the freecad.optics_design_workbench
module and an identical freecad_.optics_design_workbench
module. The latter can always be safely imported to use the parts of the module that are not related to FreeCAD.
Parallel computing
The GUI simulations all take place in the GUI main thread using the "QApplication.processEvents" hack to keep the GUI responsive. The extra implementation work for a proper QRunnable/QThreadpool solution is not worth it (yet), because it would only improve the responsivenes, not the actual simulation performance because of python's GIL.
To do simulations with actual performance gain, background processes running headless FreeCADCmd are launched in the background.
Module structure
distributions
Classes and functions for (random) point generation following given distributions.
freecad_elements
Contains all definitions for behavior/objects/commands living in the FreeCAD projects. The ray-tracing code is in here, because it is inherently connected to the FreeCAD geometry engine.
gui_windows
Contains classes/functions that open additional windows.
simulation
Contains classes/functions handling the simulation loop, saving of results, progress tracking, background workers, etc. Submodules in here use the FreeCAD.App and Gui objects in a few places but only to fetch paths or similar metadata, not for direct interaction. For direct interaction prefer to use submodules of freecad_elements.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for freecad_optics_design_workbench-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52628a4c4a205fd6765a267d283479cce63a1f944cdea49170f605301224ac26 |
|
MD5 | 4d9212e061af0f30a28636083765678e |
|
BLAKE2b-256 | 0ed65a7d47b3a525f767e86ac751d21e1148fecb06d78d2e2e6e54938f920786 |
Hashes for freecad.optics_design_workbench-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19fa8fbb5ac56d0988f1f8fe9a65119f2febb4bfc1a552e075eddaec52a12a44 |
|
MD5 | e4d5ae37abd9ac287bf21ff75110e129 |
|
BLAKE2b-256 | 3957ac542475775b01b18209d6c443365e5cda9af34c8e82aa349c633b709794 |