Optics in FreeCAD

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
denisb
Posts: 5
Joined: Wed Mar 15, 2017 1:08 pm

Re: Optics in FreeCAD

Post by denisb »

DeepSOIC wrote:Got an image of some stuff through the lens!
lens-scene 2 render.png
On AMD Radeon 7700 and with regular mouse, CADRays is behaving much much better, and makes a nice rendering faster.
Thank you so much for testing the app. It is great to see the first real user!

Regarding your rendering, it seems that the number of bounces (3 by default) is insufficient for complete processing of all inter-reflections in the lens. Please try to increase it at least to 8-10 (on render settings tab).
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Optics in FreeCAD

Post by chrisb »

Very impressive! although I wouldn't hire you yet to make my next pair of glasses, Mr. David Hamilton! :)
Last edited by chrisb on Fri Mar 17, 2017 1:46 pm, edited 1 time in total.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Optics in FreeCAD

Post by DeepSOIC »

denisb wrote:Regarding your rendering, it seems that the number of bounces (3 by default) is insufficient for complete processing of all inter-reflections in the lens. Please try to increase it at least to 8-10 (on render settings tab).
Yep. With 3 bounces, I saw no image on screen at all. The last image was rendered with 5 bounces.

When setting up lens material, I wanted to give it a bit of glassy look, which isn't easy in this dark-room lighting conditions. I played with scatter color, but I didn't notice any effect at all. Maybe my number of bounces was too low?.. I also played with "thickness" "density" (tooltip says it's lambert-beer absorption coefficient). First, absorption should have its color customizable. Second, it doesn't appear to do anything at all. It doesn't say, what unit it is in... I tried bumping it up to 10000, and observed no image intensity drop...

The look of the lens was made by adding some emissivity to glass material.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Optics in FreeCAD

Post by realthunder »

DeepSOIC wrote:Got an image of some stuff through the lens!
On AMD Radeon 7700 and with regular mouse, CADRays is behaving much much better, and makes a nice rendering faster.
:o That's very impressive! I actually saw this post long time ago, and was hoping at that time I may some day venture into optics. Unfortunately, that day hasn't come yet.

I am curious of your profession. I had thought maybe you are an electronics guy or something because of your username I guess.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Optics in FreeCAD

Post by HoWil »

Hi,

Very very interesting :!:

That looks nice but for doing simulations for optics it would be necessary to also see the light paths. Is this possible with CADRays :?:

Maybe it is possible to at least insert 2D simulation results of the ray-paths of e.g. x-z into the 3D FC- model (http://sterncat.github.io/files/Double_Gauss.html).

Maybe this could be combined with https://github.com/mess42/pyrate ?!

Here are some libraries supporting Python and optics-raytracing which I looked up some time ago:
http://opticspy.org/
https://github.com/ramezquitao/pyoptools
some older stuff
http://twiki.ph.rhul.ac.uk/twiki/bin/vi ... thonOptics
https://sourceforge.net/projects/openraytrace/

A 3D ray optics simulation would be for sure extremely appreciated. Until now I know only two free/open-source, simple to use 2D packages: https://ricktu288.github.io/ray-optics/ and https://arachnoid.com/OpticalRayTracer/

You can find a nice overview of how commercial tools look like over here... http://chenglongresearch.weebly.com/blo ... g-software

BR,
HoWil
joha2
Posts: 303
Joined: Tue Oct 11, 2016 9:48 pm

Re: Optics in FreeCAD

Post by joha2 »

HoWil thank you very very much for this overview of open source ray tracers!!!
I think I will also have a look at them to test our code and cross compare.

Best wishes
Johannes
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Optics in FreeCAD

Post by ickby »

HoWil wrote:A 3D ray optics simulation would be for sure extremely appreciated. Until now I know only two free/open-source, simple to use 2D packages
You could also look at BRL-CAD. It is fully based on raytracing (that is their primary evaluation method) and does it extremely fast for all kind of exact geometry (primitives and nurbs). The command line itnerface is complicated and unusual, but you can do crazy analytics wth it (at least that is what I read :) )
snoopy20
Posts: 6
Joined: Fri Nov 03, 2017 6:21 pm

Re: Optics in FreeCAD

Post by snoopy20 »

I've been using some of the ideas here to try and produce a sphere for refracting light from an LED (focusing element).

The idea is, given a known distance from the emitter, and a known height (both of which set the maximum capture angle) then constants on two rays of light will force the sphere radius to change.

It sort of works but isn't quite there. I ran it through ZEMAX and it came out close, better than my ability to guess the sphere characteristics.

If anyone can work out how to make the two rays of light move on the diameter without the sphere radius changing that would be great!
Attachments
led_focus.fcstd
(3.75 KiB) Downloaded 172 times
Screenshot_2018-01-12_18-26-15.png
Screenshot_2018-01-12_18-26-15.png (19.73 KiB) Viewed 6634 times
Screenshot_2018-01-12_19-01-45.png
Screenshot_2018-01-12_19-01-45.png (352.82 KiB) Viewed 6634 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Optics in FreeCAD

Post by DeepSOIC »

snoopy20 wrote: Fri Jan 12, 2018 7:10 pm If anyone can work out how to make the two rays of light move on the diameter without the sphere radius changing that would be great!
If you want to focus a parallel beam inside glass into a point in air, an arc of hyperbola will do.

EDIT: and by the way, there is a snell's law constraint available! so that you don't have to make all this construction geometry.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Optics in FreeCAD

Post by Kunda1 »

ian.rees wrote: Fri Mar 17, 2017 4:42 am Bonus points for hooking this up with FEM and melting something with focused light ;). -Ian-
This sounds awesome.. can this seriously be done?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply