When doing stray light analysis, it is vital to identify all objects that are seen from the detector. Dr. Bob Breault calls these “critical objects”. These objects are important, because 100% of the stray light comes from them. If you can’t see an object (either directly, or reflected in a mirror) then you cannot get stray light from it. The mirrors in optical systems make finding critical objects a difficult task; it’s hard to do by intuition (unless your Bob Breault, who is really good at it). I solve this problem by placing a source on the detector and tracing backwards through the system. Any object in ASAP that is intersected by the rays from this source is a critical object. The ASAP STATS command, or the TRACE STATS command, prints a table of all of the objects that rays intersect, and this is the list of critical objects. The only burden on the user (after building the model) is to trace enough rays to get a good sampling of the system.
The advantage of this approach is:
1. It’s easy. It is not necessary to have a degree in optics to find a complete list of critical objects. ASAP is doing the work.
2. It’s unbiased. ASAP has no preconceived ideas about what is and is not seen from the detector. This allows users to identify critical objects that they may not think of on their own.
3. It’s three-dimensional. People can often visualize things well in two dimensions, but it’s hard to find “skew” paths that move through a complex three-dimensional geometry. Of course, ASAP (with its fast and fully non-sequential ray tracing) has no difficulties with this.
A useful ASAP® command for simulating systems where the wavefront is needed is the OPDMAP command. This command is used with a geometric ray trace, and it uses the optical path length of each ray on a surface to determine the shape of the wavefront. This is a traditional technique used in most classical lens design programs.
One example of where this is useful is in the modeling of an interferometer. The wavefronts from the test and reference arms can be calculated independently. One is then subtracted from the other with a COMBINE command. If needed, you can then use the $FCN and MODIFY commands to create a fringe pattern. This is useful because the geometric ray trace is simple to set up and typically traces quickly so you can investigate multiple design changes in a short period of time.
Keep in mind that this approach does not take into account diffraction from apertures, so it is usually best to perform a full physical optics simulation using the ASAP Gaussian beam superposition/decomposition technique, which is covered in depth in BRO’s Advanced Wave Optics Tutorial.
Often, an illumination system is required to meet a specific far-field intensity distribution. The engineer needs to know how many lumens are required to produce this pattern in order to determine if the proposed design approach is feasible. You can use ASAP® to determine the lumens using the following method:
Create a text file that defines the intensity distribution for use with the USERAPOD ANGLES command. In ASAP, create a point source that is apodized by the file created. Multiply the lumens by 4*PI.
A STATS command will then give the total lumens in the pattern. You can also generate an Iso-Candela plot to verify that the far-field distribution is correct.
The files listed below under “Related Files” demonstrate this example.
Note: If you make changes to the text file used for apodization, ASAP cannot pick up the change since the apodization data is stored in memory. By creating a copy of the text file and loading this dummy file first, it forces ASAP to read from the file.
When your geometry is very complicated, or your ray trace causes confusion in your cohorts, it may be possible to clarify yourself using text labels in ASAP®.
Text labels are created using an often-missed command argument, TEXT, in any of your common PLOT commands. Let’s look at a script example.
!! PLOT … TEXT example
!! Try this!
PLANE Z 0 RECT 9 9
WINDOW Y -2@12 X -2@12
PLOT FACETS 3 3 0 TEXT
-8 10 0, 2 0 0, 0 2 0, 2, ‘A square’
!! end of script example
Here we make a PLANE, so we have something to plot. We set the window to show the plane, then do a PLOT FACETS to show this in a Plot Viewer window. However, a TEXT argument has been added to the PLOT FACETS command. The line following that, with the string of numbers and a quoted string at the end, tells the Plot Viewer what text to show, how big to make it, and where to start.
The first three numbers are the (X, Y, Z) location where the text writing starts. Thus we start writing text, in this case, at the point (X, Y, Z) = (-8, 10, 0).
The next three numbers are an (X, Y, Z) vector for the text character spacing. So the spacing here is 2 units along the X direction, with none in the Y or Z direction.
The third set of three numbers are an (X, Y, Z) vector for the text character height. So the height here is 2 units along the Y direction, with no height component in the X or Z direction.
The last number, here a 2, is the ASAP color number for the text, in this case the color 2, red.
Finally, the text string to write, ‘A square’, appears in single quotes.
Note that commas were used to show the grouping of the parts of the argument outlined here. These are not required, but they make it easier to verify your inputs in a glance.
The result is text that not only shows in the 2D Plot Viewer, but also in the 3D Viewer. This is why the XYZ location, spacing, and size must be provided, and it makes it possible to label 3-dimensional items in meaningful ways, regardless of their orientation. This is great for demonstrating your work to others and helping them to get oriented to it quickly.
There are examples in the ASAP example script to illustrate this. You may want to play with these example scripts: PLOT_TEXT01.INR, PLOT_TEXT02.INR, PLOT_TEXT03.INR, SPOTS_POS01.INR, and OPTICAL_ACTIVITY.INR to get an idea of how you could use this to your advantage. Note that this option applies to many plot commands, and not just to PLOT FACETS. Use your imagination, and you’ll find many places where this will be useful.
We often hear from our software clients that much of their effort goes into developing presentations and sharing results with other members of their teams. If you find yourself presenting results using the ASAP® 3D Viewer, there are a couple of things you may not realize that could add impact to your show. Rather than send a static screen capture of your results, you can send someone a 3D vector file, and a BRO external viewer to see the results.
First, the BRO 3D Viewer (Bro3DViewer.exe in the ASAPVxRx bin directory) can be run without an ASAP license key, and may be freely shared with others to let them view your ASAP 3D files. The ASAP default vector file, ASAPTEMP.VCR, is usually viewed in ASAP using $VIEW. This file may be sent, along with the viewer, to allow your associates to have a 3D look at your work.
If you have several results to present, you may use $COPY to copy these 3D vector files to other, meaningful, names. Distribution files (e.g. BRO009.DAT) created by a measurement command like SPOTS POSITION or FIELD ENERGY may also be viewed using the external 3D Viewer, though it may be necessary to change the file type in the File Open dialog to the “All Files (*.*)” option to find them when you browse. These can be loaded along with geometry or other vector information for a very informative look at your work.
Further, adding text labels to the geometry, ray trace, or measurement data in the 3D Viewer may make it easier for them to understand, but that’s a subject for another tip.
Injection molded plastic parts typically have ripples on the surface that result from hand polishing the tool, sinking of the plastic, etc. This can be referred to as slope error tolerance where the slope error is the deviation of the normal at any point on the injection-molded part when compared to the designed part. To first order, you can simulate this effect as follows:
First, define a Harvey model in ASAP® with the first two parameters always 1 and -13. The third perameter is the average slope error deviation divided by 10.
HARVEY 1 -13 0.1 !! simulates 1 degree random slope error
Next, apply the model to each surface on the part:
INTERFACE … !! Define optical properties as normal
ROUGHNESS MODEL .1
Using the AXIS and EXTREMES POSITION commands in ASAP®, one can easily find the minimum and maximum radial coordinates of rays on a given surface. This is particularly useful when you have a non-rotationally symmetric distribution of rays on a surface and would like to find the radial position of the outer or innermost rays.
For example, if the surface of interest is in the XY plane, issue an AXIS Z command, followed by STATS POSITION and EXTREMES POSITION to determine the radial distance of the extreme rays from the Z axis. The AXIS Z command changes the coordinate system in which the STATS POSTION data is reported to cylindrical coordinates while the EXTREMES POSITION command reports the location of the extreme rays. If your script continues on, don’t forget to reset your coordinate system to the global Cartesian coordinate system with AXIS OFF.
GRID ELLIPSE Z 0 -2 2 -4 4 101 101
SOURCE DIRECTION 0 0 1
SHIFT 20 30 0
WINDOW Y -50 50 X -50 50
$GRAB ‘Ray with MINIMUM R component’ 1 1 RMIN
$GRAB ‘Ray with MAXIMUM R component’ 1 1 RMAX
$REG RMIN RMAX
If you are importing a lot of your geometry from outside CAD programs into ASAP®, instead of using the IGES or GTX translator to do material assignments in the geometry INR file, you can use a $DO loop in an ASAP script to make the assignment. This makes it easier to quickly change the material and surface properties for repeated analysis, or to vary the property in tolerance analysis runs.
To do this, start by separating different material groups into different IGES or GTX files. For example, if you have a CAD file with a reflector and a lens, export a file with just the reflector and another with just the lens. Translate both files using the translator but don’t do any material assignment – simply press Enter or select “File-Finish” to create an ASAP INR file. Then use the following ASAP script syntax in your main file:
$GRAB ‘GROUP’ 1 1 NUMOBJS
$DO 1 (NUMOBJS)
ROUGHNESS MODEL 1
REDEFINE COLOR 3
$GRAB ‘GROUP’ 1 1 NUMOBJS
$DO 1 (NUMOBJS)
INTERFACE COAT BARE AIR ACRYLIC
ROUGHNESS MODEL 2
REDEFINE COLOR 4
Scripting the material and surface assignments in this matter allows the properties to be changed easily in the script and/or made into variables that can be randomized for tolerance analysis.
Bonus tip: When building complicated CAD models, you are most likely separating your objects into layers. Get into the habit of making a new layer for each optical property in your CAD model, and you will have a head start on exporting your system for analysis in ASAP. Think of these layers as “optical property layers”. Turn them on one at a time as you export your model, then follow the above instructions for applying optical properties to the pre-partitioned IGES or GTX files you created.