A non-sequential surface (NSS) group is treated as a sub-group of surfaces that is associated with a selected surface in the sequential portion of the lens. The first surface of a non-sequential group is called the "entry port". Surfaces in the non-sequential group itself are numbered in the usual way, although rays will not generally strike them in the given order. The last surface in the group is called the "exit port".
When any traced ray reaches the entry port, a special raytracing procedure is invoked that attempts to find a path through the non-sequential group to the exit port surface. Surfaces within the group will be traversed in whatever sequence is necessary to produce a real path to the exit port, i.e., the path length from each surface to the next surface through the group is required to be greater than or equal to zero. Total internal reflection is allowed and the same surface may be visited multiple times.
A number of special rules apply to the tracing of rays through a non-sequential group. In particular, since a surface may be approached from either side, it is necessary to specify how rays are to be reflected, refracted, or obstructed depending upon the direction from which the surface is approached. If a special action is not specified, the action defaults to whatever is specified by the normal lens data.
In the local coordinate system of a surface in a non-sequential group, the surface may be viewed as dividing space into two regions. Since the surface always passes through the local origin, a point on the local z-axis, slightly displaced from the origin in the negative z-direction, will lie in one of these regions, which we call the "negative" region. Conversely, a point on the local z-axis that is slightly displaced from the origin in the positive z-direction will lie in the other region, which we call the "positive" region. A ray is said to be traveling "to positive" if it approaches the surface from a point in the negative region. It is said to be traveling "to negative" if it approaches the surface from a point in the positive region.
Special actions are specified in this spreadsheet. You can specify both a special action and a condition under which the action is to be taken. One action may be specified for ordinary rays and one action may be specified for the reference raytraced from a new object point. If a special action is specified for ordinary rays but not for reference rays, the action specified for ordinary rays will apply to reference rays as well.
The possible special Actions are:
The possible Conditions are: