One of our goals in Ansys is to model reality so our customers get the most accurate modeling analysis that agrees with their measurements in the real world. As part of this goal, we are enhancing the Non-Sequential mode in OpticStudio. In the 22.3 release, the team brought to life the NSC single ray trace analysis; let me tell you, it is powerful and cool!
With the NSC single ray trace tool, you can add a source ray anywhere in the system space to evaluate light propagating. This tool will not modify or add an NSC object in the editor, allowing you to keep your editor system clean. Also, it provides all the ray data just as the ray database does. No more filtering ray databases to find the ray you want to evaluate! If that is not enough, the tool is also available in the ZOS-API and allows the extraction of any computed parameters. See attached example code for a basic introduction to this tool.
Also, look at the NSC single ray trace layout tab at the bottom of the analysis window. Here you can visualize the ray being traced to ensure it is the one you intend to analyze. The visualization becomes very powerful to our users when splitting and scattering are on since you can visualize the effects of stray light coming from that single ray. I look forward to seeing what our users will do with this tool.
The API for the single ray trace can access the same parameters as the ZRD without the ZRD database. I hope that suffices for your needs. If not, let me know and I can check what I can do.
Also, I have attached the API .m example code. The system rejected the file and I did not noticed yesterday. Thanks for bringing that up :)
Thanks David, hopefully this means the rest of the NSC ray tracing via the API will be updated so calculations like NSC Sag Map, Angle of Incidence calculations or optical path length/wavefront analysis can be implemented in non-sequential mode without having to save a ZRD file.
From just browsing the Help File, this feature is implemented as an analysis:
It has specific settings, and the results seem to be given as an IAR_NSCSingleRayTraceData, which looks like it has the key data you are talking about (hitFace, index, xNorm, yNorm, zNorm) in its ReadSegmentFull function:
I haven’t tested it though.
Thanks for the update. Did you forget to attach the sample code? What I’m really looking for is if we have access to all 29 data points from the ReadNextSegmentFull which is covered by the IZRDReaderResults or if we’re still limited to the 13 data points for the SingleRayNormPolFull/SingleRayDirectPolFull from sequential mode?
The developers would have had to add a new data structure to capture all 29 data points rather than reuse the old DDE code which the IRayTraceNSCData/IRayTraceNSCSourceData uses. Right now, I cannot perform a full NSC ray trace in memory and get key data out like HitFace, Index, or Nxyz normal vectors, meaning for custom NSC analysis I have to save a ZRD file and parse it, which is really slow.
Hoping this addition has changed the underlying code so all the NSC ray tracing via the ZOS-API is better!