Hi Sebastian,
It’s hard to say without seeing your file, but the ReadNextResult methods often have an integer return parameter called vignetteCode that should tell you whether a ray is vignetted. You can then decide not to plot the rays based on this parameter. The vignetteCode should be zero if the ray isn’t vignetted, otherwise I think it is the surface number at which the ray gets vignetted.
Have a look at example 22 in the ZOS-API Syntax Help, here’s an excerpt of how they read the rays:
while success
if ((errCode == 0 ) && (vigCode == 0))
x_ary(field, wave, rayNumber) = x;
y_ary(field, wave, rayNumber) = y;
end
As you can see, they ignore the rays whose vigCode (which is the vignetteCode) are non zero.
Hope this helps.
Take care,
David