Skip to main content
Question

Viewing a subset of non sequential segments


John.Hygelund
Fully Spectral
Forum|alt.badge.img+1

In non-sequential mode, is it possible to view only a portion of the segments of a ray?

I’d like view only segments after hitting a particular surface.

You can filter by hitting a surface, but it always displays the entire sequence of rays.

The functionality I’m after is similar to specifying the ‘First Surface’ and ‘Last Surface’ in the sequential viewers. 

Thank you,

John

3 replies

Mike.Jones
En-Lightened
Forum|alt.badge.img+3
  • En-Lightened
  • 113 replies
  • March 1, 2025

Maybe change the colors to all white until the ray segment you want, then color them as desired.


David.Nguyen
Luminary
Forum|alt.badge.img+2

@John.Hygelund 

 

@Mike.Jones idea is good, and I guess it could be automatized with the ZOSAPI. depending how many segments you have, you might have to factor in the fact that there are 24 colors before they get repeated.

Alternatively, here’s a recipe that might also work:

  1. Run a raytrace and save the rays (ZRD extension)
  2. Open a Ray Database Viewer and load the saved ZRD file from 1
  3. In the Ray Database Viewer Settings use Save Rays On Object: <object_of_interest> As: <filename.dat> and use the .DAT extension to enable the Save button
  4. In the NCE add a Source File and choose the DAT file from 3
  5. In the Properties of the Source File, enable Sources..Raytrace..Reverse Rays (at this point, you have rays emanating from your object of interest going backwards in your system)
  6. Finally, change the Material column of the next object in the trajectory of the rays to ABSORB
  7. [Hacky Step] Either change the Pre-Propagation of the Source File (also in Properties..Sources..Raytrace). The goal is to have the rays start from the last surface in reverse and not from within the last object of interest

This is a dummy system consisting of a Source Ellipse and three Rectangular Volumes:

And the result after following the recipe above without Pre-Propagation:

And with a Pre-Propagation of -1.0, which is the Thickness of the Rectangular Volume:

With curved surfaces, it might be tricky to get right, but maybe it helps you. Please don’t hesitate to update an example for troubleshooting. I’m also attaching my dummy example for your reference.

Take care,

 

David


Bozkov
  • Monochrome
  • 3 replies
  • March 12, 2025

Hello ​@David.Nguyen ,

First of all thank you for your explanation. I have followed all your steps but I still have some questions regarding this topic. 


In my optical system I have a beam splitter, so I will end up having 2 outputs from 1 single input. I want to check the optical path difference between both beams (MSRA 17), so I followed all your indications with the idea of including this operand for both source file sources (one for each output) but it is not working as it should. 

 

Also, why can I see a part of the rays that goes through the beam splitter? (only showing one of the source files)

Best regards


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings