What happens if a dispersed ray hits another mirror or lens ?
I would not call the ray dispersed since its a bunch of rays that see a different "lens" each. So the calculations are pretty much unchanged only that the refraction index is now dependent on the ray, i.e. the rays wavelength property. So mirrors behave as usual.
One thing i noticed on the way is, that the transparent lines dont work with colors. Thats why you see the opaque behavior at the mirror.
Also with a lens you always have two dispersions, when the ray enters the lens and when it exits the lens.
Hard to see in the images but that is already happening.
Did you already fork the OpticsWorkbench on Github ?
Not yet. I hope i will find some time today and tomorrow to do this. I would fork and make a pull request.
08:29:19 Traceback (most recent call last):
File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 53, in onChanged
self.redrawRay(fp)
File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 85, in redrawRay
insiders = self.isInsideLens(ray.Vertexes[0])
File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 271, in isInsideLens
if obj.Shape.distToShape(Part.Vertex(vertex))[0] < EPSILON:
<class 'RuntimeError'>: BRepExtrema_DistShapeShape failed
2) When I change the Refraction index property. The first change automatically updates the refraction path of the ray. Sometimes, further changes in the index update the ray, sometimes not. (I have yet to tie down a repeatable sequence to replicate, sorry.)
3) The refraction path doesn't seem to work if the sketch is on other than the X, Y plane.
4) The lens container has a Placement object, but changes don't seem to have any effect. The Placement object of the contained sketch does move the sketch and effect the refraction path. (this is in a sketch on the X, Y plane; neither has any effect on a sketch on other planes.)
5) The default length of the Ray at 1 million make 3D view navigation a bit cumbersome and I always immediately set it to a more manageable 100. (obviously this would need to be increased based on the design of the lens system) Is/would it possible to set this default as a preference?
I added some of your reports to issued on Github. When they are solved, the issues will be closed.
1) see https://github.com/chbergmann/OpticsWorkbench/issues/10
2) see https://github.com/chbergmann/OpticsWorkbench/issues/12
3) see https://github.com/chbergmann/OpticsWorkbench/issues/11
4) Every FreeCAD object has a Placement property. It cannot be removed. Simply do not change it for lenses, mirrors and absorbers.
5) The best default value depends on the size of your design. 1000000 should always be big enough. 100 would be much to small for my parabolic mirror with 1,5m diameter. You can place an absorber box around your design to limit the ray length.
4) I understand every object has a Placement object. I guess I was asking which is the proper one to use to move the lens. So I guess the sketch placement is it.
thanks for adding the issues, I would have been happy to do so, but, I figured I needed to confirm whether it was just my naive use or ...misuse before doing so.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
10:14:33 File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 238, in traceRay
self.traceRay(fp, neworigin, linearray)
10:14:33 File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 218, in traceRay
if len(nearest_obj.Sellmeier) == 6:
10:14:33 AttributeError: 'FeaturePython' object has no attribute 'Sellmeier'
10:14:33 'FeaturePython' object has no attribute 'Sellmeier'
10:14:33 Traceback (most recent call last):
10:14:33 File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 98, in redrawRay
self.traceRay(fp, pos, linearray, True)
10:14:33 File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 238, in traceRay
self.traceRay(fp, neworigin, linearray)
10:14:33 File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 238, in traceRay
self.traceRay(fp, neworigin, linearray)
10:14:33 File "/home/mac/.FreeCAD/Mod/OpticsWorkbench/Ray.py", line 218, in traceRay
if len(nearest_obj.Sellmeier) == 6:
10:14:33 AttributeError: 'FeaturePython' object has no attribute 'Sellmeier'
10:14:33
And, is there a way to update optic objects after the workbench is updated? It seems I need to delete and re-add lens and beams.
drmacro wrote: ↑Sun Aug 29, 2021 2:16 pm
Not sure what I've broken...
And, is there a way to update optic objects after the workbench is updated? It seems I need to delete and re-add lens and beams.
Your objects were created by a non functional version of the workbench. There is no other way than deleting and re-creating the Optics Workbench objects. Sorry.
Ah, yes. This happens when you choose a non existing Material, which happened because now there are fewer Materials. And by luck/accident you saved a lens with one of theses materials.
Would be sufficient to just change the material.