Page 2 of 4

Re: Optics in FreeCAD

Posted: Fri Mar 17, 2017 7:59 am
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).

Re: Optics in FreeCAD

Posted: Fri Mar 17, 2017 8:02 am
by chrisb
Very impressive! although I wouldn't hire you yet to make my next pair of glasses, Mr. David Hamilton! :)

Re: Optics in FreeCAD

Posted: Fri Mar 17, 2017 11:06 am
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.

Re: Optics in FreeCAD

Posted: Sat Mar 18, 2017 8:03 am
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.

Re: Optics in FreeCAD

Posted: Mon Apr 03, 2017 11:11 am
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

Re: Optics in FreeCAD

Posted: Mon Apr 03, 2017 12:50 pm
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

Re: Optics in FreeCAD

Posted: Mon Apr 03, 2017 12:57 pm
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 :) )

Re: Optics in FreeCAD

Posted: Fri Jan 12, 2018 7:10 pm
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!

Re: Optics in FreeCAD

Posted: Fri Jan 12, 2018 8:25 pm
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.

Re: Optics in FreeCAD

Posted: Fri Jan 12, 2018 8:28 pm
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?