There are two distinct ray tracing modes supported by ZEMAX (Sequential and Non-Sequential), but often times it is necessary to combine the two techniques. A design which uses both methods of ray tracing is often referred to as a “mixed-mode” system, a “hybrid” system, “non-sequential ray tracing with ports,” or mixed sequential/non-sequential mode. The term “mixed-mode” is used most frequently. The mode selection is found under the File menu from within ZEMAX:
Mixed mode systems contain one or more non-sequential object (called an NSC group) which is part of an otherwise sequential system. An example might be a point or extended surface object which is represented by rays which follow a sequential ray path through one or more conventional lenses, then follow a non-sequential path through a prism or light pipe before illuminating the image surface.
This method of ray tracing requires the use of ports, namely the entry and exit ports, for rays to enter and leave each NSC group. The entry and exit ports are a vital part of constructing a mixed mode system, and will be discussed in more detail in the following pages of this article. When using ports, rays are launched from defined field positions on the OBJ surface. All the usual sequential ZEMAX system data, such as field positions and pupil sizes, determine the properties of rays entering the NSC group.
Rays enter the group through the entry port, and may only leave the group via the exit port; then continue through the remainder of the sequential system.
The diagram below highlights the progression of rays in a mixed mode design. A collimated beam passes through the entry port and TIRs a few times from a 30-60-90 prism. The collimated beam eventually hits the exit port, where the sequential ray trace is resumed, and the light is focused by an equiconvex lens.
So what’s the basic procedure for constructing a mixed mode system in ZEMAX? Advance to the next page to find out more!
Rays can only enter a NSC group through the entry port. NSC groups are first defined by inserting a Non-Sequential Component surface at the desired location in the LDE. This is performed by simply changing the Surface Type in the Surface Properties dialog for the selected surface.

It is the Non-Sequential Component (NSC) surface in the LDE which describes the location, size and shape of the entry port into the NSC group. The entry port may be planar, spherical, or conic aspherical, if desired, as described by the Radius and Conic parameters of the NSC surface. The location of the vertex of the entry port (or NSC surface) is determined by the previous surfaces in the LDE in the usual sequential, local coordinate system.
The NSC surface also supports a surface aperture, and any rays which fall outside of the defined size of the aperture will be terminated. Those rays pass through the apertured entry port will be traced non-sequentially through the objects defined within the NSC group (more on this later…).
3D Layout: Note the rays which fall outside the defined aperture on the entry port are vignetted and are not traced within the NSC group.
The NSC surface has a total of 9 parameters, most of which are used to define the location of the exit port with respect to the entry port.


ZEMAX uses a default Exit Loc Z value of 1, simply to place the exit port some non-zero distance from the entry port. If the two are co-located, then rays which hit the entry port immediately exit via the exit port, and will never see the objects defined within the group.
Since the positions of the exit port with respect to the NSC surface are defined by the parameters of the NSC surface itself, the surface following the NSC surface in the LDE becomes the location of the exit port. It is this surface which defines the size and shape of the exit port. Note the Semi-Diameter of the exit port must be a user defined value, and cannot be automatically calculated.
Apertures may also be placed on the exit port surface, if the desired shape is non-circular. When a ray strikes the exit port, the coordinates and direction cosines of the ray in the coordinate system of the exit port are computed, and then the ray is traced sequentially through any remaining surfaces defined in the LDE. If one of the following surfaces is another Non-Sequential Components surface, then the process begins again for the components defined for that group. This means that more than one NSC group may be defined, and each group has its own entry and exit port!
So far we have discussed how to define both the entry and exit port for our non-sequential component group. But what about the Non-Sequential objects themselves? Where and how are these objects defined?
Objects within each Non-Sequential Group are defined in their own editor, called the Non-Sequential Component Editor, which may be accessed from the Editors menu in ZEMAX.
The Non-Sequential Components Editor (NSCE) operates just like a pure non-sequential editor, where objects are defined by positions and object-specific parameters. Objects may be nested, GRIN media may be applied, faces may be coated; etc.
The important point to note about the NSCE is the global coordinate by which every object in a group is referenced to. The global (0,0,0) is located at the entry port of each group, so all of the objects defined within the NSCE are referenced to the entry port of that group. There is no limit to the number of objects which may be defined in the group, but as soon as any ray strikes the exit port, it resumes its sequential path.
The title bar of the NSCE indicates which surface in the LDE that the group corresponds to:
This means that the objects listed in the NSCE are the components in the NSC group defined by a particular surface in the LDE. Since more than one NSC group may be defined in a single mixed mode system, more than one NSC Editor is required. Only one editor may be displayed at a time. The active NSC editor may be toggled by using the “Next Group” option from within the Edit menu of the NSCE.
For example, if two different NSC groups exist, described by surfaces 4 and 8 in the LDE, then the objects which exist in the first group will be defined by the NSC Editor for “Component Group on Surface 4” and the second group will be defined in its own NSC Editor: “Component Group on Surface 8.”
There are many sample files included with ZEMAX which use this mixed mode capability, many of which are located in the ZEMAX > Samples > Non-Sequential > Prisms directory. To familiarize yourself with mixed mode within ZEMAX, you may want to consider opening some of the various files within this folder and observe the definition of the objects within the NSC Editor, the exit port location and size, the sequential aperture definition, and so on.
Additionally, here are some key points to understand about mixed mode systems: