Soon, we will launch a new and updated customer portal, which is an important step toward providing our customers with one place to learn, interact, and get help.
Learn more.

How Do I Create Presentation Quality Graphics and Animations?

This article covers various methods for creating, annotating, exporting, and animating quality graphics for presentations and reports. 
 

Important Note: This applies to Zemax release 13 and older. It is retained here for reference purposes. 

Dan Hill
10/27/2005
Frequently Asked Questions
Zemax Legacy releases
 


Important Note: This applies to Zemax release 13 and older. It is retained here for reference purposes. 

Introduction

Let’s face it: bold graphics and visually appealing diagrams will catch the attention of your audience, they are impressive, and have a tendency to leave a mark of professionalism. 

Since quality graphics can have a large impact on the professional appearance of a presentation and/or report, Zemax supports various graphical functions which make it easy to completely transform your diagrams.

As an example, the 2D Layout in Zemax is very useful to the professional engineer, but really doesn’t do much for drawing the attention of a general audience:

2D Layout



We can improve the presentational quality of the drawing by simply choosing a default Shaded Model in Zemax:

Default Shaded Model


Or, by changing color combinations, adding some rotation, altering opacity levels, and drawing a ¾ slice of each element, we can easily produce something like this:

Revised Shaded Model


And lastly, we can use the power of other software to create a movie from multiple screen captures:

Aminated Shaded Model



This article is designed to provide a detailed discussion on the various techniques and tools available for exporting and creating graphics in Zemax.  We will cover how to copy/export graphics, annotate them, change opacity levels and colors for surfaces, and develop animations quickly and easily.


Exporting Zemax Graphics
 

Each and every graphic window in Zemax has a “Window” menu item with several submenus.  In particular, the “Export” submenu has various formats by which you can export the displayed graphic window.


Export Submenus



The export format options, as indicated above, are Metafile, BMP, JPG High Quality, JPG Medium Quality, and JPG Low Quality.  Selecting any one of the formats will invoke the Windows “Save As” window, from which you can save the file with the desired name and into the desired directory.


Windows Save As dialog



The saved file may be imported into many different Windows applications, and may be post-edited if you wish.  For presentations, these files may be easily imported into programs such as Microsoft PowerPoint.  For details on importing these files, please refer to the documentation for that application.

For the JPG export options, medium quality typically produces acceptable image quality with significant reduction in file size.  If you do not plan on re-sizing your images, then any of the export options should be sufficient. 

However, if you plan on modifying the size of your graphics (increasing), it is best to export the image as a Windows Metafile to eliminate the “grainy” or “fuzzy” appearance.

The reason for this is that a Metafile, unlike BitMap or JPG, is a vector graphic format.  The basic idea is that a vector graphic contains a sequence of drawing instructions that describe how to render the image, making it completely device independent1.  For a complete discussion, click here.  Therefore, you will not degrade the image quality by shrinking or stretching the Metafile.

To demonstrate, the following two diagrams are enlarged images of an originally small Detector Viewer Plot.  One is a Metafile, and one is a BitMap.  It’s fairly obvious as to which one is which.



Enlarged Bitmap - Low Resolution



Enlarged Metafile



Copying to the Clipboard
 

One extremely useful Windows feature is the clipboard.  The clipboard is a “holding area” for graphics and text.  The advantage to using the clipboard is that virtually all Windows programs can either import or export to the clipboard.  To get a Zemax graphic into the clipboard, you may select Window > Copy Clipboard from the menu of the displayed graphic window.  Alternatively, you may press Ctrl + C in the active window.  Nothing will appear to happen as the data transfer is extremely fast.  However, the data is available to other applications.

Not only is copying to the clipboard quick and easy, but metafiles are used to copy graphics to the clipboard, which means Windows uses the vector representation to draw this graphic when pasted or imported into other Windows programs. 

Newer, 32 bit applications use the “32 Bit Enhanced” format.  When a 32 bit format is used, the extension is EMF, for Enhanced Metafile Format.  Either of these formats can be used, and may be chosen from the Graphics tab of the File > Preferences dialog:


File Preferences dialog



Another way of getting Zemax graphics into other applications is to perform a screen capture which creates a BitMap image of either the entire screen or any single window.  To capture the entire screen as a BitMap image, press Ctrl + Print Screen on the keyboard.  To capture a single window, select that window and pres Alt + Print Screen.  Once the screen Bitmap has been captured, the image can typically be pasted into other applications via Ctrl + V or Edit > Paste.


Annotating Graphics
 

Graphics may be exported from Zemax and annotated in external software, or they may be annotated directly in Zemax via a handy annotation feature.  The annotation feature supports Line, Arrow, Text, and Box commands, in addition to an annotation editor.  Each command has its own specific syntax, which is covered in detail in the “Chapter 2: User Interface > Graphic windows operations > Using the annotation feature” section of the Zemax User’s Guide. 

To use the annotation feature, select Window > Annotate from the main menu of the displayed graphic window:



Annotation Commands



If we select text for example, the Annotate Text dialog will appear, to which you can type in your desired text:



Annotate Text dialog


Once “OK” is selected, you may position the cursor to the desired location and click the left mouse button:


Text Annotation in 3D Layout



To edit or remove the newly created annotation, the Annotate editor may be used (Window > Annotate > Edit).  The Annotate Editor is in the form of a text editor which lists each command in its text syntax form.  This allows for more precise control over the exact locations of lines and text, the control over the text font, and the ability to add more complex annotations.



Annotate Editor



To remove an annotation, simply delete the line which represents this annotation in the Annotate Editor.  Note that annotation files may also be saved and loaded via the “Save” and “Load” buttons at the bottom of the Annotate Editor.  With some additional commands, the diagram could be labeled more completely, which may help distinguish the two different configurations:



Text Annotation in 3D Layout


Changing Colors for the Shaded Model Plots
 

Surfaces (Sequential) and Objects (Non-Sequential) may be colored differently for display in the Shaded Model plots in Zemax. 

Surface and Object colors may be changed under the Type tab of the Surface Properties (Sequential) and Object Properties (Non-Sequential) dialogs, via the pull down menu for “Surface Color” and “Object Color,” respectively. 

 

 Surface Properties dialog - Surface Color  SEQUENTIAL SURFACES  (Lens Data Editor)

 

 

 

 Object Properties dialog - Object Color  NON-SEQUENTIAL OBJECTS (Non-Sequential Component Editor)

 

The colors are listed by number, but as you select a different number, the color is displayed to the right of the pull-down menu.  This makes it easy to “preview” each color before choosing the desired color for that particular surface or object. 



Surface Properties - Displayed Color

There are 24 colors which are available in the menu at any given time.  However, you have the flexibility to change the color which corresponds to each number, giving you the freedom to create an unlimited number of different colors available for use in Zemax. 

These colors are controlled under the “Colors” tabs of the File > Preferences dialog.  Each color is represented by a combination of values (ranging from 0 to 255) of the three primary colors, red, green, and blue.  To change a color, simply type in the desired values for red, green and blue. 

File Preferences - Colors



Once you have change each color number to the desired color, click “Apply,” followed by the “OK” button.  Note that you may “Reset” the colors to the defaults if you wish later on.

Now, the color numbers selected in the properties dialogs will correspond to the newly created colors.  This can be very useful to create visually appealing plots with coordinating colors.  In other cases, certain colors can be applied for emphasis, or to help distinguish certain features of your design.


Shaded Model of Voxel Detector



Opacity and Shaded Model Settings

Surfaces and Objects can also be made semi-transparent, which can make a significant improvement on almost any Shaded Model diagram.  Without it, ray trajectories inside volumes would be unseen by the viewer, objects completely or partially inside of other objects would be invisible, and objects behind other objects could not be seen at various plot rotations.
 
 Prisms with no opacity  Prisms with opacity
 WITHOUT OPACITY  WITH OPACITY


The opacity setting for each object or surface is right next to the Color setting in the Object or Surface Properties dialogs.  An opacity of 100% means the object/surface is completely opaque, or non-transparent.  An opacity of 0% is effectively the same as not drawing the object/surface altogether.


