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 and aims to extend its functionality towards design and optimization of optical assemblies.
Installation
To make the Optics Design Workbench available in FreeCAD, install it using FreeCAD's built in add-on manager.
To be able to use the workbench as a regular python module run
pip3 install freecad.optics_design_workbench
Manual/Offline installation without add-on manager
Head to the releases section and download the zipped source or your version of choice. Extract this zip to the Mod folder of your FreeCAD installation. The folder structure should be such that folder containing the init_gui.py
is the third order subfolder below the Mod directory:
..../Mod/freecad.optics_design_workbench-1.2.3/freecad/optics_design_workbench/init_gui.py
Development installation
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.
To make the workbench available in FreeCAD use the workbench
Troubleshooting
When things don't work as expected first make sure you are actually running want you intend to run and whether the same version installed on the python and the FreeCAD side. To check this, run
import freecad.optics_design_workbench
freecad.optics_design_workbench.versionInfo()
in the FreeCAD python shell and
import freecad_.optics_design_workbench
freecad_.optics_design_workbench.versionInfo()
in your regular python shell of choice.
If any of the displayed versions and paths do not look as you would expected, first find out what's going wrong there. Due to the different discovery methods of a regular python shell and FreeCAD's python shell, it can easily happen that the two find completely different, possibly outdated, installations of the workbench.
How to get started in FreeCAD
Select the Optics Design Workbench, place light sources, turn your existing objects into mirrors, lenses, absorbers and detectors and run Monte-Carlo simulations.
The workbench is still in an early stage, examples will appear here as soon as standard workflows for simulations and data analysis are implemented. The current idea is to have FreeCAD and a jupyter notebook open side-by-side. Simulations are configured and run in FreeCAD; the data analysis is done in the jupyter notebook.
How to get started in python
After installation via pip import the module using
import freecad_.optics_design_workbench
and try to find your way along usings python's help(...) and dir(...). The underscore in freecad_
is important only as long as freecad segfaults when being imported from a regular python shell. If you can import freecad
without a segfault on your system feel free to skip the underscore.
The workbench is still in an early stage, examples will appear here as soon as standard workflows for simulations and data analysis are implemented. The current idea is to have FreeCAD and a jupyter notebook open side-by-side. Simulations are configured and run in FreeCAD; the data analysis is done in the jupyter notebook.
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2383cc738aafe11d286f14deaab0bfe04550bf05523328b5aef1227f4e3a8551 |
|
MD5 | 521d78aba9db685ccf12a3921454592b |
|
BLAKE2b-256 | 47b340a1bf41f7f6a44bc9b7353d9ae8d975138708d0c8118ff332ba659791a7 |
Hashes for freecad.optics_design_workbench-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96c830ad77b3970e43e1bfee4fd0a1ab4064a2c0979332814dcbc62089da1e76 |
|
MD5 | 8ecec86be631b1ef3cd69de6028fb8bf |
|
BLAKE2b-256 | feb6f3417ed3235745ae601dc4e28401cf5e4190dcce70de3cf2ab1398c1f260 |