Optics in FreeCAD

Show off your FreeCAD projects here!
denisb
Posts: 5
Joined: Wed Mar 15, 2017 1:08 pm

Re: Optics in FreeCAD

Postby denisb » Fri Mar 17, 2017 7:59 am

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
Posts: 12660
Joined: Tue Mar 17, 2015 9:14 am

Re: Optics in FreeCAD

Postby chrisb » Fri Mar 17, 2017 8:02 am

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.
DeepSOIC
Posts: 6273
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Optics in FreeCAD

Postby DeepSOIC » Fri Mar 17, 2017 11:06 am

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
Posts: 866
Joined: Tue Jan 03, 2017 10:55 am

Re: Optics in FreeCAD

Postby realthunder » Sat Mar 18, 2017 8:03 am

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 (latest version 0.8.6) along with my custom build of FreeCAD at here.
And if you like to show your support, you can find the donate button at here.
HoWil
Posts: 786
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Optics in FreeCAD

Postby HoWil » Mon Apr 03, 2017 11:11 am

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: 178
Joined: Tue Oct 11, 2016 9:48 pm

Re: Optics in FreeCAD

Postby joha2 » Mon Apr 03, 2017 12:50 pm

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
Posts: 2833
Joined: Wed Oct 05, 2011 7:36 am

Re: Optics in FreeCAD

Postby ickby » Mon Apr 03, 2017 12:57 pm

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

Postby snoopy20 » Fri Jan 12, 2018 7:10 pm

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 19 times
Screenshot_2018-01-12_18-26-15.png
Screenshot_2018-01-12_18-26-15.png (19.73 KiB) Viewed 879 times
Screenshot_2018-01-12_19-01-45.png
Screenshot_2018-01-12_19-01-45.png (352.82 KiB) Viewed 879 times
DeepSOIC
Posts: 6273
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Optics in FreeCAD

Postby DeepSOIC » Fri Jan 12, 2018 8:25 pm

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
Posts: 3543
Joined: Thu Jan 05, 2017 9:03 pm

Re: Optics in FreeCAD

Postby Kunda1 » Fri Jan 12, 2018 8:28 pm

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?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features