Object Properties - Opacity Setting



Sometimes, it takes trial and error to achieve the desired opacity levels for each surface and object to make your graphic look as you so desire.

In addition to the surface specific settings, the Shaded Model and NSC Shaded Model have several settings which may be used to change the appearance of your diagram.  For the Shaded Model of sequential systems, there are settings for sectional drawing, Radial Segments, Angular Segments, Brightness, Background, and Opacity.


Shaded Model Settings



For creating “smoother” surfaces, the radial and angular segments may be increased.  The Background will change the background color of the Shaded Model Layout, and can be set to a number of different colors, including the 24 different colors defined by the File > Preferences menu.

The brightness can be adjusted as well.  A higher percentage will increase the brightness of the display. 

In some cases, it is nice to be able to turn off the opacity settings without having to individually change the opacity for each individual surface via the Surface Properties dialog.  Thus, the “Opacity” setting can be set to IgnoreMethod 1 and Method 2 will use different algorithms to render the scene.  Some systems are difficult for OpenGL to render when there are a mixture of opaque and transparent surfaces and objects.  Simply choose whichever method yields the preferred rendering.

You may also choose to draw fractional segments of your elements via the “Draw Section” pull down menu in the settings of the Shaded Model.  Sections can be chosen in quarter increments, ¼, ½, ¾, or Full. 


 

 Full Aspheric Lens    Sectional Aspheric Lens

 

Animations
 

With the assistance of other software applications, animations of any graphic in Zemax can be generated very easily.  There are numerous image capture and animation software packages available, and we are neutral on which one you should buy and use.  In this article, we have utilized Easy GIF Animator, an inexpensive and easy-to-use GIF animation software. 

Easy GIF can take a set of images, called frames, and display them in a sequence with a specified delay to create an animation effect.  An animated GIF file in Easy GIF Animator may be created from .GIF, .JPG, .JPEG, .BMP, .ICO, .EMF, and .WMF files.  As Zemax can export graphics to .JPG, .BMP, .EMF, and .WMF formats, a series of images can be exported from Zemax and imported into Easy GIF Animator as frames for animation.

Each window can be exported one at a time manually, or you may use the power of ZPL to automate this process for you.  ZPL includes several keywords which can export graphics from ZPL.  These keywords mimic the exact GUI calls to export images. 

The EXPORTBMP, EXPORTJPG, and EXPORTWMF will export any graphics window as a BMP, JPG, or Windows Metafile, respectively.  One of these keywords, in combination with a string function ($STR), can export multiple images under different file names so that they can be loaded into your animation software.

For the purposes of demonstrating the automation of exporting images through ZPL, we will use a simple sequential file which has been constructed solely for the purposes of drawing a coated mirror.  In conjunction with this file, a short macro will be used to export multiple JPEG images as the MIRROR is tilted about its Y axis.  Both files are available for download at the last page of this article.

 File Pointer  FILE:  Coated MIRROR.ZMX

 

The following macro sets the Tilt About Y parameter on the Coordinate Break Surface before the mirror in a FOR loop.  For each tilt value, the Shaded Model window is updated and exported as a JPG file under a different filename.

Macro



By importing the 36 images into Easy GIF Animator, we can create an animated rotation of the coated mirror for presentation purposes.

Coated Mirror Movie

With the assistance of ZPL and animation software, the possibilities for creating Zemax movies are endless, and will really attract the attention of your audience.  As each animation package is different, we recommend consulting the product’s documentation for details on creating animations from files which have been exported by Zemax.  As you may find in several of the Zemax Knowledgebase articles, there are any number of possibilities to creating your own animations from exported Zemax graphics.

Summary and References

There are various tools in Zemax which may be used to enhance the quality of your graphics for presentation purposes.  Graphics may be copied and pasted into other applications, exported for external editing, annotated from within Zemax, and exported to generate animations.  In addition, colors and opacities may be changed for each surface or object for professional design graphics.

References

1.
  http://www.taltech.com/support/entry/raster_vs_vector_images_and_how_they_relate_to_barcodes
2. Zemax Optical Design Program User’s Guide, Zemax Development Corporation