Open Jashcraf opened 2 years ago
I think there's a bug with the raytrace - I'm giving some of the rays an angle but they still show up as having 0 position for the outgoing rayset
It would appear that the GetGlobalMatrix() method fails at the image surface without throwing an error - just returns a success value of 0. Maybe global coordinates are unnecessary
These are all about what I would expect - so we can proceed with attempting the differential ray transfer matrix
This is organized [A,B] [C,D]
Overall this sort of conflicts with what I was expecting. The A and D matrices make enough sense - though there is a factor of -1 in the D matrix that was unanticipated. The B and C matrices almost seem switched, I wonder if the matrix is being incorrectly computed somehow?
Consider writing a function to connect this to a gbd simulation
Getting quite close - need to figure out why yout is such a large number
Bug was over-subtraction of yout - it works now!
Tested with reflection and not getting encouraging results - I think it has to do with one or more of the following:
To address the first we just need to define rayin
in the context of the surface.
Maybe it's as simple as the PRT approach - trace to a surface and report the angle in and out using the vector snell's law.
Perhaps I'm overcomplicating this - Worku constructs each ray transfer matrix for each interaction individually using the finite differences method - let's try with just a single distance and single refraction! Had to rewrite the
Case: Propagate 5000mm
Rewrote the entire thing in matlab so that I don't have to keep generating text files and we can just send the final Ray Transfer Matrix to the beamlet code. Here are some test cases:
Case: Propagate 5000mm
This is exactly what we expect (with some errors in precision)
Case: Refract at a 5000mm radius paraboloid
Everything in this matrix could potentially be real - with the exception of the elements of the B matrix (top right 2x2). There shouldn't be anything here because the refracting surface is the entrance pupil - I wonder if it has to do with the propagation of the rays from the stop surface to the mirror surface?
Well, no need to fix something that might not be broken - let's do a full calculation and see what the result for a single parabola is.
Actually - perhaps moving forward with Stone to just not compute the values that shouldn't be there might be the move.
This is nearly what I would expect from a paraxial lens going to focus ... time to plot it!
oh my god I think it worked
The real ray tracing has been trouble to implement because of the conversion of what a "real ray" is to the paraxial convention with ABCD matrices. Since the beamlet code runs on ABCD matrices we can compute the matrix to determine the beamlet propagation.
A real ray is specified by 6 dimensions: Their positions in three orthogonal directions and the associated direction cosines. However, ray transfer matrices don't operate on the z-axis, so we need to convert the direction cosines into slopes in the xz and yz plane.
The method I had derived for this conversion is shown below