How to use the Black Box Lens surface

The Black Box Lens surface solves the problem of how to share optical design data without revealing design secrets. This article explains how to export part or all of an optical design as a Black Box Lens surface, and how to use that surface in subsequent optical design, optimization and analysis.

Authored By Mark Nicholson


Article Attachments


While customers and suppliers may need to receive ray-traceable data files in order to perform their work, providing this data exposes the intellectual property of the designer. Simply sending information on pupil size, image location, etc. is not useful if the recipient has to design surrounding optical components. Thus, OpticStudio provides the Black Box Lens export tool.

The Black Box Lens Surface contains all the information needed to trace real rays with any specification, exactly as if the full design data were present in the Lens Data Editor. Yet, the original data is hidden from view, unable to be edited, and is encrypted using a 256-bit algorithm.

This article describes the creation and use of Black Box Lens files.

Making a Black Box Lens Surface

Converting a design to a Black Box Lens Surface is usually done when the design is complete, although it can be done at any stage in the design cycle. We recommend that you add two extra dummy surfaces to define the first and last surfaces in the range of surfaces to export. These would usually be positioned at mechanical datums (any maybe represent the extent of the mechanical housing holding the optics, for example) or at pupil locations.

In this example (which can be downloaded from the link one the last page of this article), it is intended to export the final lenses in this double-Gauss objective. Dummy surfaces have been added to represent the mechanical housing that holds the lenses.


Prior to export, all surfaces in the intended range should have fixed apertures placed on them, because when we play the lens back Zemax needs to know the actual physical extents of each lens to compute vignetting. Convert Semi-Diameters to Circular Apertures of the Apertures tool in the LDE Toolbar is a useful tool. Any aperture type except the User Defined Aperture (UDA) can be used to define the mechanical extents of each lens within the exported region.

To create the Black Box file, click Zemax Black Box under File...Export.


It is recommended that you leave the option 'Create and load test file' checked, so that OpticStudio will not only create the Black Box file, but will also delete the surfaces in the specified range, load the black box, and save the file into a file with the name {original filename}_BB.zmx. This makes it easy to ensure that the Black Box file really does represent the exported file, and is an important quality assurance step. The new file will be automatically loaded.


and you can confirm that the ray-trace results are exactly the same between the original and Black Box versions of the file.

Consequences of Using a Black Box Surface

There are some consequences inherent in the nature of a 'black box', some of which are obvious and some maybe not. Rays hit the front surface of a Black Box and emerge from the back surface exactly as if they had been ray-traced through the equivalent surfaces in the Lens Data Editor, but without exposing any of the surface data. Things that may or may not surprise you include:

  • The data for all surfaces inside the Black Box is hidden, and therefore cannot be accessed by analysis features, optimization operands or ZPL commands. You cannot, for example, tolerance a black box file, or perform thermal analysis. It is a black box and it cannot be altered once created. The surfaces outside the Black Box can of course be analyzed, optimized, toleranced, etc. as normal.
  • Usually OpticStudio distinguishes between rays that hit apertures and are clipped, rays that totally internally reflect, and rays that miss a surface because there is no valid ray-surface intercept location, and gives different error codes for each case. When tracing a Black Box, all OpticStudio knows is that the ray went in but did not come out, and a 'Ray Miss' error is generated. Note that if the chief ray is not traceable (as in a telescope with a central obscuration, for example) wavefront calculations will not be possible as there is no chief-ray reference data.
  • No ray data can be generated on any surface inside the Black Box, so the Object, Stop and Image surfaces cannot be inside the Black Box. OpticStudio requires direct access to all the ray data on these three surfaces.
  • Physical optics analysis is not appropriate for black-box optics, as only output ray data is available. FFT and Huygens PSF/MTF, etc. all work as normal.
  • The range of surfaces exported may include Coordinate Breaks and surface tilts/decenters, but the first and last surfaces must be within the same coordinate system so that the input and output planes are only separated by a thickness.

The thickness of the Black Box surface is reported in the Lens Data Editor, as it is needed for the placement of subsequent surfaces. This does not disclose any details of the internal design, it simply gives the distance between the input and output planes. Since the thickness cannot be changed, the Black Box must be played back in the same 'mirror space' as the original lens. Hence, if the original design came after a mirror, so must the Black Box.

Note: An alternative to the Zemax Black Box tool is the Zernike surface. This surface allows aberration data to be defined for a single field point, wavelength and conjugate ratio. See "How To Model a Black-Box Optical System Using Zernike Coefficients".


Was this article helpful?
8 out of 11 found this helpful



Please sign in to leave a comment.