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!
User avatar
christi
Posts: 203
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics Workbench

Post by christi »

PPM wrote: Tue Aug 02, 2022 11:55 am 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 ...
1.) as I already mentiond, this is a user specific feature. Every user has a different usecase of what to do with the beam counters. I do not want to implement this to keep the workbench simple.

2.) This is a good point. I need to find a way to get the absolute position of a ray instead of its Placement parameter.

3.) lines in an object should not be a problem. Do you have an example where you have problems ? I may take a look at this.
User avatar
freecadjam
Veteran
Posts: 1994
Joined: Tue Jul 17, 2018 10:47 am
Contact:

Re: Optics Workbench

Post by freecadjam »

christi wrote: Sat Aug 13, 2022 6:52 pm
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.
Hi,
Also, the rays updates automatically when you are in Sketcher mode of an object.
A question please, are you in touch with the Pyrate workbench ?
I made a thread in the french forum, to show some work : https://forum.freecadweb.org/viewtopic.php?f=12&t=71364
Regards
User avatar
christi
Posts: 203
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics Workbench

Post by christi »

freecadjam wrote: Fri Aug 26, 2022 2:06 pm A question please, are you in touch with the Pyrate workbench ?
I made a thread in the french forum, to show some work : https://forum.freecadweb.org/viewtopic.php?f=12&t=71364
Regards
Yes, there are some discussions with a pyrate developer earlier in this thread.
Nice work on the french site.
User avatar
christi
Posts: 203
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics Workbench

Post by christi »

The user Txomin V added a new feature:
Since my company is building a lens system with a CCD sensor, I have changed a couple of lines in the "Ray.py" file so that the parts marked as ABSORBERs record the position of each LIGHT RAY when it hits. This way, it is possible to visualize the image on the CCD sensor in a XY diagram.

I added his python code to OpticsWorkbench. To show a plot, open a python console and type:

Code: Select all

import OpticsWorkbench
OpticsWorkbench.plot_xy(App.ActiveDocument.Absorber)
Image
Cobras62
Posts: 14
Joined: Thu Oct 28, 2021 9:37 am

Re: Optics Workbench

Post by Cobras62 »

Nice work!
It is really nice this workbench.
Thanks for the additions :)
I take the opportunity to ask again if it is possible to add a feature? I had sent a message on May 6 but I didn't get any feedback:
Would it be possible to add an option to generate a matrix of rays embedded in a circle?
Thank you!
User avatar
christi
Posts: 203
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics Workbench

Post by christi »

Cobras62 wrote: Tue Oct 04, 2022 8:44 am Would it be possible to add an option to generate a matrix of rays embedded in a circle?
Of course this is possible, maybe I could add a parameter BeamShape in the future. Unfortunately it is not possible to use the Array tools from the Draft workbench, this only makes simple copies of the initial ray and moves them around.
Cobras62
Posts: 14
Joined: Thu Oct 28, 2021 9:37 am

Re: Optics Workbench

Post by Cobras62 »

Thank you for your answer.
OK I understand.
I started python recently and unfortunately, it's still too complex for me to try to contribute.
It would be great to be able to generate "ray arrays" in the shape of a circle, as this is the most common shape of lenses and light beams. Maybe by generating a matrix with polar coordinates? With angle and distance as parameters.
Thanks again !
nardonardo
Posts: 2
Joined: Mon Mar 20, 2023 5:12 pm

Re: Optics Workbench

Post by nardonardo »

Dear People,
Hi to everybody and thank you for sharing this big work!!
I've encountered this topic while searching a way to "simulate a lamp light distribution": my goal is to model a lamp, add the LED light source and all the topology needed data, run a ray simulation and create a spatial distribution curve (like an IES/LDT file). Do you think that this can be made with this workbench? Can this work with multiple light sources like a LED strip?

Thank you all!
User avatar
christi
Posts: 203
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics Workbench

Post by christi »

nardonardo wrote: Mon Mar 20, 2023 5:21 pm my goal is to model a lamp, add the LED light source and all the topology needed data, run a ray simulation and create a spatial distribution curve (like an IES/LDT file). Do you think that this can be made with this workbench?
The Optics workbench only simulates bunches of single rays of light. You can create an absorber plane and examine where all the rays hit the plane and create a 2D plot from this. Create spatial distribution curves is not possible without additional programming work from you.
nardonardo wrote: Mon Mar 20, 2023 5:21 pm Can this work with multiple light sources like a LED strip?
Yes
nardonardo
Posts: 2
Joined: Mon Mar 20, 2023 5:12 pm

Re: Optics Workbench

Post by nardonardo »

christi wrote: Tue Mar 21, 2023 3:47 pm
nardonardo wrote: Mon Mar 20, 2023 5:21 pm my goal is to model a lamp, add the LED light source and all the topology needed data, run a ray simulation and create a spatial distribution curve (like an IES/LDT file). Do you think that this can be made with this workbench?
The Optics workbench only simulates bunches of single rays of light. You can create an absorber plane and examine where all the rays hit the plane and create a 2D plot from this. Create spatial distribution curves is not possible without additional programming work from you.
nardonardo wrote: Mon Mar 20, 2023 5:21 pm Can this work with multiple light sources like a LED strip?
Yes
Thank you Christi, your answer is very precious to me. I'm not a coder nor I've got the skylls to implement what you say in few days, so I can try to figure this out in some other "non commercial" way.
Any suggest is well appreciated!

Very nice work, again.
Post Reply