Optics Workbench

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Fastpulse
Posts: 5
Joined: Fri Jun 24, 2016 2:45 pm
Location: Paris, France

Re: Optics Workbench

Post by Fastpulse »

christi wrote: Sat Apr 23, 2022 7:55 am
Fastpulse wrote: Fri Apr 22, 2022 12:40 pm It's a great optical ray tracing module, it would be fantastic to introduce dispersive components like diffraction gratings in reflection and transmission.
The Optics workbench traces single rays just as lines following the rules of geometrical optics. For dispersive components a source of light should be regarded as a wave that interacts with other waves. This is a different approach. Another question is how to display diffraction patterns with the graphical object that FreeCAD provides.
Hello christi,

The vector equations for the reflection, refraction, and diffraction induced by a grating are described through Fermat’s principle.
If the optical surface is declared as a diffraction grating, it can operate in reflective or transmission mode.
No need to display diffraction patterns with the graphical object, because we can use the vector equations for the diffraction induced by a grating are described through Fermat’s principle. I can send you an article that describes this subject "KrakenOS: Python-based general exact ray
tracing library", with some examples https://github.com/Garchupiter/Kraken-Optical-Simulator.

Best regards.
User avatar
christi
Posts: 203
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics Workbench

Post by christi »

remember the double slit experiment. If we try to simulate this with our Optics workbench, we will see only two bars of light behindert the slits as long we are doing vector arithmetics with single rays that follow snells law and Fermats principle. I do not see how the KrakenOS is doing this in a different way.
AP_123
Posts: 2
Joined: Mon Jul 04, 2022 7:49 pm

Re: Optics Workbench

Post by AP_123 »

Is there a way to use the optics workbench with the assembly4 workbench?
User avatar
christi
Posts: 203
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics Workbench

Post by christi »

AP_123 wrote: Fri Jul 22, 2022 11:08 pm Is there a way to use the optics workbench with the assembly4 workbench?
Unfortunately not. After a ray has been moved around, you always have to click (re)start simulation to regenerate the ray.
bleber
Posts: 259
Joined: Thu Jun 30, 2016 5:12 pm

Re: Optics Workbench

Post by bleber »

Maybe a new feature to store generated rays on a object that can be hided or hide unhide from script to generate something like animation rays.
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Optics Workbench

Post by saso »

Just a few links on the topic if it might be useful to someone...

Fundamentals of Optics by Ansys Learning
https://www.youtube.com/playlist?list=P ... TYSnJeBH9Y Introduction to Optics
https://www.youtube.com/playlist?list=P ... Eoqrpv1X-y Fundamental Parameters of Optical Systems
https://www.youtube.com/playlist?list=P ... P0o50SZDAa Understanding Optical Specifications
https://www.youtube.com/playlist?list=P ... V9XRL_PbD7 Real World Performance of Optical Systems
https://www.youtube.com/playlist?list=P ... _ku8UFCp71 Best Practices for Optical Design

https://en.wikipedia.org/wiki/Point_spread_function Point Spread Function
https://www.youtube.com/watch?v=Tkc_GOCjx7E The Point Spread Function
https://www.youtube.com/watch?v=JQy94K94nL0 Microscopy: Point Spread Function

PointSpreadFunctions.jl - optical point spread functions
https://www.youtube.com/watch?v=HwhrCIGzYAk
https://github.com/RainerHeintzmann/Poi ... nctions.jl

Optical simulation with the OpticSim.jl package
https://www.youtube.com/watch?v=7-vN8oNAz6Y
https://github.com/microsoft/OpticSim.jl
https://microsoft.github.io/OpticSim.jl/dev/
Last edited by saso on Fri Apr 07, 2023 10:30 am, edited 2 times in total.
PPM
Posts: 1
Joined: Tue Aug 02, 2022 11:38 am

Re: Optics Workbench

Post by PPM »

Very nice tool ... you can e.g. download step files of real lenses from Thorlabs and make a simulation e.g. to check the back focal length etc.

Three additional things/bugfixes would be perfect:

1.) one user already asked for an object that could export images - this would be very practical and could work with an array of absorber objects (camera matrix) that exports the beam hit counters of each object to an array of the same size. Naturally one can also script this ...

2.) Part Design allows to bundle objects in modules and shift those together. The optics workbench seems to ignore the base translation of the parent container. Being able to use groups allows to make more complex designs. Naturally one can script this again with a global position system ...

3.) importing lenses from step files, the lenses have lines in the optical path - it seems the optic workbench can not handle it when a beam hits a line of the object it behaves awkward. Here I have no clue how to fix it easily ...

I hope you can continue your excellent work on the optics workbench ...
AGK
Posts: 114
Joined: Fri Mar 25, 2022 2:56 pm

Re: Optics Workbench

Post by AGK »

Hello,
I am exploring a bit the Optical Workbench. I have loaded the "Example 2D". The refractive index is 1.52, so if I change it, the light path after the lens should change, right? But it does not. What could be the reason for this?
AGK
Posts: 114
Joined: Fri Mar 25, 2022 2:56 pm

Re: Optics Workbench

Post by AGK »

I discovered that if I then select the light (beam) and move it a bit, the change is visible, the beam path has changed.
The buttons "Switch off light" and "(Re)start simulation" do not work. All this under OSX 12.5 with Intel processor.

Tried under Boot Camp/Windows 10 it is also like this, once it worked with the buttons "Switch off light" and "(Re)start simulation".

Do other programs have to be installed, e.g. Python, so that it runs?

Translated with www.DeepL.com/Translator
User avatar
christi
Posts: 203
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics Workbench

Post by christi »

AGK wrote: Sun Aug 07, 2022 12:43 pm Hello,
I am exploring a bit the Optical Workbench. I have loaded the "Example 2D". The refractive index is 1.52, so if I change it, the light path after the lens should change, right? But it does not. What could be the reason for this?
The rays are only updated automatically if you changee the ray itself. If you make changes to any other object in your design, you have to click (Re)start Simulation to get the rays updated.
Post Reply