asapdesign.wordpress.com
ASAP Practical TutorialStray Light Analysis (Day 1)
NextGenASAP
asapdesign.wordpress.com
Day 1
ASAP Introduction
• Brief Review of ASAP
• Building Geometry (Edge & Surface)
• Bounding Object
• Using Macros
• Create Sources(GRID, EMITTING)
• Radiometry / Photometry
• Ray Splitting
1/135
asapdesign.wordpress.com
Day 2
Stray Light Practice
• 2D Drawing in AutoCAD
• 3D Drawing in Rhinoceros
• Import IGS Files
• Making System File
• Emitting Ray Source
• Modify Coating Properties
• Searching Ghost/Flare Rays
• Ghost / Flare Examples
2/135
asapdesign.wordpress.com
Introduction to ASAPLearn approaches to problem solving in ASAP with an introduction to the program, and pre-defined imaging and illumination problems
Automotive Illumination (Advanced Tutorial)Learn advanced techniques for the design and analysis of automotive illumination systems in ASAP
Bio-Optics (Advanced Tutorial)Learn advanced techniques for applying ASAP in the life sciences, including volumetric light scattering and fluorescence
Ghost Analysis (Advanced Tutorial)Learn advanced techniques for the design and analysis of imaging systems in ASAP
Illumination Design (Advanced Tutorial)Learn advanced techniques for the design, modeling, and analysis of general illumination systems in ASAP and ReflectorCAD
Phosphor Modeling (Advanced Tutorial)Learn advanced techniques for the design, modeling, and analysis of PC-LED systems in ASAP
Stray Light (Advanced Tutorial)Learn advanced techniques and problem-solving approaches to stray light analysis in ASAP
Wave Optics (Advanced Tutorial)Learn advanced techniques for performing wave optics analyses in ASAP
BRO Software Training
3/135
asapdesign.wordpress.com
ASAP NextGen Interface
Menus and Icons
Workspace
Tap Control for Workspace
Input/Output
Command Line Input
Status Bar
Text Output Window
Result Area(Plot, Display and Files)
Custom Toolbar
4/135
asapdesign.wordpress.com
Information Flow for Verifying Geometry
Plot Window
PLOT EDGESPLOT FACETSPROFILES
…
ASAP Kernel
Builder Scripters
Plot Archive Fileasaptemp.plr
Database
3D Vector Fileasaptemp.vcr
bro030.dat
Define system
5/135
asapdesign.wordpress.com
Ray Information FLOW
6/135
asapdesign.wordpress.com
1) Define the System : Define the properties of optical system-. System setting : SYSTEM NEW, RESET, UNITS, WAVELENGTH...-. Optical setting : COATING PROPERTIES, MEDIA, MODELS...
2) Build the Geometry : Define and verify the geometry of each component-. Lens : LENS, LENSES...-. Edge : EDGE, EDGES...-. Surface : SURFACE, SURFACES...
3) Create Sources : Define and verify a set of accurately simulating rays-. Sources : GRID, EMITTING, SOURCE, FLUX TOTAL...
4) Trace the Rays : Allow the rays to move through the system-. Axis setting : WINDOW...-. View : PLOT FACETS, PROFILES...-. Rays : TRACE, SAVE, PATH...
5) Perform the Analysis : Calculate the power, irradiance or other characteristics of a system-. Calculate : CONSIDER, SELECT, PIXELS...-. Analysis : DISPLAY, PROFILES, SPOTS, POLT, LIST, GET, RADIANT...
The Five-step ASAP Process
7/135
asapdesign.wordpress.com
Set Working Directory
File > Working Directory…
8/135
asapdesign.wordpress.com
Basic Template
9/135
asapdesign.wordpress.com
Basic Template
SYSTEM NEW RESET
BEAMS INCOHERENT GEOMETRIC
!! Define system units and wavelengths UNITS MILLIMETERS 'Watts' WAVELENGTH 550 NM
!! Define coatings COATING PROPERTIES
0 1 'TRANSMIT' 1 0 'REFLECT' 0 0 'ABSORB'
!! Define Media MEDIA
1.5 'GLASS'
!! GEOMETRY DEFINITIONS BEGIN HERE !! SOURCE DEFINITIONS BEGIN HERE !! TRACE RAYS WITH OPTIONAL PLOT !! WINDOW Y Z !! PLOT FACETS 5 5 0 OVERLAY !! TRACE !! PLOT !! ANALYSIS BLOCK BEGINS HERE
10/135
asapdesign.wordpress.com
• Use the ASAP Builder: Which is a spreadsheet-style tool
• Use the command language to write an ASAP command script
• Type the command directly into the Command Input window
• Use the CAD programs and import the shapes into ASAP: Rhinoceros, SolidWorks, Pro-E, etc.
• Import the Lens designs directly from Zemax, OSLO or Code V: Using the translators available with the ASAP/Optical module
Options for Building Geometry
11/135
asapdesign.wordpress.com
ASAP does not treat a solidASAP views the structure as three independent surfacesThat forms an element of a shell around the volume
Surface & Edge
• SurfaceThe surface is usually where interesting things happen-. The change in direction of a ray-. Scattering / Anti-reflection-. Beam-splitting coating
SURFACE definitions like the TUBE, PLANE and SPHERICAL are expressed within ASAPBut, it is difficult or impossible to specify all geometry as an explicit polynomial
• EdgeThe edge was added to ASAP just to allow the importing of geometry from CAD programs-. Edge-based geometry can be imported from CAD programs via the ASAP IGES translator-. ASAP also makes these same tools available to create EDGE-based objects directly, using the Builder or the scripting language-. Edges are a set of connected points-. The connections may be straight lines or smooth curves-. It is based on Bezier polynomials-. EDGE-based objects are somewhat slower to ray trace than SURFACE-based geometry
12/135
asapdesign.wordpress.com
Every object that you define is considered to be an entity as wellHowever, Not all entities will have object status
Object & Entities
• Object-. Object is a geometrical surface with boundaries, a position, an orientation and optical properties-. Objects interact with rays
• Entity-. Entity is a geometrical definition that does not interact with rays-. Edge has no interface command associated with it
13/135
asapdesign.wordpress.com
Tracing Ray (with Graphics)
Profiles 3D Viewer
WINDOW Y -3 3 Z -1 11PROFILES 0 0 -1 OVERLAY ‘SINGLE RAY TRACE’TRACE PLOT
MISSED ARROWS 10WINDOW Y -3 3 Z -1 11PLOT FACETS 8 8 OVERLAY ‘SINGLE RAY TRACE’TRACE PLOT$VIEW
14/135
asapdesign.wordpress.com
When verifying geometry, use PROFILES or PLOT FACETS with $VIEW
Verifying the Geometry (PROFILES, PLOT FACETS)
PROFILES$VIEW
PLOT FACETS$VIEW
15/135
asapdesign.wordpress.com
PLOT
PLOT Description
BEAMS Plot extent of each Gaussian beam within …
CURVES [ -n ] Plot a wire frame outline of curvesn : Plot last n curves
EDGES [ -n ] Plot a wire frame outline of edges in the currently specified graphics windown : Plot last n curves
ENTITIES [ -n ] Plot surface, edge, lens entities and local boxes in …n : Plot last n curves
FACETS [ n n’ [ m ] ] Plot parametric representation of objects in …n n’ : Minimum or maximum number of subdivisions in the two parametric
directions for each patch of an objectm : Maximum number of facets per object
LENSES Plot lenses in …
LIMITS Plot a wire frame box denoting the extent of the specified objects limits box in …
LOCAL [ -n ] Plot local boxed of surface entitiesn : Plot last n curves
POLARIZATION Plot polarization state ellipses
RAYS Plot vectors along the direction of each ray that is contained within …
SURFACES Plot surfaces in …
16/135
asapdesign.wordpress.com
EDGE
EDGE Description
ARC creates a circular arc on the plane
ELLIPSE creates an elliptical edge/curve
LINE creates a line edge
OVAL creates a polygonal edge
POINTS creates a generalized planar edge
RACETRACK creates a racetrack or rectangular edge with smooth(continuous) rounded corners
RECTANGLE creates a rectangular edge/curve
ROUNDED creates a rounded-corner, rectangular edge/curve
SAWTOOTH creates a sawtooth pattern edge in the plane
17/135
asapdesign.wordpress.com
EDGE (ELLIPSE)
SYSTEM NEWRESET
EDGEELLIPSE Z 0 1 2 16 45 270
WINDOW Y -2 2 X -2 2PLOT CURVESRETURN
ELLIPSE X x y z [ n a a’ ]
n number of points on the ellipse
a a’ angular range
18/135
asapdesign.wordpress.com
The OBJECT command is how which entities to use to construct the objectUse the ‘dot’ notation, which allows us to count backward to select the desired entities
ELLIPSE Edge
RECTANGLE Edge
OBJECT
Object Building
SYSTEM NEWRESET
EDGERECTANGLE Z 0 .5 .5 64 0 360
EDGEELLIPSE Z .5 .5 .5 64 0 360
OBJECT.1 .2 'EXTRUDING_OBJECT'
PLOT EDGES OVERLAYPLOT FACETS 71RETURN
25/135
asapdesign.wordpress.com
REDEFINE (Geometry Color)
SURFACEELLIPSOID 1 1 1 0 0 0
OBJECT ‘ELLIPSOID_Z0’REDEFINE COLOR 2 !! Color setting
PLOT FACETSRETURN
REDEFINE command adds options to an object
REDEFINE [ SURFACE j ] [ THICKNESS t ] [ COLOR k ] [ ‘name’ ]
SURFACE j transfers to alternate surface
THICKNESS t flag to thicken the object surface(s)
COLOR k assigns a specific color to the object
1 Reverse video
2 Red
3 Light Blue
4 Orange
5 Yellow
6 Purple
7 Sea Green
8 Maroon
9 Cyan
10 Chartreuse
11 Blue
12 Magenta
13 Green
14 Salmon
15 Olive Drab
16 Light Brown
17 Forest Green
18 Goldenrod
19 Plum
20 Tan
21 Turquoise
22 Gold
23 Thistle
24 Tomato
25 Wheat
26 Violet
27 Background
31/135
asapdesign.wordpress.com
2-Dimensional ARRAY
SYSTEM NEWRESET
SURFACEOPTICAL Z 0 5 ELLIPSE 5 5
ARRAY 4 15 0 0 4 0 15 0OBJECT 'BUMPS'
WINDOW Y XPLOT FACETS$VIEW
RETURN
ARRAY n x y z [ n’ x’ y’ z’ ] [ EXPONENT p [ p’] ] [ BOUNDS ]
ARRAY elements are associated with an OBJECT
n n‘ number of linearly spaced elements
x y z x’ y’ z‘ reference point shift
p p‘ reference point coefficient exponent
36/135
asapdesign.wordpress.com
PLANE Bounds with ARRAY
SYSTEM NEWRESET
SURFACEELLIPSOID 5 5 5 0 0 0 Z
ARRAY 2 15 0 0 2 0 15 0 BOUNDS !! add BOUNDSOBJECT 'SURFACE_ELLIPSOID'
SURFACEPLANE Z 2 RECT 30 30
OBJECT 'SURFACE_RECT'
BOUNDS .2
WINDOW Y XPLOT FACETS 51 51RETURN
ARRAY n x y z [ n’ x’ y’ z’ ] [ EXPONENT p [ p’] ] [ BOUNDS ]
ARRAY elements are associated with an OBJECT
n n‘ number of linearly spaced elements
x y z x’ y’ z‘ reference point shift
BOUNDS treats each instance as a separate entity
49/135
asapdesign.wordpress.com
$DO -1 1 2
$DO -1 1
$DO
SYSTEM NEWRESET
$DO -1 1 2{SURFACE
PLANE Z 0 ELLIPSE .5 .5OBJECT 'PLANE_?'
SHIFT X ?}
WINDOW Y ZPLOT FACETSRETURN
integer increment k defaults to either +1 or -1 depending upon the values of i and j $DO uses “?” as a place holder for the loop counter
Starting( i )
Condition( j )
Increment( k )
{ Commands }
Yes
No
$DO [ i [ j [ k ] ] ]
52/135
asapdesign.wordpress.com
SOURCE DIRECTION (using TANgent angle)
…
GRID ELLIPTIC Z 4.5 -2@1 -2@1 100 1SOURCE DIR TAN[30] 0 -1!! ROTATE Z 45
FLUX TOTAL 100
WINDOW Z -1 6 X 4 4
PROFILES OVERLAYRETURN
Easy way to setup the source direction
68/135
asapdesign.wordpress.com
EMITTING (DISK, RECTANGLE, ENTITY, OBJECT, CONE, BOX, RAYS, DADA, …)
SYSTEM NEWRESET
EMITTING RECTANGLE Z 0 .1 .1 900SOURCE DIR 0 0 1
PLOT RAYSRETURN
EMITTING RECT X x y z n [ a [ a’ ] [ RECT ]] [ ISO]
X coordinate axis
x location of plane on the coordinate axis
y z semimajor heights in the given directions
n total number of rays created
a a’ half-angles(in degrees) for the elliptical or RECTangular cone of emitted radiation centered on the axis
ISO specifies isotropic emission
69/135
asapdesign.wordpress.com
10 lm
10 lm, 2 sr
10 lm, 5 m^2
10 lm, 5 m^2, 2 sr
10 lm
10 lm / 5 m^2= 2 lm/m^2= 2 lux
10 lm / 5 m^2 / 2 sr = 1 lm/m^2 · sr= 1 Candela / m^2 = 1 nit
10 lm / 2 sr = 5 lm/sr = 5 Candela
Radiant / Luminous Power (or Flux) : Energy per unit time, emitted from a source, or incident upon a surfaceTypical Units : Watts (W)
Lumens(lm)
ASAP Commands : STATS
Irradiance / Illuminance : Power per unit area incident upon a surfaceTypical Units : Watts/meter^2(W/m^2)
Foot-candles(lm/foot^2)Lux (lumens/m^2)
ASAP Commands : SPOTS POSITION
Radiance / Luminance (a.k.a. "brightness") : Power per unit area per unit solid angleTypical Units : Watts/meter^2-sr
Foot-Lambert(1/π cd/foot^2)Nit (cd/m^2)
ASAP Commands : RADIANT MAP/AREA
Radiant / Luminous Intensity : Power per unit solid angleTypical Units : Watts/sr
Candela (cd=lumens/sr)
ASAP Commands : SPOTS DIRECTION
Radiometric / Photometric Definitions
79/135
asapdesign.wordpress.com
When you add following script at the end of the exercise script, you’ll see the spot picture
CONSIDER command also can be used with Object Number
SPOTS POSITION, SPOTS DIRECTION, RADIANT, RADIANT AREA command can be here
DISPLAY command initiate display commandsAll DISPLAY-related commands are executed according to its orderRETURN command deletes unsaved modified data
Irradiance / Illuminance
CONSIDER ONLY DETECTORWINDOW Y XPIXELS 101 1
SPOTS POSITION
DISPLAYAVERAGEPICTURE
RETURN
SPOTS POSITION [ u ] [ ATTRIBUTE i ] [ OBJECT ] [ NUMBER [ s ] ] [ EVERY n ] [ ‘title’ ]DIRECTION
POSITION Spot diagram of positional ray data
DIRECTION Spot diagram of directional ray data
ATTRIBUTE i Output format control
NUMBER Draw the rays number on the plot
s Optional scale factor for the chatacter size
84/135
asapdesign.wordpress.com
1. SCATTER RANDOM – Random rays simulating Lambertian scatterUsed for : a. scatter from good diffusers (e.g. flashed opal or spectralon),
b. modeling of integrating spheres (when combined with TOWARDS)
2. ROUGHNESS MODEL – Simulation of a rough surface by random variation ofthe reflected or refracted ray direction
Used for : a. modeling scatter within illumination systems,b. modeling scatter from most diffusers
3. SCATTER MODEL and TOWARDS – Scatter directed towards or away from areas or directions of interest. Used for stray light analysis
4. SCATTER BSDF or SCATTER RMS – Generation of a single scattered ray in the same direction as the reflected or refracted ray
Used for in-field scatter from optical components of an imaging system
5. MEDIA … SCATTER – Scatter rays within a volume
Five Approaches
105/135
asapdesign.wordpress.com
entity entity’ Descriptioni j Ray number is between i through j inclusiveOBJECT n Ray comes from previous object nOBJECT -n Ray was scattered from object nOBJECT +n Ray was split from object nSOURCE k Ray originated from source number kSOURCE -k Scattered ray from source number kMEDIA m Ray is in MEDIA mMEDIA -m Scattered ray is MEDIA mGENERATION n Ray was split and scattered n timesGENERATION -n Ray was scattered n timesGENERATION +n Ray was split n timesEVERY n Ray number modulo n equals one.PATH l Ray belongs to "l"th path from last PATH commandPATH 0 Ray belongs to a path not listed by last PATH commandw W Ray has wavelength greater than wW w Ray has wavelength less than wf F Ray has flux greater than fF f Ray has flux less than fd L Ray has optical path length greater than dL d Ray has optical path length less than dr R Ray has AXIS radial coordinates greater than rR r' Ray has AXIS radial coordinates less than r'x X Ray has X coordinates greater than xX x' Ray has X coordinates less than x'y Y Ray has Y coordinates greater than yY y' Ray has Y coordinates less than y'z Z Ray has Z coordinates greater than zZ z' Ray has Z coordinates less than z'a A Ray has X direction cosines greater than aA a' Ray has X direction cosines less than a'b B Ray has Y direction cosines greater than bB b' Ray has Y direction cosines less than b'c C Ray has Z direction cosines greater than cC c' Ray has Z direction cosines less than c'
Isolating Ray Subsets with SELECT
114/135
asapdesign.wordpress.com
SELECT command isolates a ray set for further analysis
SELECT option
Option Description
ALL selects all rays
ADD conditionally adds rays
REMOVE conditionally removes rays
ONLY selects only the specified rays
EXCEPT selects all rays except the specified rays
NONE unselects all rays
AND OR Boolean logical operators
entity entity’ see Remarks
SELECT [ALL]ADD [ entity entity’ [ AND entity entity’ …REMOVE [ entity entity’ [ AND entity entity’ …ONLY [ entity entity’ [ AND entity entity’ …EXCEPT [ entity entity’ [ AND entity entity’ …NONE [ entity entity’ [ AND entity entity’ …
125/135