DeepSOIC
Posts: 7829
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Hi
I want to share some tricks (building blocks) for optics design. With the ellipse support that is coming, FreeCAD looks like a promising tool for simple optics design.
I have only two right now, but maybe more will come later
Attachments
Snell's law constraint screenshot. set the distances according to refraction indices of media.
Snells law.FCStd.png (15.46 KiB) Viewed 17122 times
Snells law.FCStd
Snell's law constraint. Set the distances according to refraction indices of media.
demonstration of aberration when focusing parallel beam using spherical reflector.
spherical_refl.png (20.59 KiB) Viewed 17122 times
spherical_refl.FCStd
demonstration of aberration when focusing parallel beam using spherical reflector.
DeepSOIC
Posts: 7829
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Here's another one, a bit more interesting: simulation of a thick lens.
This lens was drawn by accident and wasn't actually engineered. It is here just to demonstrate that one can simulate a ray passing through it.
Attachments
simulation of a thick lens (screenshot)
thick_lens_simulation.FCStd.png (37.75 KiB) Viewed 17108 times
thick_lens_simulation.FCStd
simulation of a thick lens
DeepSOIC
Posts: 7829
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

I have written a built-in Snell's law constraint for the sketcher, and playing with refraction has just become very easy.
ellipsoid-spherical lens at an angle.png (175.61 KiB) Viewed 16009 times
This lens perfectly focuses a parallel beam of light into a point when it's along optical axis, but sucks at focusing the beam when it is at an angle. Does this explain why human eye has poor peripheral vision ?

To use the model, FreeCAD with the constraint is needed. You'll have to compile it from my branch, or use my Windows build (and possibly get my viruses ). Check out Optical constraints development forum thread for the links.

If anyone wants to see this in master, please let me know.
Attachments
ellipsoid-spherical lens at an angle.FCStd
Last edited by DeepSOIC on Tue Mar 03, 2015 11:50 pm, edited 1 time in total.
Reason: Uploaded a repaired FCStd. The original was created in early development version and didn't work in current master.
cox
Posts: 963
Joined: Wed Nov 26, 2014 11:37 pm

I find your work fasinating and wold definitely like to see it in master.

Thank you for sharing

Keep up the good work.
DeepSOIC
Posts: 7829
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Thanks cox!
DeepSOIC
Posts: 7829
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

My first ever attempt at ray-tracing. I gave a try to OCC's super new CAD Rays.

I mocked up a scene, with a lens I thought I designed to focus perfectly...
lens scene cad.png (30.69 KiB) Viewed 13610 times
And I tried to render it, in hope to see the image of objects in front of the lens. But all I got was lots of stray light, and no actual image. Then I removed the objects, and placed a light source. At first, I got something strange and very slowly, but I realized I forgot to switch off the sun , and after doing that...
lens scene.png (642.63 KiB) Viewed 13610 times
To my disappointment, the result is still very noisy after a few minutes of waiting. But it definitely shows something useful. It demonstrates that my lens is very far from perfect. All that halo around the image...

So I went back to FreeCAD, and checked the design. Sure enough...
lens scene lens design.png (414.16 KiB) Viewed 13610 times
It's definitely cool to see stuff like this! But I'm not happy with the UI of CADRays. It's strange. Moving around is hard. It often becomes very laggy, so I have to switch over to opengl rendering. It doesn't like touchscreen input, and even with pen, I often find out CADRays decided I want to drag the wrong numberbox, or reset my hue value of color, or not accept light source power below 1.0...

I want gesture navigation style from FreeCAD to be in there! I still have not figured out how to pan! (apart from AWSD)
Attachments
lens-scene.FCStd
DeepSOIC
Posts: 7829
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Now we are talking. Rectified my lens design, focuses perfectly!
correct lens.png (304.83 KiB) Viewed 13592 times
kkremitzki
Posts: 2168
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Now that's pretty dang cool!
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
DeepSOIC
Posts: 7829
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia