Optics in FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Optics in FreeCAD
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
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 27331 times
-
- Snells law.FCStd
- Snell's law constraint. Set the distances according to refraction indices of media.
- (2.94 KiB) Downloaded 389 times
-
- demonstration of aberration when focusing parallel beam using spherical reflector.
- spherical_refl.png (20.59 KiB) Viewed 27331 times
-
- spherical_refl.FCStd
- demonstration of aberration when focusing parallel beam using spherical reflector.
- (3.1 KiB) Downloaded 380 times
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Optics in FreeCAD
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.
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 27317 times
-
- thick_lens_simulation.FCStd
- simulation of a thick lens
- (3.83 KiB) Downloaded 354 times
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Optics in FreeCAD
I have written a built-in Snell's law constraint for the sketcher, and playing with refraction has just become very easy.
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.
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
- (6.49 KiB) Downloaded 374 times
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.
Reason: Uploaded a repaired FCStd. The original was created in early development version and didn't work in current master.
Re: Optics in FreeCAD
I find your work fasinating and wold definitely like to see it in master.
Thank you for sharing
Keep up the good work.
Thank you for sharing
Keep up the good work.
Need help? Feel free to ask, but please read the guidelines first
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Optics in FreeCAD
Thanks cox!
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Optics in FreeCAD
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... 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... 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... 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)
I mocked up a scene, with a lens I thought I designed to focus perfectly... 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... 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... 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
- (25.97 KiB) Downloaded 287 times
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Optics in FreeCAD
Now we are talking. Rectified my lens design, focuses perfectly!
- kkremitzki
- Veteran
- Posts: 2517
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Optics in FreeCAD
Now that's pretty dang cool!
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Optics in FreeCAD
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.Re: Optics in FreeCAD
Bonus points for hooking this up with FEM and melting something with focused light . -Ian-