While analyzing the results of batch ray traces, I noticed that some rays seemed to be transmitted through the system that I did not believe should have made it. To test this, I set up a series of ray traces, all with the same set of input ray positions and direction cosines (no difference whatever). The only parameter I let vary between the traces was the final surface of the ray trace. In other words, my setup contained this line:
RayTraceData = raytrace.CreateDirectPol(total_rays_in_both_axes, ZOSAPI.Tools.RayTrace.RaysType.Real, 0,0,0,0,startSurface,endSurface);
where only endSurface was allowed to vary. I stepped endSurface through every surface and recorded the vignetteCode value of every ray. Plotting the results, I have found a few instances where a subset of the rays that vignette at the nth surface are not listed as vignetting at the n+1st surface. For example (see attached), the plot for surface 18 shows rays that were listed as vignetting at surfaces 7, 8, and 9, which are no longer listed on the plot for surface 19. This phenomenon happens again at the transition from surface 46 to 47. This is a problem, since once rays have vignetted in the system, they should remain vignetted throughout. I am wondering whether this a known bug, and more importantly, if there is a known workaround for keeping track of all rays that have vignetted at any surface in the system without having to ray trace to every surface individually.