Optics in FreeCAD

Show off your FreeCAD projects here!
thschrader
Posts: 2388
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Optics in FreeCAD

Post by thschrader »

something to play with...
http://satu0king.github.io/LightXlab/simulator/
https://www.youtube.com/watch?v=AxHcLncRkbM
lightxlab.JPG
lightxlab.JPG (48.26 KiB) Viewed 4580 times
marcin_ose
Posts: 27
Joined: Wed Apr 29, 2015 9:20 pm

Re: Optics in FreeCAD

Post by marcin_ose »

Excellent work. With some headscratching, we may soon be able to figure out how to couple cheapo 500W laser diode stacks to fibers for building laser cutters for metal. 500W laser Diodes are available for around $1000 like https://www.alibaba.com/product-detail/ ... 61539dmDmO. And this guy talks about how to simulate the raytracing - https://www.aphys.kth.se/polopoly_fs/1. ... s_2009.pdf . It is great that FreeCAD can be extended to just about anything.
Founder, Open Source Ecology
http://opensourceecology.org/
User avatar
DeepSOIC
Posts: 7843
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Optics in FreeCAD

Post by DeepSOIC »

It's always fun to re-read old discussions :P


Kunda1 wrote: 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?
I recently found out, there is a program called "Comsol". It cost some serious $$$$$, but apparently it can do pretty much anything physics-related, mechanics, cfd, electrodynamics, acoustics, plasma physics, semiconductors, ..., and custom equations. And allows to tie all these disciplines into one problem. I'm slowly looking into attending a course, it looks like it can elevate engineering caps to a whole new level.
thschrader
Posts: 2388
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Optics in FreeCAD

Post by thschrader »

DeepSOIC wrote: Tue Dec 11, 2018 1:25 pm It's always fun to re-read old discussions :P

It cost some serious $$$$$....
Yep.
1x basic module + 40 addons ==> 34000 USD
In germany, a nurse must work 2 years for that... ;)
pricelist:
http://collaborate.bu.edu/engit/Comsol? ... celist.pdf
chrisb
Posts: 38533
Joined: Tue Mar 17, 2015 9:14 am

Re: Optics in FreeCAD

Post by chrisb »

The linked pricelist is the Educational Discount Plan. I wonder what FreeCAD charges from universities :mrgreen: .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
saso
Posts: 1667
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Optics in FreeCAD

Post by saso »

Just a few videos from an commercial optical design package... Putting everything together what has been shown and discussed in this topic does show some good potential

https://www.youtube.com/watch?v=fwTl236-CYM
https://www.youtube.com/watch?v=qeHdZlcwof8
https://www.youtube.com/watch?v=DJQADlaJvPc
https://www.youtube.com/watch?v=7SIXXMCZ5kA
https://www.youtube.com/watch?v=YtzhNVgeU1I
https://www.youtube.com/watch?v=ScsAYxixy98
User avatar
christi
Posts: 145
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics in FreeCAD

Post by christi »

I have started to create a workbench for optics:
https://github.com/chbergmann/OpticsWorkbench
Image

Work is still in progess, but you can already draw some sketches and use it as optical mirrors
spanner888
Posts: 166
Joined: Tue May 28, 2019 10:51 am

Re: Optics in FreeCAD

Post by spanner888 »

christi wrote: Sat Jul 03, 2021 7:39 pm Work is still in progess, but you can already draw some sketches and use it as optical mirrors
Looks especially nice for simpler use cases than many optics tools I have looked at...and not used.

However in my own dumb user klutz fashion, I have not quite understood how to define the elements. It would be very usefull if you could share the FreeCAD model of your example, so I can get past whatever sillyness I have done to cause below (just two sketches, each with one line, and one sketch made into a mirror, then adding a Ray gives below)

Code: Select all

08:06:28  Illegal storage access...
08:06:28  Traceback (most recent call last):
  File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\OpticsWorkbench\Ray.py", line 40, in execute
    self.redrawRay(fp)
  File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\OpticsWorkbench\Ray.py", line 64, in redrawRay
    self.traceRay(fp, pos, linearray)
  File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\OpticsWorkbench\Ray.py", line 95, in traceRay
    isec = line.Curve.intersectCC(edge.Curve)
<class 'RuntimeError'>: Illegal storage access! Please save your work under a new file name and restart the application!
If I select the second sketch, then the mirror and try to create a ray, then get the same error again.

Then I tried making another sketch with a rectangle and made that an absorber, but still get above error trying to add a Ray, so your example file would help me work out how to correctly use your addon.
User avatar
johnwang
Posts: 845
Joined: Sun Jan 27, 2019 12:41 am

Re: Optics in FreeCAD

Post by johnwang »

Has anyone play with this KDP-2 from http://ecalculations.com/ An old Fortran design program

And there is a Koko which is based on KDP-2, its longer-term plan is to integrate with FreeCAD
https://github.com/dinosauria123/Koko
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
christi
Posts: 145
Joined: Wed Oct 24, 2018 7:03 am
Location: Karlsruhe, Germany
Contact:

Re: Optics in FreeCAD

Post by christi »

I have created a new discussion thread in the Open Discussion section:
https://forum.freecadweb.org/viewtopic.php?f=8&t=59860
I will answer your posts there.
Post Reply