Given what we now know about segments and intersections, there is one other important piece of information to fully understand why the segment and intersection error messages should not be ignored.  This piece of information has to do with the order in which ZEMAX traces non-sequential rays.

A ray will be trace until it reaches one of the limits/maximum controls specified under the Non-Sequential tab of the System > General dialog.  However, if not enough segments or intersections are allocated to trace all of the possible ray paths, ZEMAX will issue an error and terminate the trace (when Ignore Errors is turned off).  To reiterate, these error messages should NOT be ignored. 

Here’s why.  Let’s break down a ray trace into a family tree, much like the analogy which was made earlier in this article.  After each intersection, let’s assume the energy is equally divided into two rays, a “reflected” and a transmitted ray.  To demonstrate the hierarchy, the “reflected” rays from each intersection are drawn in red, while the transmitted rays are drawn in black. 

Each intersection is drawn as a blue bar (NOTE:  Each bar represents 1 intersection in this model.  The blue bars do NOT represent a volumetric plate with both front and back faces).  Given this sequence of ray tracing, upon each intersection, the total number of segments is equal to 2n+1 – 1.  So after the third intersection, we have a total of 15 segments, or 24 – 1 = 15.

Segment Order

Note the numbering scheme for the segments in the diagram above.  Ray segment 1 is incident on the first interface, and splits into 2 rays:  a transmitted and reflected ray.  ZEMAX continues to trace the transmitted energy, until that ray reaches its minimum relative ray intensity, for example.  So, ZEMAX continually tracks the transmitted portion of the energy (as in segments 2, 3, and 4), then returns back to the last point in which splitting occurred.  The transmitted energy of that ray is then traced until its minimum is met, and so on.

Segment Order Movie

As you can see from this numbering scheme, if not enough segments are initially defined, we may be neglecting rays which carry a significant portion of our initial energy.  As in the example given, if a maximum of 8 segments were defined, ZEMAX could not even trace ray segment number 9, which has half of our initial energy!  If this were the case, how could we trust the total energy calculation collected by our detector? 

So why don’t we determine which segment to trace first by its intensity?  Well, to do this, we would have to store a large list of data in memory, which would significantly slow down the ray trace.  So, ZEMAX traces rays in a recursive loop, which is proven to significantly increase ray tracing speed!

The bottom line is, never ignore the segment and/or intersection errors that ZEMAX issues.  Always make sure that there are enough segments and intersections allocated to trace all possible ray paths.  However, don’t arbitrarily set the values to high.  Instead, only increase these values as needed.