ZOSAPI.Tools.RayTrace Namespace Reference
Last update: 17.07.2025Classes | |
| interface | IBatchRayTrace |
| Interfaces and methods for running a ray trace on multiple rays at a time. This interface can be accessed via the IOpticalSystemTools interface. More... | |
| interface | ILightningTrace |
| Interfaces and methods for running the LightningTrace tool. This interface can be accessed via the IOpticalSystemTools interface. More... | |
| interface | INSCRayTrace |
Interfaces and methods for running a non-sequential ray trace. This interface can be accessed via the IOpticalSystemTools interface. NOTE - due to architectural limitations, currently only one INSCRayTrace instance can be used at a time, across all IOpticalSystem instances. The first call to IOpticalSystemTools.OpenNSCRayTrace will succeed, while all further calls will return null until the the single INSCRayTrace instance is closed. It is anticipated that this limiation will be removed in future versions of the API. More... | |
| interface | IRayTraceDirectPolData |
| interface | IRayTraceDirectUnpolData |
| interface | IRayTraceNormPolData |
| interface | IRayTraceNormUnpolData |
| interface | IRayTraceNSCData |
| interface | IRayTraceNSCSourceData |
| interface | IZRDReader |
| interface | IZRDReaderResults |
Enumeration Type Documentation
◆ LTEdgeSasmpling
◆ LTRaySampling
◆ NSCTraceOptions
◆ OPDMode
Usage (see Example 23 for a full sample)
C#
// image surface number and primary wavelength
int pwav = 0;
for (int a = 1; a <= TheSystem.SystemData.Wavelengths.NumberOfWavelengths; a++)
{
if (TheSystem.SystemData.Wavelengths.GetWavelength(a).IsPrimary)
pwav = a;
}
// creates array of Y coordinate chief ray values
double[] chief_ary = new double[max_num_field];
for (int field = 1; field <= max_num_field; field++)
{
double hy = TheSystem.SystemData.Fields.GetField(field).Y / max_field;
// gets single value without using MFE(see ZPL OPEV)
chief_ary[field - 1] = TheSystem.MFE.GetOperandValue(ZOSAPI.Editors.MFE.MeritOperandType.REAY, nsur, pwav, 0, hy, 0, 0, 0, 0);
}
Definition: InterfacesMFE.cs:12
Definition: InterfacesEditors.cs:12
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5
C++
// image surface number and primary wavelength
//
int pwav = 0;
for (int a = 1; a <= TheSystem->SystemData->Wavelengths->NumberOfWavelengths; a++) {
if (TheSystem->SystemData->Wavelengths->GetWavelength(a)->IsPrimary)
pwav = a;
}
// creates array of Y coordinate chief ray values
double *chief_ary = new double[max_num_field];
for (int field = 1; field <= max_num_field; field++) {
double hy = TheSystem->SystemData->Fields->GetField(field)->Y / max_field;
// gets single value without using MFE(see ZPL OPEV)
chief_ary[field - 1] = TheSystem->MFE->GetOperandValue(MeritOperandType_REAY, nsur, pwav, 0, hy, 0, 0, 0, 0);
}
Matlab
% image surface number and primary wavelength
nsur = TheSystem.LDE.NumberOfSurfaces;
pwav = 0;
for a = 1:TheSystem.SystemData.Wavelengths.NumberOfWavelengths
if TheSystem.SystemData.Wavelengths.GetWavelength(a).IsPrimary == 1; pwav = a; end;
end
% creates array of Y coordinate chief ray values
chief_ary = zeros(max_num_field);
for field = 1:max_num_field
if max_field == 0; hy = 1; else hy = TheSystem.SystemData.Fields.GetField(field).Y / max_field; end;
% gets single value without using MFE (see ZPL OPEV)
chief_ary(field) = TheSystem.MFE.GetOperandValue(ZOSAPI.Editors.MFE.MeritOperandType.REAY, nsur, pwav, 0, hy , 0, 0, 0, 0);
end
Python
# image surface number and primary wavelength
nsur = TheSystem.LDE.NumberOfSurfaces
pwav = 0
for a in range(1, TheSystem.SystemData.Wavelengths.NumberOfWavelengths + 1):
if TheSystem.SystemData.Wavelengths.GetWavelength(a).IsPrimary == 1:
pwav = a
# creates array of Y coordinate chief ray values
chief_ary = np.zeros(max_num_field)
for field in range(1, max_num_field + 1):
#hy = TheSystem.SystemData.Fields.GetField(field).Y / max_field
hy = 1 if max_field == 0 else TheSystem.SystemData.Fields.GetField(field).Y / max_field
# gets single value without using MFE (see ZPL OPEV)
chief_ary[field - 1] = TheSystem.MFE.GetOperandValue(ZOSAPI.Editors.MFE.MeritOperandType.REAY, nsur, pwav, 0, hy , 0, 0, 0, 0)
| Enumerator | |
|---|---|
| None | |
| Current | |
| CurrentAndChief | |