Periodically, in complex systems with many objects, or in designs where rays strike a single object multiple times (think of an integrating sphere), the default values for the maximum number of intersections and/or segments is not sufficient.  As a result, you might see one of the following error messages:

ZEMAX Error Message

or

ZEMAX Error Message

Both of these error messages should be considered as “hard” errors.  In other words, they should NOT be ignored; ray trace results can be wrong if the maximums are not increased to a sufficient level. 

This article is aimed at not only explaining why these errors should not be ignored, but also to explain how to address the errors, and outline the difference between a segment and an intersection.

First, let’s define what each one of the terms mean.  An intersection is a point at which a ray strikes the face of an object.  A single ray may strike the same object many times, and each time the ray hits the face of the object, it is tallied towards the total number of intersections.

A segment is the portion of a ray path from one intersection to the next.  When a ray is launched from the source, it travels to the first object.  This is the first segment, or segment number 1.  At the point of intersection on the face of the object, the ray may split into 2 more rays (one transmitted and one reflected, for example), and each of those rays are another segment (for a total of 3).

To make this distinction clear, observe the diagram below.  A single ray is incident onto the front face of a plane parallel plate.  In this scenario (ignoring ray splitting), there are a total of 3 ray segments, and 2 intersections (one at the front face, and one at the back face).  Each segment is colored differently in the plot below.

NSC Shaded Model

How are rays colored by segments?  In the settings of the NSC Shaded Mode or NSC 3D Layout, you may choose to “Color Rays By” Sources, Waves, Configurations, or Segments.

NSC Shaded Model Settings - Color Rays by Segments

It is sometimes helpful to think of ray segments and intersections as a “family” of rays.  After any point of intersection, a “parent” ray can be split into a number of “child” rays.  Each one of these child rays can be the parent of another set of child rays, much like a family tree.  Since the maximum intersections and segments are applied per ray launched, you can think of each ray launched from the source as having its own family tree.  If a maximum is reached, ZEMAX will issue an error, indicating that not enough segments or intersections have been allotted.

As you can imagine, ray splitting quickly populates the number of segments ZEMAX needs to trace.  If we revisit the example shown above, the total number of segments quickly increases.  For example, if we consider the Fresnel reflected rays from both the front and back surface of the plate, then there are a total of five segments.  If each child ray then hits another interface and splits into two of its own child rays, we have a total of 9 segments, and so on.  Moreover, it’s possible that we may scatter into multiple rays at a given interface, and each of those scattered child rays hits another scattering surface, adding another generation of child rays!