raycad manual

187
RayCAD Opto/Mechanical Design for AutoCAD User's Manual Version 6

Upload: rjalsilva

Post on 24-Oct-2014

64 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: RayCAD Manual

RayCADOpto/Mechanical Design for AutoCAD

User's Manual

Version6

Page 2: RayCAD Manual

Information in this manual is subject to change without notice and does notrepresent a commitment on the part of the vendor. The software described in thismanual is furnished under a license agreement and may be used or copied only inaccordance with the terms of the agreement.

RayCAD is a registered trademark of RayCAD Co.©Copyright RayCAD Co., 1993-1999. All rights reserved.

AutoCAD is a registered trademark of Autodesk, Inc.ZEMAX is a registered trademark of Focus Software, Inc.

RayCAD77 Scribner Road, Tyngsboro, MA 01879raycad.com

Thorlabs, Inc. Document 2875-D01 Rev. A 11/15/991199Ver6

Page 3: RayCAD Manual

Table of Contents

Chapter 1.........................................................................................................1Introduction .................................................................................................1

Key to Document Conventions .................................................................3Understanding Terminology .....................................................................4Interpreting Prompts.................................................................................6Other Useful Commands ..........................................................................8

Chapter 2.........................................................................................................9Installation of RayCAD................................................................................9

First Time Installation ..........................................................................9Upgrade Installation .............................................................................9Inside AutoCAD Initialization ............................................................ 10First Time Initialization ...................................................................... 10Normal Initialization .......................................................................... 10Upgrade Initialization ......................................................................... 11Menu Conflict .................................................................................... 11Index File Locations ........................................................................... 12Uninstalling RayCAD......................................................................... 12Installation Troubleshooting ............................................................... 12

Chapter 3....................................................................................................... 13Getting Started........................................................................................... 13

Quick Start............................................................................................. 14Step 1 - Surface, Making surfaces ....................................................... 14Step 2 – Inputray ................................................................................ 15Step 3 - Raytrace ................................................................................ 16Step 4 - Optimize................................................................................ 17

Tutorial Using Sample Drawing ............................................................. 19Overview............................................................................................ 19Initialization ....................................................................................... 20Display Example ................................................................................ 21Drawray Example............................................................................... 21Inputray Example ............................................................................... 23Raytrace Example 1............................................................................ 26

Page 4: RayCAD Manual

Surface Example ................................................................................ 27Raytrace Example2............................................................................. 38Optimize Example.............................................................................. 39Remove Example ............................................................................... 44Raytrace Example 3............................................................................ 46

Chapter 4....................................................................................................... 49Commands................................................................................................. 49

RayCAD Command Summary................................................................ 49Body Command ..................................................................................... 51Display Command.................................................................................. 54

Display|Surflook................................................................................. 55Display|Dataprint................................................................................ 56Display|Viewports .............................................................................. 57Display|Restore scrn ........................................................................... 58Display|RenderReady ......................................................................... 58

Inputray Command................................................................................. 60Inputray|Drawray................................................................................ 62Inputray|Gather .................................................................................. 64Inputray|Listray .................................................................................. 66

Object to Optical Command ................................................................... 67Object to Optical|Assign OpticalProp.................................................. 68Object to Optical|3D Objects............................................................... 72

Optimize Command ............................................................................... 75Optimize|Focus group......................................................................... 79Optimize|COllimate group .................................................................. 82Optimize|Curvature optimizing ........................................................... 85Optimize|Adjust ................................................................................. 88Optimize|Rotate.................................................................................. 94Optimize|Mode................................................................................... 97Optimize|Mode................................................................................... 98

Raytrace Command ................................................................................ 99Raytrace|Trace.................................................................................. 100Raytrace|Grid ................................................................................... 102Raytrace|Random ............................................................................. 102Raytrace|Option................................................................................ 103Raytrace|Spot ................................................................................... 104

Page 5: RayCAD Manual

Raytrace|Spot|Point style................................................................... 107Remove Command............................................................................... 110

Remove|Remove renumber............................................................... 111Remove|Erase................................................................................... 111

Surface Command................................................................................ 112Coordinate System............................................................................ 113Good Advice .................................................................................... 115Surface|Makesurf.............................................................................. 116Index Data........................................................................................ 124Refractive surfaces requiring unique input ........................................ 131Diffractive Surfaces.......................................................................... 131Reflective Surfaces ........................................................................... 133Contour............................................................................................ 134Samples of Isolating the r and K values............................................. 138Component Thickness ...................................................................... 141Surface Name................................................................................... 141Defining Second Surface .................................................................. 142Rotation ........................................................................................... 143Surface|Catalog ................................................................................ 145Surface|Sfnumber ............................................................................. 146Surface|Listsurf ................................................................................ 149Surface|Editsurf ................................................................................ 150Surface|Clone ................................................................................... 151Surface|Redraw ................................................................................ 152Surface|Deactivate ............................................................................ 153Surface|Activate ............................................................................... 153Surface|Export.................................................................................. 153Surface|Import.................................................................................. 153

Chapter 5..................................................................................................... 161Helpful Hints ........................................................................................... 161

Appendix..................................................................................................... 169Glossary ...................................................................................................... 175Index ........................................................................................................... 179

Page 6: RayCAD Manual
Page 7: RayCAD Manual

Introduction

1

Chapter 1

Introduction

Welcome to optical ray tracing in an AutoCAD environment using RayCAD®

Version 6.0.

Not too long ago, optical ray tracing was highly complicated involving extensivemath and very lengthy calculations. It was also very prone to errors. In recentyears, computers have been used to do the calculations, but suffered greatlyfrom complex interfacing and complex optical terminology, which has limitedthe broad use of optical design packages.

Our goal in designing RayCAD was to provide a tool for modeling opticalcomponents and optical layouts in the same environment where your design ordrawing takes place. Effort has been made to make this a responsive tool bykeeping the size of the program and the computer demand to a minimum. Thisallows for quick loading and quick response while, at the same time, leavingAutoCAD fully operational.

The operator interface is written in AutoLISP and, in conjunction with menus,icons and pull-downs, provides a familiar interface. Once initialized, the loadingof programs is automatic and only the portion of the program needed is loaded.

The operation of RayCAD is consistent with the way you draw and design inAutoCAD. All of the familiar commands like MOVE, ROTATE, STRETCHand many others are used to point and drag surfaces and input rays into theconfiguration your design requires. For example, to move an array of input raysthat represent your light source, off the central axis use the STRETCH commandand drag a whole array of input rays to a new location (this is opposed to goingto a spread sheet and keying in a new starting point and angular directions foreach of the rays). AutoCAD's viewing and view ports, along with DVIEW andZOOM, are used to evaluate your ray traces. After placement of two or more

Page 8: RayCAD Manual

Chapter 1

2

surfaces and one or more input rays, you are ready to run a ray trace.

The computational portion of the program is written in C language and is usedfor such tasks as calculating surface to ray intersections, surface interactions(reflection, refraction and diffraction), aperture openings, indexes, random raygenerations, etc.

The heart of the program is in the ray to surface intersection and interactionroutines. 3D vector math is used throughout. A brief description could startwith thinking of a ray as a line with a starting point S and a direction of D(where x y z are unitized) and a scale factor t so that a ray is projected into 3Dspace by multiplying t with the x y z directions - final point P=S+Dt (capsindicate 3D vectors). This ray equation fully describes a line in 3D where theend point is determined by the size of t. Therefore, if this ray is to intersect witha surface, there must be a value of t describing the exact intersection point on thesurface.

By substituting the ray equation into an appropriate equation describing a 3Dobject and solving for t, the new intersection is found. At that point, a "normal"to the surface is generated. Then, depending on the type of surface encountered(reflection, refraction or diffraction), the appropriate optical formula is appliedusing necessary information like wavelength, index, diffraction order. This hasnow produced a new ray start point with a direction determined by the opticalproperties and surface shape. This process is then repeated for each surface andstarts over for each input ray you supplied.

We want to emphasize that RayCAD is not like any other optical ray tracingsoftware. The open architecture of AutoCAD allows an operator the freedom tomodel many optical designs that weren't even thought of by the developer ofRayCAD. In short, just as in AutoCAD, the tool that RayCAD provides allowsyour imagination to run free.

Page 9: RayCAD Manual

Introduction

3

KEY TO DOCUMENT CONVENTIONS

This book uses the following document conventions:

EXAMPLE DESCRIPTION

Type cd rayinst orCommand: SURFace

Bold text indicates information youmust supply

SHELL Uppercase letters represent AutoCADcommands and block names.

Note: If you have .... Indicates additional information aboutRayCAD and ray tracing.

(terpri)(prompt"Check .... This small typeface is used to showLISP and menu.

Page 10: RayCAD Manual

Chapter 1

4

UNDERSTANDING TERMINOLOGY

Commonly Used AutoCAD Commands -Useful in Operation of RayCAD

RayCAD's commands are added to AutoCAD, leaving all of AutoCAD'scommands still available. It adds the capability to AutoCAD to model opticalsurfaces and produce ray traces in a standard AutoCAD drawing.

Below is a brief description of commonly used AutoCAD commands used in theoperation of RayCAD. For details of the commands, see your AutoCADCommand Reference manual or, on command line, type ? for AutoCAD Help.

COMMAND DESCRIPTION AS APPLIED TO RAYCAD

'VIEW - Saves and restores named views.'ZOOM - Increases or decreases the apparent size of objects in

the current viewportARRAY - Converts a line (input ray) into an array of

lines in a fan or parallel patternDVIEW - Defines parallel projection or perspective views.LINE - Is used to draw input ray(s).MIRROR - Creates a reverse copy of input rays and surfaces.MOVE - Moves the input rays and surfaces.OFFSET - Converts a line (input ray) or surface into an array,

Separated by a specified distance.ROTATE - Rotation of surfaces and input rays.SCALE - Change the size of input rays. If used in conjunction

with STRETCH, you change the diversion of a fan ofrays by first scaling it, then stretching it to drag thelight source back in place.

Page 11: RayCAD Manual

Introduction

5

COMMAND DESCRIPTION AS APPLIED TO RAYCAD

STRETCH - Repositioning of light source and generation ofVignetting offsets.

U - Undo allows you to explore and experiment withoutfear of doing something wrong. Press U <ENTER)and everything is restored the way it was. The Undocommand can be used repeatedly. It can take youright back to the very first thing you did.

UCS - Manages user coordinate systems.VPORTS - Divides the graphics area into multiple tiled

viewports.

Page 12: RayCAD Manual

Chapter 1

6

INTERPRETING PROMPTSYou can access RayCAD’s commands in three basic ways - the toolbuttons, thetop pull-down, or from the command line. Our examples are illustrated using thetop pull-downs and many commands are continued on the command line. Asyou gain more knowledge, the keyboard shortcut commands may be useful.

Top Pull-down RayCAD: The top pull-down menu gives you access to all ofRayCAD's commands, some subcommands may be continued on the commandline. The syntax used in the manual for describing pull-down menus is afollows:

RAYCAD|SURFACE|MAKESURF|LENS

Command Line: The command line is the main location for entry except whena dialog box is in use. Many commands are terminated with a default valueshown in brackets. You can typically accept the default if in doubt and makechanges later.

RAYCAD PROMPTS DESCRIPTION

/?/ - Accesses RayCAD Help./Import/EXport/ - Pressing capitalized character accepts keyword

or select corresponding keyword from sidemenu.

/Inputrays/Surface: - Pressing ENTER to prompt terminated by acolon (:) causes an exit.

<default> - Words or values inside brackets are default.Pressing ENTER will accept it.

Base point - All surfaces are blocks with an insertion point inthe center of the surface. Type INS and point tothe surface if you desire the base point in thecenter of the surface.

NametagSURF-4TEST

- Surface nametag is always indicated by "SURF-", a number and an optional tag.

Page 13: RayCAD Manual

Introduction

7

RAYCAD PROMPTS DESCRIPTION

Object Selection - To the prompt "Select Objects", the followingcharacters are valid:

W - Selects all entries fully enclosed in the cursor windowC - Selects all entries crossed by the cursor windowR - Allows removal Of entries from your selectionA - Gets you back to adding to your selection

Object Selection is a standard AutoCAD operationand is more fully described in the AutoCAD UserGuide Manual under the heading of SelectingObjects.

U - Undo allows you to explore and experimentwithout fear of doing something wrong. Press U<ENTER) and everything is restored the way itwas. "Mark encountered" indicates an RayCADcommand is completely undone.. The Undocommand can be used repeatedly.

Page 14: RayCAD Manual

Chapter 1

8

OTHER USEFUL COMMANDS

COMMAND DESCRIPTION

@ (at) - Recalls last point in the drawing when entered asa response to a coordinate prompt.

' (apostrophe) - Indicates an AutoCAD's transparent command.Can be used while running an RayCADcommand.

Grip - Small squares that appear on objects you select.After selecting the grip, you edit the object bydragging it with the mouse rather than enteringcommands. Very useful for indicating a tracesurface intersection point.

INS - Center of a surface is the block insertion point.ORTHO (F8) - An AutoCAD setting that limits pointing device

input to horizontal or vertical (relative to thecurrent snap angle).

SNAP (F9) - A mode for locking the pointing device intoalignment with an imaginary rectangular grid.When Snap mode is on, the screen crosshairsand all input coordinates are snapped to thenearest point on the grid. The snap resolutiondefines the spacing of this grid.

Page 15: RayCAD Manual

Installation of RayCAD

9

Chapter 2Installation of RayCADIncluded here are instructions for installing RayCAD. The method dependsupon which AutoCAD Release is being used and whether this is a new orupgrade installation. Please refer to the appropriate section.

First Time Installation

Password islocated on CD case

To install, insert CD in drive and use WindowsAdd/Remove program.Select Start | Settings | Control Panel.Double click Add/Remove Programs.Click Install.. buttonchoose browse button to select CD drive.Double-click Win95 or WinNT (depending on whichoperator system you are using).Select setupray.exe.An Installation Wizard will guide you through the CDinstallation.

Upgrade Installation

Use Uninstall as explained in Uninstalling RayCAD(below). You may have to manually remove ray.mn* sincethese are created by AutoCAD and may not be part of theuninstalling process. Proceed with the installation asoutlined in First Time Installation above.

Page 16: RayCAD Manual

Chapter 2

10

Inside AutoCAD Initialization

Instructions are included for: First Time Initialization Normal Initialization Upgrade Initialization Menu Conflict Index File Locations

First Time Initialization

After CD installation is complete, start AutoCAD as usual.From the top menu, selectTools | Applications (Rel. 13) orTools | Load Application (Rel. 14 & 2000) orAssist | Load Application (Mechanical Desktop)and click the File... button.Locate \RayCAD6\RayCAD.lsp.Check Save List. (except in Rel. 2000)Click Load button.Click RayCAD label in top menu to run.

Normal Initialization

Whenever top menu does not display the RayCAD label,you must perform the normal Initialization.From the top menu, select Tools|ApplicationsSelect RayCAD.lsp.Click Load button.Click RayCAD label in top menu to run.

Page 17: RayCAD Manual

Installation of RayCAD

11

Upgrade Initialization

After CD installation is complete, start AutoCAD as usual.From the top menu, selectTools | Applications (Rel. 13) orTools | Load Application (Rel. 14) orAssist | Load Application (Mechanical Desktop)If an file named RayCAD.lsp is present in the Load dialogbox, select it and press Remove.Click the File... button.Locate the new \RayCAD6\RayCAD.lsp.Check Save List. (Important)Click Load button.Click RayCAD label in top menu to run.

Menu Conflict

If two menu labels named RayCAD are found on the topmenu bar, it is because all prior versions of RayCAD useda combined RayCAD and AutoCAD menu namedRAY.MNU and this configuration has been saved as thedefault startup menu. This version of RayCAD will attachjust the RayCAD portion of the menu to the standardAutoCAD menu therefore it is necessary to load a standardACADFULL.MNU (or any other favorite menu) beforeRayCAD initialization.

Page 18: RayCAD Manual

Chapter 2

12

Index File Locations

Any custom .INX files need to be copied to the\RayCAD6\Source directory.

Uninstalling RayCAD

To remove RayCAD, use Windows Add/Remove program.Select Start | Settings | Control PanelDouble click Add/Remove ProgramsSelect RayCAD and click Add/Remove button

Installation Troubleshooting

No Menu Showing:If you followed instructions in RayCAD UpgradeInstallation notes and erased or renamed the old ray.mnu,AutoCAD may load up without a menu. On the commandline, type menu and select your favorite menu (such asACADFULL.MNU) and proceed with the initialization.

Network and File Protection Related Problems:

The Tools|Load Application adds a line"C:\RayCAD6\RayCAD.lsp to a file named appload.dfs. Ifthis file is write-protected, as can be the case in manynetwork installations, it is necessary to make a local copy ofappload.dfs and place this file in a directory on your harddisk which is included in AutoCAD's search path andproceed with the initialization.

Page 19: RayCAD Manual

Getting Started

13

Chapter 3

Getting StartedThis section contains:

♦ Quick Start (a little help to get you going)

♦ Tutorial (use with a supplied drawing to try out some ofRayCAD's command)

Page 20: RayCAD Manual

Chapter 3

14

QUICK START

Step 1 - SURFace.................................... Page 14Step 2 - INPutray..................................... Page 15Step 3 - Raytrace...................................... Page 16

For detailedsamples, seeTutorial in thissection Step 4 - OPTimize..............… ................. Page 17

Start AutoCAD in the usual way. RayCAD will initializeautomatically if you completed the Initialization describedin Initialization. RayCAD’s menu will load. The top pull-down menus and toolbuttons provide access to RayCAD.

First we will prepare the screen. Select Display |Viewports. This will create three view ports. One view isset to a world (top) view, one is set to a front view, and oneis an isometric view which gives you a 3-D view of thedesign. Click onto the bottom view, making this yourworking view.

Set SNAP to a resolution matching your layout. The use ofSNAP (F9) and ORTHO (F8) help in precision placementand rotation.

Step 1 - Surface, Making surfaces

From the top pull-down, select RayCAD|Surface|Makesurf. A list of components is shown.

Placement ofsurfaces

Proceed by placing any surfaces you like, usually startingwith an Aperture and ending with a Screen. You need atleast 2 surfaces to do a ray trace. For this Quick Start, placean Aperture, a Lens and a Screen. (Note that a Screen doesnot affect ray direction - use it anywhere in your layout).

Page 21: RayCAD Manual

Getting Started

15

Surface can beplaced in anydirection

Apertures, Baffles and Screens are single surfaces that haveno thickness. For a Lens, which is a two surfacecomponent, you are prompted for thickness, spacing the twosurfaces apart. See command section Surface|Makesurf onpage 116 for details.

Sharing of Index RayCAD does not deal with components, only withsurfaces. All components are treated as one or moresurfaces. The two surfaces of a lens are not attached in anyway other than they share material, therefore, they musthave the same index name. This makes it possible to modelcomplex, multifaceted objects.

Step 2 – Inputray

Before any ray trace can be accomplished, informationregarding source location and radiation direction isnecessary. Thus, the next step is to draw and gather inputrays.

You can useAutoCAD's LINEcommand to drawinput rays. Makesure that lines startat your sourcepoint. Thedirection isimportant!

There are several ways of generating a large number ofinput rays. The Raytrace command requires at least oneline. It is used as a directional vector where the first pointof a line represents the source point and the end of the linegives it a direction. The Grid and Random commandsautomatically generate large numbers of rays. In the casewhere your light source is placed at infinity, you need aminimum of two parallel lines so that these commands candifferentiate between parallel or polar radiation (i.e., twoparallel rays places your source at infinity).

You can have as many input rays as you like (withinmemory restraint). The STRETCH command can be usedto drag a whole array of rays into position.

Page 22: RayCAD Manual

Chapter 3

16

Later, when ray tracing, automatic generation of largenumbers of input rays can be performed using Random Rayand Grid trace commands.

The next step is to use the RayCAD|INPutray|Gathercommand to assign wavelength(s), color emulation and,gathering of the input rays just drawn.

The Gather command writes a file namedSTARTRAY.DAT containing start and end point of eachinput ray.

Step 3 - Raytrace

A ray trace can be sequential or non-sequential. Settingscan be changed using RayCAD|Raytrace|Option and issaved in RAY.INI, therefore becoming default for futureediting sessions. The trace mode selected depends uponyour design. If your design allows for reentry of a surface,you must use non-sequential mode.

When completed, a set of rays are drawn as polylines, onefor each input ray times the number of wavelengthsassociated with it.

Hint: Selecting a polyline by just pointing starts the GRIPcommand. This draws a small square at each intersectionpoint allowing a visual inspection of ray to surfaceintersections.

Page 23: RayCAD Manual

Getting Started

17

Step 4 - Optimize

There are two types of optimization:

Type 1: Curvature optimizingRayCAD will automatically adjust curvature variables likeradius, conic and aspheric constants in an attempt to bringtwo rays to a point.

Type 2: Positioning optimizationRayCAD will automatically move a group of surfaces usinga Lead surface for its direction in an attempt to bring tworays to a point or a parallel.

Note: When Optimize moves a group to a new position thebody, if any, with a block insertion point coinciding with theinsertion point of the surface being moved, will tag along.

Note: Since a change in curvature can cause the body notto fit, use the ERASE command either before or afteroptimization to erase the old body, then use the BODYcommand to make a new body that fits. See Body commandon page 51 for more information.

If things don't workout the way youwanted, use Undoto restore yourdesign back theway it was.

Let's start optimizing. Select RayCAD|Optimize. At thispoint you have a choice between curvature optimizing orpositioning optimization. A dialog box allows you toidentify surfaces as a Leader, Target and Group.

In both types of optimizing, only two input rays are used.Curvature optimizing attempts to bring these two rays to apoint on a Target surface. Positioning optimize gives youan option between bringing the two rays to a point or to aparallel at a Target.

As optimization takes place, three sets of numbers are

Page 24: RayCAD Manual

Chapter 3

18

displayed: Spread, Last Spread and Scaler. These numbersindicate distance between intersection points on the Targetand the scale used for the adjustment.

You can press a key any time to exit the optimizationroutine.

Note: Not all optimizations will have success. If Spreadand Last Spread keep repeating pattern, press a key to stopthe optimization. After the trace is drawn, investigate whatcaused this condition. Look for rays missing a surface.Also, in some cases, it is not possible to accomplish a focusor collimation. In such a case, a curvature change may berequired. Other times it may be required to move morethan one surface.

This completes Quick Start. The following Tutorialpresents you with samples of some of RayCAD'scommands.

Page 25: RayCAD Manual

Getting Started

19

TUTORIAL USING SAMPLE DRAWING

Overview........................................… … … … … Page 19Initialization ...........................… … … … … … … Page 20DISPlay (set up view ports) .......… … … … … … Page 21Drawray (automatically generate input ray… … Page 21INPutray (choose colors) ..… … … … … … .… … Page 23Raytrace 1 (do ray trace) .......................… … … Page 26SURFace (add a lens) .....................… … … … ... Page 27Raytrace 2 (do ray trace) ..........… … … … … … . Page 38OPTimize (focus).........… … … … … … … … … .. Page 39Erasing a Surface … … … … … … … … … … … ... Page 44Raytrace 3 (do ray trace) ..........… … … … … … . Page 46

Overview

We use a supplied sample drawing namedRAYCAD1.DWG. This is a simple optical layoutconsisting of an aperture, a lens, a mirror and a screen.When optimizing, the screen will be used as the Target forthe focus. We have made the screen large enough so thatrays won't run off the surface when focusing. Eachcommand used is described in detail in the Commandssection of this manual beginning on page.

RAYCAD1.DWG was saved containing the menu requiredto run RayCAD.

Certain steps appear only in the beginning of the samplesection. If, for some reason, you get out of sync with themanual as you work on the sample drawing and find thereare discrepancies between screens and the manual, just typeU for Undo (repeatedly if necessary) until you are back.

Page 26: RayCAD Manual

Chapter 3

20

You can access RayCAD’s commands in three basic ways -the toolbuttons, the top pull-down, or from the commandline. Our examples are illustrated using the top pull-downsand many commands are continued on the command line.As you gain more knowledge, the keyboard shortcutcommands may be useful.

Note: All of the sample drawings can be copied directlyfrom RayCAD6\Samples.

Initialization

The following section assumes you ran INSTALL.

Start AutoCAD and open the drawing fileRayCAD6\samples\RayCAD1.dwg (see Figure 1). Thissample drawing will be used to demonstrate how RayCADworks.

Figure 1

Page 27: RayCAD Manual

Getting Started

21

AutoCAD Rel. 13 users, select Tools |Applications |RAYCAD6\RayCAD.lsp and select Load. AutoCAD. Rel.14 & 2000 is loaded automatically. See "Appendix C -Troubleshooting" if an error occurs.

Display Example

Select RayCAD|Display|Viewports, creating three viewports. One view is set to a world (top) view, one is set to afront view, and one is an isometric view which gives you a3-D view of the design. Click onto the bottom view tomake it the active view.

Drawray Example

The first example will show the Drawray command. Wewill have RayCAD automatically generate a Fan (polar) of4 input rays using Width for the direction of the array.

Note: If starting a new drawing, you normally would insertsurfaces first, then draw some input rays. We start you upworking on an existing drawing where some surfaces arealready placed.

From the pull-down menu, select:

RayCAD|INPutray|Drawray|Fan Width (y axis)

Place the start point of ray… :

Page 28: RayCAD Manual

Chapter 3

22

Use SNAP (F9) andORTHO (F8) forprecision placement

Place pointer at the source point and click to set theposition (see Figure 2).

Number of rays:<5>: 4

Figure 2

Page 29: RayCAD Manual

Getting Started

23

Type 4 and press Enter. RayCAD automatically draws afan of 4 rays (see Figure 3).

Inputray Example

The next example shows the INPutray command.

Select RayCAD|INPutray|Gather. Here you choose thecolor of the trace, wavelength(s) and input rays.

Trace Color set to Wavelabel/?/Listray/Drawray/Gather/eXit>: Gather

Figure 3

Page 30: RayCAD Manual

Chapter 3

24

Choosing Gather calls up the Wave Label Selection dialogbox (Figure 4) where you select wavelength(s) and coloremulation.

"Current" window shows wavelength 587.6 which we willuse.

Note: Detailed explanation of the dialog box is covered inthe Command section on page

In this case, we will emulate the color assigned to thewavelength for our ray trace. In "Trace Color Emulation",

Figure 4

Page 31: RayCAD Manual

Getting Started

25

click onto Wave labels. Press OK to accept.

The sample drawing now shows surfaces with 4 input raysdrawn. Use CROSSING to choose all 4 rays. See Figure 5

Point to lower right of input rays and drag across to theupper left.

Select Input Ray(s) for waves just selected:Select objects: CROSSING

Figure 5

Page 32: RayCAD Manual

Chapter 3

26

Note: See Understanding Terminology on page 4 forselection arguments.

This completes INPutray for the ray trace and returns you tothe AutoCAD command line.

Raytrace Example 1

Select Raytrace|Trace.

Four input rays and associated wavelengths have beenselected and you are ready for tracing.

First Corner: Other corner: 4 foundSelect objects: Press Enter

Trace color set to Wavelabel/?/Listray/Drawray/Gather/<eXit>: X

"SURF-1" is processed"SURF-2" is processed"SURF-3" is processed"SURF-4" is processed"SURF-5" is processedDrawing in progress.

Page 33: RayCAD Manual

Getting Started

27

Four rays are traced through four of the surfaces andprojected onto the fifth for the 587.6 wavelength (Figure 6).For more details on the Raytrace command, see page 99.

This is the end of the Raytrace|Trace command.

Surface Example

This example will show the SURFace command. Workingwith the same optical layout, you will place a lens into theoptical path. When this sample drawing was created,surfaces were inserted from a UCS World View. Forconsistency, make sure UCS is set to World by typing UCSW then point to the window where the UCS symbol shows aW. You can, of course, insert surfaces in any UCS or viewyou like. However, consistency makes it a whole lot easier.

Figure 6

Page 34: RayCAD Manual

Chapter 3

28

Select RayCAD|SURFace|Makesurf|Lens

Think in terms ofsurfaces asopposed tocomponents.

Note: When surface is mentioned, think in terms of a zerothickness film at which point light will interact and changedirection. (i.e., a lens always consists of two surfaces and amirror always has one surface).

Note: Much flexibility in your layout is gained by dealingwith components in terms of surfaces. Large numbers ofrefractive surfaces can be combined into a complexcomponent as long as they share material.

Note: Turn on SNAP (F9) to precisely align new lens.

Point to the location where the center of the surface is to beplaced. See Figure 7

Place center of surface location:

Page 35: RayCAD Manual

Getting Started

29

Component selection and placement is completed and theGlass Selection dialog box appears (Figure 8)

Figure 7

Page 36: RayCAD Manual

Chapter 3

30

Select User File.INX in the Source of Index data: and selectBK-7 in Glass Names. Click OK.

The Select Index file dialog box (Figure 9) appears. FindRayCAD6\source\silica.inx and press OK.

Figure 8

Page 37: RayCAD Manual

Getting Started

31

The Glass Selection dialog box appears with your selections(Figure 10). Press OK.

Figure 9

Page 38: RayCAD Manual

Chapter 3

32

Note: Leave the medium as 1.0003 (default)

The Contour Maker dialog box appears (Figure 11).

Figure 10

Page 39: RayCAD Manual

Getting Started

33

From More Shapes: pick Flat and press OK.

Figure 11

Page 40: RayCAD Manual

Chapter 3

34

In the Contour Maker Dialog Box, change dia. to 4.0 andpress OK. (Figure 12).

You enter component thickness from the command line.

Either use your pointer or type in the value of 0.5

Note: In the case of a two surface component, thickness is

Component thickness..Center to center (not the edge) <0.5>: 0.5

Figure 12

Page 41: RayCAD Manual

Getting Started

35

used to automatically space the second surface. To laterchange the thickness of a lens, don't edit the thickness of itbut use AutoCAD's MOVE command. For a single surfacecomponent like a mirror, thickness is used by the Bodycommand to show the backside.

The computer recommends the next available surfacenumber, but since we are inserting a surface into thesequence in the fourth position, we will choose 4, tellingthe program to insert this component as SURF-4.

First free Surface number is 6.Surface Number ...Enter any number <6>: 4

Second surface's definition... (Y/N) <Y>: Yes

Page 42: RayCAD Manual

Chapter 3

36

The Contour Maker dialog box again appears. Make thissurface a Sphere and press OK. (Figure 13).

Change the Curve: to Concave. Make R (radius) 14.0 andchange the Diameter to 4.0. Press OK.

A body is automatically drawn connecting the twosurfaces.

Note: Remember, bodies are only for appearance sake.They have no optical properties. If you are doing a lot ofsurface adjustments, you may find it easier to erase thebodies and, when near completion, regenerate the body byusing the Body command.

Surface insertion is completed (Figure 14).

Figure 13

Page 43: RayCAD Manual

Getting Started

37

Let's clean up old traces. From command line, typeERASE and C for CROSSING to remove old traces (seeFigure 15). Be careful not to pick the surface, or yourinput rays.

Figure 14

Figure 15

Page 44: RayCAD Manual

Chapter 3

38

Raytrace Example2

The next step will be to do another ray trace, this time tracingrays through the new fourth and fifth surface. The input raysfrom the last ray trace are unchanged and will be used forthis new ray trace.

Select RayCAD|Raytrace|Trace

Note: We answer No here because we just erased them allby using AutoCAD ERASE command.

"SURF-1" is processed"SURF-2" is processed"SURF-3" is processed"SURF-4" is processed"SURF-5" is processedErase last raytrace (Y/N) <Y>: NDrawing in progress.

Page 45: RayCAD Manual

Getting Started

39

New ray trace has been accomplished using the two newsurfaces (Figure 16).

Optimize Example

For this example we will be using OPTimize to focus theoutput rays onto the last surface by moving the mirror(surface #6).

Before optimizing, erase all existing rays using theAutoCAD ERASE command and Crossing to clean off allold traces. Answering Yes to "Erase last raytrace (Y/N)"only erases the last raytrace. Prior traces may lie underneath.

There are two types of optimization:

Type 1: Curvature optimizingRayCAD will automatically adjust curvature variables like

Figure 16

Page 46: RayCAD Manual

Chapter 3

40

radius, conic and aspheric constants in an attempt to bringtwo rays to a point.

Note: Since a change in curvature can cause the body not tofit, use the ERASE command either before or afteroptimization to erase the old body, then use the BODYcommand to make a new body that fits. See Body commandon page 51 for more information.

Type 2: Positioning optimizationRayCAD will automatically move a group of surfaces usinga Lead surface for its direction in an attempt to bring tworays to a point or a parallel.

For this example we will choose "focus of a group". Thiswill position a surface or a group of surfaces, in an attempt tobring two rays to a point.

Select RayCAD|Optimize|Focus a group.

The Optimize Parameters dialog box appears (Figure 17.

Figure 17

Page 47: RayCAD Manual

Getting Started

41

In the "Active Surfs" window, click on Mirror SURF-6. Inthe "Aim Setting" window, click on Set Leader. Click ontoScreen SURF-7 and make that the Target. We will not setthe Group as no other surfaces are to be adjusted in thisexample. Note: The same dialog box is used in both types ofoptimization. The window "Optim on" is only active whenoptimizing a curvature. Press OK.

In both types of optimizing, only two input rays are used.Curvature optimizing attempts to bring these two rays to apoint on a Target surface. Positioning optimize gives youan option between bringing the two rays to a point or to aparallel at a Target.

Since more than two rays were gathered from our prior raytrace, the message below appears (Figure 18). Press OK.

"SURF-1" is processed“SURF-2" is processed“SURF-3" is processed“SURF-4" is processed"SURF-5" is processed

Erase last raytrace (Y/N): No

Figure 18

Page 48: RayCAD Manual

Chapter 3

42

RayCAD jumps to the Inputray command. This allowsyou to select wavelength and two input rays directedtoward the part of surface of interest.

In the Wave Label Selection dialog box, keep wavelength587.6 and Trace Color Emulation at Wave labels andpress OK.

Pick two outer rays (Figure 19).

Press eXit to leave INPutray.

As optimization takes place, three sets of numbers aredisplayed: Spread, Last Spread and Scaler. These numbersindicate distance between intersection points on the Targetand the scale used for the adjustment. You can press a keyany time to exit the optimization routine.

Note: Not all optimizations will have success. If Spreadand Last Spread keep repeating a pattern, press a key to

Trace color set to Wavelabel./?/Listray//Drawray/Gather/<eXit>: Gather

Figure 19

Page 49: RayCAD Manual

Getting Started

43

stop the optimization. After the trace is drawn, investigatewhat caused this condition. Look for ray missing a surface.Also, in some cases, it is not possible to accomplish a focusor collimation. In such a case, a curvature change may berequired. Other times it may be required to move morethan one surface.

For details, see OPTimize on page 75.

Note: Numbers may vary depending on the insertion pointof the lens added in the last SURFace example.

Notice that rays are now collected at the final surface andthe mirror surface has moved backward following thedirection of it's normal to accomplish this (Figure 20).

Note: When Optimize moves a group to a new position, the

"New location for surface is" (11.2455 2.980 390.0)

Figure 20

Page 50: RayCAD Manual

Chapter 3

44

body, if any, with a block insertion point coinciding with theinsertion point of the surface being moved, will tag along.

This completes optimizing.

Remove Example

We will now remove the lens (SURF-4 and SURF-5) wehave just placed.

Note: You could use the RayCAD|Remove|Erasecommand. The difference is that Remove renumber willrename existing surfaces to close gaps in the numbersequence. Erase will merely erase the surface block but itis still present in the database and will leave a gap in thenumber sequence. This is not a problem for eithersequential or non-sequential ray tracing and later, whenmaking a new surface, you can simply give it the number ofthe gap and it will fill it.

Select AutoRay/Remove/Remove Number

The Surface Selection dialog box opens (Figure 21). Hereyou click onto Lens Surf-4 and Lens Surf-5 and click OK.

Page 51: RayCAD Manual

Getting Started

45

Both surfaces have been removed. Now use AutoCADERASE to remove the 3D grid. When done, the drawingshould resemble Figure 22. Don't worry if the ray trace iserased, too.

Figure 21

Page 52: RayCAD Manual

Chapter 3

46

Raytrace Example 3

Let's trace rays through this optical layout. SelectRayCAD|Raytrace|Trace.

Rays are traced through this latest optical layout (Figure23).

"SURF-1" is processed"SURF-2" is processed"SURF-3" is processed"SURF-4" is processed"SURF-5" is processedErase last raytrace (Y/N) YDrawing in progress.

Figure 22

Page 53: RayCAD Manual

Getting Started

47

1. This concludes the tutorial. You are now ready to do anew optical layout

2. Create surfaces using the SURFace command.

3. Using INPutray, draw input rays, choose colorassociation and assign wavelengths.

4. Do a Raytrace.

5. OPTimize component location to accomplish yourdesign goal.

Note: See Command section page 49 for details. Also see"Helpful Hints" on page 161 for some useful information.

Figure 23

Page 54: RayCAD Manual

48

Page 55: RayCAD Manual

Commands

49

Chapter 4CommandsRayCAD's commands are added to AutoCAD, leaving all of AutoCAD'scommands available at all times - including Snaps, Grips and Transparentcommands.

RayCAD Command SummaryCOMMAND DESCRIPTION PG

Body adds body to optical surfaces to create 3dlook.… 51Display (DISP) controls what you see and how you see it … … ... 54

Surflook see different perspectives … … … … … … … … … 55Dataprint sets the print mode … … … … … … … … … … … ... 56Viewports creates 3 view ports … … … … … … … … … … … . 57Restore scrn restores the screen … … … … … … … … … … … ... 58Render-Ready render optical surfaces and ray traces … … … … .. 58

Help quick look-up table of commands … … … … … ... 59Inputray (INP) collects input rays for ray tracing … … .… … … ... 60

Drawray automatically create input rays … … … .… … … ... 62Gather collect wavelengths and input rays … … … … … .. 64Listray display file startray.dat … … … … … … .… … … ... 66

Object to Optical AutoCAD objects to optical … … … … … … … … 67Optimize (OPT) optimizes the optical layout … … … … … … … … . 75

Focus Group automatic focusing … … … … … … … … … … … .. 79Collimate Group automatic collimation … … … … … … … … … … .. 82Curvature change curvature radius … … … … … … … … … ... 85Adust study ray intersections … … … … … … … … … … . 88Rotate rotate surface … … … … … … … … … … … … … ... 94Mode choose trace sequence … … … … … … … … … … .. 97

Page 56: RayCAD Manual

Chapter 4

50

Raytrace (RT) Calculates and draws the ray trace … … … … … ... 99Trace tracing of rays … … … … … … … … … … … … … .. 100Spot diagram see image formation … … … … … … … … … … … . 104Random visualize the light path … … … … … … … … … … . 102Option change trace mode … … … … … … … … … … … ... 103Grid produce rows and columns of input rays … … … . 102

Surface (SF) creates and places optical surfaces … … … … … ... 112Makesurf user created surfaces … … … … … … … … … … … 116Catalog surfaces from optical catalog … … … … … … … ... 145SFnumber affects surface numbering … … … … … … … … … 146Listsurf info on surfaces … … … … … … … … … … … … … 149Editsurf change surface characteristics … … … … … … … .. 150Clone duplicate a surface … … … … … … … … … … … ... 151Redraw update a surface block … … … … … … … … … … 152Deactivate exclude selected surface(s) from ray trace … … . 153Activate reverses Deactivate command … … … … … … … 153Export export data to a text file … … … … … … … … … .. 153Import import data from other sources … … … … … … ... 153

Page 57: RayCAD Manual

Commands - Body Command

51

BODY COMMANDThe Body command makes optical surfaces look like 3Dcomponents. Body uses a 3D mesh to give surfacesthickness and body.

.

Single surface -convex vs. concave

Note: The Body command is automatically called whenapplying the Surface|Makesurf, Catalog, and Importcommands

Note: When importing surfaces, the program makesassumptions regarding body construction. It is intendedfor a lens. In the case of more complex componentmodeling with multiple facets, you may need to erase thebodies and create new ones using the Body commandmanually.

For a single surface component, Body looks up thesurface thickness and draws the appropriate shapebacking to the surface. When constructing a singlesurface, the side of the surface where the body is createddepends whether the surface was initially inserted as aconvex or concave surface, and is indicated by a negativethickness.

Page 58: RayCAD Manual

Chapter 4

52

For example, for a mirror generated as a convex (i.e.,default positive radius), the thickness will be saved as apositive value causing the body to be developed on theside away from the center of the curvature as shown in..

Applying a Body to a two surface component is easy. Thetwo surfaces are joined regardless of how they are spunaround in AutoCAD.

Using Body ona double surfacecomponent

If your first selection is a double surface component (i.e.,lens), you are prompted to select the second surface. Amesh is then drawn which joins the two surfaces together.Remember - the wire mesh is not an optical surface. If itneeds to be, erase the body and replace it using an opticalsurface named Tube.

All surface bodies are made into blocks named BODY-nrand are placed on a layer named SFBODY. If the wiremesh obscures your study of ray traces, just type LAYEROFF SFBODY on the command line.

You may erase a surface's body at any time as the body hasno attachment to the surface other than the insertion pointis the same as the surface that generated the body.

If spacing has changed between two surfaces, erase the oldbody and use Body to create a new one. To change bodythickness of a single surface component, use theRayCAD|SURFace|Editsurf|Thickness command andedit the thickness. Then, go back and redo the body.

Page 59: RayCAD Manual

Commands - Body Command

53

Thickness is onlyused for the initialspacing of surfaceson a multi surfacecomponent. Tolater change thespacing betweensurfaces, use theAutoCAD MOVEcommand. Thethickness value isinconsequential atthis point.

The Body command uses the thickness for single surfacesto draw the wire mesh. Editing of thickness only affects thethickness of the body - not the spacing between surfaces.

The following example shows a two surface componentwhere the body has been erased. The Body command isused to add a 3-D mesh .

Selecting RayCAD|Body causes the Surface Selectiondialog box to appear. Click on Surf-1 then click Surf-2.

Page 60: RayCAD Manual

Chapter 4

54

DISPLAY COMMANDDISP is a shorthand command for Display and can becalled directly from the command line.

Display will give you the ability to look at and manipulatedifferent views of your drawing, allow you to set up viewports, set a print mode, and inspect a surface from allpossible directions.

The following is a list of commands found underRayCAD|Display:

Surflook (see different perspectives) … … Page 55Dataprint (sets the print mode) ....… ....... Page 56Viewports (creates 3 view ports) ......… ... Page 57Restore scrn (restores screen) ............... Page 58RenderReady … ............… … ........... Page 58

Page 61: RayCAD Manual

Commands - Display Command

55

RayCAD|Display|Surflook

Surflook allows you to inspect a surface from differentperspectives.

Using the Surface Selection dialog box, choose a surfaceyou want to look at. A close-up view of the selected surfaceis displayed and the view point is straight down the surfacenormal.

The X, Y and Z rotate the view 15° around the chosen axis.Use Chgd to change the direction of the view rotation to 15°in the other direction.

In and Out zooms the current view by 2X.

Top, Front, Left and Right set the view direction. Thesecommands give you a consistent way to look at your layout.Top is the same as Worldview.

Note: All of AutoCAD's viewing facilities are available -

View control../Previous/Undo/Hide/Top/Front/Left/Right/DYnamic/In/Out/Chgd/X/Y/Z/Done/ <X>:

Page 62: RayCAD Manual

Chapter 4

56

Paperspace, Modelspace, Tiled Viewports.

Hide is used to give a more realistic look to your design byhiding lines behind a solid object.

Undo takes you back to first view after entering Surflook.

Previous restores view just before entering Surflook.

DYnamic sets the view point to the center of the selectedsurface and selects ray traces or spots surrounding thatsurface.

For details of these commands, see DVIEW in yourAutoCAD manual. Exit takes you back to the commandprompt, leaving the current view intact.

Note: To get back to original view, use Restore scrn.

RayCAD|Display|Dataprint

Dataprint will set a print mode. As calculation is done foreach ray and each surface, intersections and ray directionsare displayed on screen All errors or warnings aredisplayed, even if None is selected.

RayCAD|Display|Dataprint|Screen

The Screen option sends intersection and ray direction to

Enter camera point <10.2813, 8.000, 0.0000>:CAmera/TArget/Distance/POints/PAn/Zoom/TWist/Clip/Hide/Off/Undo/ <eXit>:

Page 63: RayCAD Manual

Commands - Display Command

57

the screen.

RayCAD|Display|Dataprint|None

None will suppress all printouts.

Setting Dataprint mode remains in effect until the end of theediting session or until it is changed.

RayCAD|Display|Viewports

The Viewports command creates three view ports inTILEMODE. One view is set to a world view, one is set toa front view and one is an isometrics view which gives youa 3-D view of your design.

Note: To get back to a single view, use Restore scrn.

Page 64: RayCAD Manual

Chapter 4

58

RayCAD|Display|Restore scrn

Restore scrn removes all view ports, resets clippedscreens to Off, and places your view point at a WorldView and sets UCS to a World View.

RayCAD|Display|RenderReady

The Render-Ready option allows optical surfaces and raytraces to be rendered for a picture perfect presentation.Place optical components directly into a mechanical layoutand explore the effect of design changes in both themechanical and optical systems simultaneously. UseRender-Ready with a rendering package to simulatetransparency, diffusion, reflection and refraction of surfaceproperties, and define shadows. Your design is rendered,complete with rays traced, to create a photorealistic picture.

Page 65: RayCAD Manual

Commands - Display Command

59

Convert opticaldesign to Rendermode

From the Render-Ready dialog box you can choose toconvert your drawing to Render mode. This will convertoptical surfaces, input and output rays into solids. Afterrendering, convert back to Design mode. This will reducedrawing overhead due to wire meshes and provide lesscluttered viewing. All RayCAD commands are valid inboth modes.

Optical surfaces tobe converted:

You can choose to convert all of the optical surfaces bychecking "Convert all optical surfaces". The number ofsurfaces found is shown. Clear the check mark to skipsurface conversion or use Pick Surface button to selectspecific surfaces.

Convert input raysand/or traces

Use check marks to select input rays and traces forconversion.

Diameter of rayscan be changed forbest look

You can change the diameter of the rays to produce thebest looking representation.

Surfaces are placed on separate layers depending on thetype of surface. For example, a glass component is placedon ray_glass layer. Also, rays are separated intoray_inputrays and ray_traces layers. This allows forassigned materials to be attached to specific layers.

Page 66: RayCAD Manual

Chapter 4

60

INPUTRAY COMMANDINP is a shorthand command for INPutray and can becalled directly from the command line.

The main function of INPutray is to gather input raysrepresenting the direction of light from the light source andwrite these to a file named STARTRAY.DAT. It ispossible to associate the trace color with a color assigned toa wavelength or emulate the color of input rays.

Other subcommands let you create input rays and displayinformation about your input rays.

The INPutray command section covers:

Drawray (automatically create input rays) … . Page 62Gather (collect wavelengths & input rays) … . Page 64Listray (display file STARTRAY.DAT) … ... Page 66

Use SNAP F9and ORTHO F8 forprecision placement

An input ray is a regular line, using the LINE command.Therefore, a number of AutoCAD's commands can be usedto make input rays and modify input rays. You may startwith the Drawray command discussed later in this sectionand then use any of the following AutoCAD commands formodifications.

LINE - Place one end at your light source and theother end directed to your first surface.Also see the INPutray Drawray commandon page 62.

ARRAY - Makes a fan (polar) and parallel array froma single input ray.

Page 67: RayCAD Manual

Commands - Inputray Command

61

MIRROR - Creates a reverse copy of input rays.

OFFSET - Forms new input rays by drawing themparallel to the original input rays.

Also see Drawray Other commands that can be used to modify your inputrays are:

MOVE - Moves the input rays.

ROTATE - Rotates input rays about the base point.

STRETCH - Can be used to drag your light sourcearound. Select all input rays at the sourceend then point to the center of the source.Now drag the source to the new locationand all input rays will follow. Input raydrawn in World (top) view can easily bestretched in the Z by using the FrontView. See Display command on page onpage 54.

SCALE - Change the size of input rays. If used inconjunction with the STRETCHcommand, you change the diversion of afan of rays by first scaling it, thenstretching it to drag the light source backin place.

Note: Make sure to run the Gather command anytimeinput rays have been changed.

There are several ways of generating a large number ofinput rays. The Raytrace command requires at least oneline. It is used as a directional vector where the first pointof a line represents the source point and the end of the line

Page 68: RayCAD Manual

Chapter 4

62

gives it a direction. The Grid and Random commandsautomatically generate large numbers of rays. In the casewhere your light source is placed at infinity, you need aminimum of two parallel lines so that these commands candifferentiate between parallel or polar radiation (i.e., twoparallel rays places your source at infinity). SeeRaytrace|Random Rays on page on page 102 andRaytrace|Grid on page on page 102 for more information.

RayCAD|Inputray|Drawray

The Drawray command does an automatic generation ofinput rays, either as a Fan of rays (polar array) or as Parallelrays.

SURF-1 must bepresent in thedrawing

The array generated will always be projected toward thefirst surface (SURF-1). Therefore, a surface named SURF-1 must be present in the drawing. If you do not have anysurfaces placed in the layout, use the SURFace|Makesurfcommand to generate at least one surface before usingDrawray.

Remember -Direction of inputrays is important!

Note: The direction of input rays is important. When usingAutoCAD's LINE command to draw input rays, make surethat lines start at your source point. The direction isimportant. The length is not important.

RAYCAD|INPUTRAY|DRAWRAY|FAN WIDTH (Y AXIS)RAYCAD|INPUTRAY|DRAWRAY|FAN HEIGHT (Z AXIS)RAYCAD|INPUTRAY|DRAWRAY|PARELLEL WIDTH (Y AXIS)RAYCAD|INPUTRAY|DRAWRAY|PARELLEL HEIGHT (Y AXIS)

Place the start point of ray..:Number of rays: <5>:

Page 69: RayCAD Manual

Commands - Inputray Command

63

Parallel will automatically draw any number of parallelinput rays.

Make a Fan of rays Fan will automatically draw any number of input rays in aFan (polar) configuration.

Note: If first surface was inserted into a World View, andyour current UCS is set to UCS World, the Width of thecomponent would lie in the XY plane and the Height wouldbe in the Z direction (extending out of the screen). If youselect Height for your array or parallel rays, under theseviewing conditions they will show up as a single linebecause you now need to look at this from a front view. Inthis UCS World view, you would want to see your rays inthe XY plane thus select Width.

Either Height or Width are, of course, valid. Which oneyou choose will depend on just what you are looking to see.

To organize your optical layout, you may want to set upyour display using the RayCAD Display command. SeeDisplay on page on page 54 for more information.

Surface entered in World View.Picture shows a Fan of 10 input raysusing Width for direction of thearray.

Surface entered in World View.Picture shows a Fan of 10 inputrays using Height for direction ofthe array. The array is laid out in aZ direction. That's why the array isshown as a single line in this view.

Page 70: RayCAD Manual

Chapter 4

64

RayCAD|Inputray|Gather

The Gather command allows you to collect wavelengths andinput rays through the Wave Label Selection dialog box andshould be done prior to running a Raytrace command for thefirst time.

Input ray fileis shared

Note: The Gather command writes a file namedSTARTRAY.DAT. This file is shared by all your drawings;therefore, you must use the Gather command anytime adifferent drawing is loaded (unless, of course, the input raysare identical in the different drawings).

Page 71: RayCAD Manual

Commands - Inputray Command

65

From this dialog box you select color association andwavelength.

Choose wavelengthand how tocorrelate color

Choose a wavelength(s) by highlighting it and use the "->Add:" and "<-Del:" buttons or enter a new wavelength inthe "Enter New wave in nm:" box. The wavelengths listedin the "Current" window will each be traced at that specificwavelength.

Choosing the "Trace color emulation" will cause each set ofray traces to take on the color according to your assignment.

Spectrum -with the colors of the spectrumCurrent screen -with current AutoCAD color (default)Wave labels -with a wavelength labelInput rays -with input raysIncremental -cycle through AutoCAD's color

numbering

"Spectrum" uses wavelength to color correlation.

(if wave>(if wave >(if wave >(if wave >(if wave >(if wave<=

700 color 1)600 color 2)500 color 3)400 color 4)300 color 5)300color 6)

"Wave label" uses the wavelength color(s) you choose forthe trace color. Assign color to each wavelength listed inthe "Current" box by double clicking onto the square box tothe right. Your trace will clearly show the wavelength usedfor particular rays.

"Input rays" allows you to correlate each ray traced with thecolor(s) that the input ray was drawn with. You may

Page 72: RayCAD Manual

Chapter 4

66

choose to set the color of your input rays prior to gathering.For example, from command line, type CHPROP - select aninput ray and the new color.

"Incremental" uses AutoCAD's color numbering so each rayin a trace can be tracked through your optical design.

RayCAD|Inputray|Listray

Listray will give you a screen text display of the fileSTARTRAY.DAT showing you the start point, end point,wavelength, and color of your current input ray selection.

Page 73: RayCAD Manual

Commands - Object to Optical Command

67

OBJECT TO OPTICAL COMMANDOBJ is a shorthand command for Object to Optical andcan be called directly from the command line.

3D Objects, 3D Faces, Edge, 3D Mesh, Revolved,Tabulated, Ruled and Edge Surfaces can be grouped andassigned optical properties such as Glass Material,Reflectivity or Opaque. These objects become opticalcomponents and are intersected and ray traced like regularRayCAD Surfaces.

The combination of RayCAD's optical surfaces and theability to change mechanical objects drawn in AutoCADinto part of the optical design is very powerful. Being ableto turn covers, brackets, mounts, shafts, bearings, etc. intoreflectors or blockers is useful in analyzing for stray light.Using these objects also means you can design opticalcomponents with any shape and size required. They can bemade out of optical glass and will refract, being wavelengthspecific like regular optical components.

It's necessary to think of AutoCAD Objects turned intooptical objects differently than a normal RayCAD opticalsurface. RayCAD's surfaces are created by a conic oraspheric formula. This provides an exact and continuoussurface to ray intersection point as opposed to an Objectdefined by three or more points such as 3D Faces and wiremesh which makes for many small flat surfaces. Asmoothing can be applied causing the surface normal at thepoint of ray to surface intersection to be interpreted usingthe normal from four adjacent surfaces. It's clear that thefiner the mesh you use the more precise an optical surface isestablished.

Page 74: RayCAD Manual

Chapter 4

68

The Object to Optical command section covers:

Assign Optical Properties … ...… Page 68

3D Objects … … … … … … .… … . Page 72

Sample Drawing … … … … … … . Page 73

RayCAD|Object to Optical|Assign OpticalProp

The Optical Object Grouping dialog box provides a meansto group AutoCAD's Objects which share Smoothing andMaterials. The first part is used for collecting and naminggroups. There is also a link to AutoCAD's Edit of Groups.The second part assigns smoothness and materials to thegroup.

Page 75: RayCAD Manual

Commands - Object to Optical Command

69

Pressing Collect new Object... (used to select objects)produces the following dialog box.

AutoCAD Objects that are to become optical objects areselected by the Pick Object button. Usable objects are 3DObjects, 3D Faces, Edge, 3D Mesh, Revolved, Tabulated,Ruled and Edge Surfaces.

Before exiting, provide a name identifying this group.

Edit Object Group (makes a call to the standard AutoCADObject Grouping dialog box)

Page 76: RayCAD Manual

Chapter 4

70

The common use of this dialog box is to Highlight to locateobjects or Explode to eliminate objects. Several otherfunctions can be performed. The group name must beginwith "RAY_". The Description can be edited but care mustbe taken not to change keywords or field separators - nodata validity test is performed!

Page 77: RayCAD Manual

Commands - Object to Optical Command

71

Assign Material... Pressing this button brings up theOptical Property dialog box for changing the materialassignment.

The Refractive... brings up the standard Glass Selectiondialog box which is explained in detail in the "Changes toManual" insert sheets.

Page 78: RayCAD Manual

Chapter 4

72

RayCAD|Object to Optical|3D Objects

Several other commands are available and are all explainedusing AutoCAD Help.

Page 79: RayCAD Manual

Commands - Object to Optical Command

73

Sample Drawing

Open sample drawing Box.dwg

This drawing contains a box which is made fromAutoCAD Objects. It also contains an aperture and 5 inputrays.

As our first exercise, use the RayCAD|Inputray|Gathercommand to gather input rays. Now let's ray trace theempty box. The box will serve as ray projection planes.

Select the Ray_Start_Box and click on Assign Material…Choose Reflective. Do another raytrace and you will seethe following results.

Page 80: RayCAD Manual

Chapter 4

74

By keeping the material assignment as Invisible, this boxmakes for a good starter drawing. You can simply startplacing optical surfaces inside and study ray traces.

Page 81: RayCAD Manual

Commands - Optimize Command

75

OPTIMIZE COMMANDOPT is a shorthand command for OPTimize and can becalled directly from the command line.

Note: Before optimizing, you may want to Erase allexisting rays using the AutoCAD ERASE command andcrossing to clean off all old traces. Answering Yes to"Erase last raytrace (Y/N)" only erases the last raytrace.Prior traces may lie underneath.

The OPTimize command covers the followingsubcommands:

Focus group (automatic focusing) … … … … … … ..... Page 79Collimate group (automatic collimation) … … … … ... Page 82Curvature optimizing (change curvature radius) … ... Page 85Adjust (study ray intersections) … … … … … … … … .. Page 88Rotate … … … … … … … … … … … … … … … … … . Page 94Mode (choose trace mode) … … … … … … … … … … . Page 97

There are two types of optimization:

Type 1: Curvature optimizingRayCAD will automatically adjust curvature variables likeradius, conic and aspheric constants in an attempt to bringtwo rays to a point.

Don't forget, if theoutcome is not whatyou are looking for,typing U for Undoon the command linewill restore yourdesign as it was.

Type 2: Positioning optimizationRayCAD will automatically move a group of surfacesusing a Lead surface for its direction in an attempt to bringtwo rays to a point or a parallel.

Note: When Optimize moves a group to a new position thebody, if any, with a block insertion point coinciding with

Page 82: RayCAD Manual

Chapter 4

76

the insertion point of the surface being moved, will tagalong.

Note: Since a change in curvature can cause the body notto fit, use the ERASE command either before or afteroptimization to erase the old body, then use the BODYcommand to make a new body that fits. See Bodycommand on page on page 51 for more information.

For some OPTimize commands, the surface selectionroutine requires input of a Leader, a Target and a Groupwhich is accomplished by using the Optimize Parametersdialog box.

The optimization mode chosen is shown in the upper righthand corner. Coefficients in the "Optim on" column areonly active if you chose curvature optimizing.

In the case of curvature optimizing, the "Leader" is thesurface to be optimized. In a positioning optimization, the"Leader" is used to give direction of the upcoming move.

Page 83: RayCAD Manual

Commands - Optimize Command

77

"Target" is the surface on which the result of the ray tracesare evaluated.

"Group" is a surface or a group of surfaces (up to 32) thatwill follow the leader as it moves. "Group" is grayed out inthe curvature optimizing mode.

The optimizer routine will trace two input rays through yoursurfaces until the target surface is intersected. The programwill then make a correction by moving the Leader and theGroup or modify the surface shape.

Program keepscycling

As optimization takes place, three sets of numbers aredisplayed: Spread, Last Spread and Scaler. These numbersindicate distance between intersection points on the Targetand the scale used for the adjustment.

Press the ENTERkey to stop

The program will continue to adjust the component'slocation to a point where the changes are less than one inten million. In some cases, it is not possible to get thatclose to an optimum and the program will keep cycling init's attempt. When this situation occurs, the numbers willkeep repeating a pattern. Press the ENTER key to stop theoptimizing process.

Note: If more than two rays were gathered for your last raytrace, you are prompted with the following message togather the exact two rays needed for the optimization. Withthe proper selection of input rays, you can study focuslocation produced by certain areas of your optics (i.e.marginal rays vs. paraxial rays). For information ongathering rays, see Inputray|Gather on page on page 64.

Page 84: RayCAD Manual

Chapter 4

78

Note: Beamsplitters present a unique case. Since theOPTimize command uses two rays and, for example, a50/50 beamsplitter would let the first ray through and notthe second ray, the two rays never meet up at the targetsurface. The solution is to use the SURFace|Editsurfdialog command and set the percentage of pass through tozero or 100 depending on which ray path you areoptimizing. Once optimizing is accomplished, restore thepercentage.

Note: When optimizing in non-sequential, the optimizeprocess can cause rays to miss a surface or intersect withanother surface causing confusion. Switching tosequential mode (making sure surface numbering sequenceis correct) can cure this problem.

Note: If you have an unsuccessful optimization, the newsurface location may give you a hint to the nature of theproblem. Use U for Undo until your original surfacelocation is restored.

Note: Conditions can be possible where adjustingcomponents cannot accomplish a focus or collimation. Inthis case, a curvature change will be required. Othertimes it may be required to move more than one surface.

Page 85: RayCAD Manual

Commands - Optimize Command

79

RayCAD|Optimize|Focus group

Focus group will attempt to position a group of surfaces sothat the two rays come to a single point on the target.

You can use supplied drawing RAYCAD3.DWG to followalong with our example of this command.

Select RayCAD|Optimize|Focus a group.

Optimize parameters dialog box appears.

Page 86: RayCAD Manual

Chapter 4

80

We will make SURF-6 the Leader and SURF-7 the Target.

In the "Active Surfs" selection box, select SURF-6. In the"Aim Setting" window, click on Set Leader.

In the "Active Surfs" selection box, select SURF-7 andclick on Set Target. Press OK.

Note: It is possible for a surface to be both a Target and aLeader. For example, to bring a Screen to a focusposition, assign the Screen as a Leader and clear anyTargets.

For the example we use wavelength 587.6

As optimization takes place, three sets of numbers aredisplayed: Spread, Last Spread and Scaler. These numbersindicate distance between intersection

Page 87: RayCAD Manual

Commands - Optimize Command

81

points on the Target and the scale used for the adjustment.

The program will continue to adjust the component'slocation to a point where the changes are less than one inten million.

Note: In some cases, it is not possible to get that close toan optimum and the program will keep cycling in it'sattempt. When this situation occurs, the numbers will keeprepeating a pattern. Press the ENTER key to stop theoptimizing process.

Rays are drawn and surfaces are moved to the newlocation.

Page 88: RayCAD Manual

Chapter 4

82

Notice that the Mirror (SURF-6) has moved.

RayCAD|Optimize|COllimate group

COllimate group attempts to make the two raysapproaching the target parallel.

You can use supplied drawing RAYCAD2.DWG to followalong with our example of this command.

Select RayCAD|Optimize|Collimate group

Optimize parameters dialog box appears.

Drawing in progress."New location for surface is" (11.5583 2.85641 0.0)Command:

Page 89: RayCAD Manual

Commands - Optimize Command

83

We will make SURF-3 the Leader with SURF-2 to follow(Group) and SURF-4 the Target.

In the "Active Surfs" selection box, select SURF-3. In the"Aim Setting" window, click on Set Leader.

In the "Active Surfs" selection box, select SURF-2 andclick on Set Group.

In the "Active Surfs" selection box, select SURF-4 andclick on Set Target.

As optimization takes place, three sets of numbers aredisplayed: Spread, Last Spread and Scaler. These numbersindicate distance between intersection points on the Targetand the scale used for the adjustment.

Page 90: RayCAD Manual

Chapter 4

84

The program will continue to adjust the component'slocation to a point where the changes are less than one inten million.

In this example you will find that the Spread and LastSpread are repeating at zero while the Scaler unit has notreached it's lower limit. Press a key to stop theoptimization cycle since the two rays are parallel. Theycould become more parallel by letting the optimizationkeey cycling or place a target far away.

Note: In some cases, it is not possible to get that close toan optimum and the program will keep cycling in it'sattempt. When this situation occurs, the numbers will keeprepeating a pattern. Press the ENTER key to stop theoptimizing process.

Rays are drawn and surfaces are moved to the newlocation.

Page 91: RayCAD Manual

Commands - Optimize Command

85

SURF-2 and SURF-3 have moved into a position allowingoutputs to be parallel.

RayCAD|Optimize|Curvature optimizing

Curvature optimizing allows optimization of radius, conicconstant K, and aspheric coefficient A1, A2, A3, A4.

The surface selection routine requires just two surfaces: theone to optimize (Leader) and a Target.

Select the variable to optimize. Your options depend on thetype of surface. For example, an aspheric surface uses all ofthe variables, spherical only uses a radius. Uponcompletion, the surface is redrawn using the new data and afinal ray trace is done.

Since a change in curvature can cause the body not to fit,use the ERASE command when finished with OPTimize toerase the old body, then use the BODY command to make anew body that fits.

You can use supplied drawing RAYCAD4.DWG to followalong with our example of this command.

Drawing in progress."New location for surface is" (7.58644 3.0 0.0)"New location for surface is" (6.58644 3.0 0.0)Command:

Page 92: RayCAD Manual

Chapter 4

86

Select RayCAD|Optimize|Curvature optimizing

Optimize parameters dialog box appears.

Making SURF-2 (an aspheric) the Leader allowsoptimization of the conic constant K and coefficient A1,A2, A3, A4. Here we chose K conic. Make SURF-4 theTarget.

Page 93: RayCAD Manual

Commands - Optimize Command

87

In the "Active Surfs" selection box, select SURF-2. In the"Aim Setting" window, click on Set Leader.

The "Optim on" window becomes active. Click on Kconic.

In the "Active Surfs" selection box, select SURF-4 andclick on Set Target. Press OK.

For the example we use wavelength 587.6

As optimization takes place, three sets of numbers aredisplayed: Spread, Last Spread and Scaler. These numbersindicate distance between intersection points on the Targetand the scale used for the adjustment.

The program will continue to adjust the selected variableto a point where the changes are less than one in tenmillion.

Note: In some cases, it is not possible to get that close toan optimum and the program will keep cycling in it'sattempt. When this situation occurs, the numbers will keeprepeating a pattern. Press the ENTER key to stop theoptimizing process.

Rays are drawn and surfaces are moved to the newlocation.

Page 94: RayCAD Manual

Chapter 4

88

RayCAD optimized the conic constant K for focus.

RayCAD|Optimize|Adjust

Adjust provides a way to study ray intersections. You canview a slice of rays (preferably many rays - 100 or more)and slide this cross section up and down along the normalof a selected surface. The slice cuts through all of thelayout. Use ZOOM to isolate the portion with the ray ofinterest. This provides an easy method to find the bestlocation for the surface.

Run Random Ray2 or 3 times

Note: In order to have a good display of intersections, youshould have many (100 to 200) rays going through thissurface. The Grid command can automatically produce alarge number of uniform inputray patterns or run Randomray 2 or 3 times to get lots of rays to look at. However,depending on your computer's speed, you may want toreduce the number of rays for the most responsive display.

You can use supplied drawing RAYCAD4.DWG to follow

Drawing in progress.Command:

Page 95: RayCAD Manual

Commands - Optimize Command

89

along with our example of this command.

Select RayCAD|Raytrace|Option

First we want to do a ray trace using the Grid tracecommand in order to have a good display of intersections.See page on page 102 for detailed information.

Page 96: RayCAD Manual

Chapter 4

90

Set the height to 10 and the width to 10 to produce 100rays. Press OK.

Select RayCAD|Raytrace|Grid

Ray trace completed with 100 rays.

Select RayCAD|Optimize|Adjust

Use the Surface Selection dialog box to choose the surfaceyou want to slide back and forth. In this case we choosethe screen Surf-4 to adjust.

Select all 100 rays.

Select rays for viewing...Select objects:First corner: Other corner: 100 found.Select objects:

Page 97: RayCAD Manual

Commands - Optimize Command

91

A view looking directly at the surface, with a slice of thelayout centered around this surface, is displayed. Thethickness of the slice is controlled by the Depth command(defaults to 0.1). Depth can illustrate what depth of focuslooks like.

We set the zoom scale factor by typing 4.0. The slider canalso be used for Zoom.

The Zoom option magnifies the selected surface. Panallows you to move the display window in any directionand not change the magnification.

Pressing Go displays a new slice which is offset by thevalue controlled by Adj size. Repeated use of Go will stepin and out of the screen. Use Reverse to change direction.

Adjustment offset 0.0000:/Adj size/Depth/Zoom/Pan/Reverse/eXit/ < Go >: ZoomAdjust zoom scale factor <1>: 4.0

Adjustment offset 0.0000:/Adj size/Depth/Zoom/Pan/Reverse/eXit/ < Go >: Go

Page 98: RayCAD Manual

Chapter 4

92

The distance from the surface you selected to the slice isshown above the command line as "Adjustment offset".When value is 0.0, the surface is visible. If the surface iscurved, you may only see part of the surface since the restfalls outside the slice.

Note: If you choose the last surface, you can only adjusttoward the rays. Rays stop at the last surface.

Note: To reverse direction of adjustment, click on Reverseand press Go.

Exit leaves the adjustment section of Adjust and promptsfor following exit commands:

Adjustment offset 0.5000:/Adj size/Depth/Zoom/Pan/Reverse/eXit/ < Go >: GoAdjustment offset 1.0000:/Adj size/Depth/Zoom/Pan/Reverse/eXit/ < Go >: Go

Adjustment offset 1.5000:/Adj size/Depth/Zoom/Pan/Reverse/eXit/ < Go >: X

Page 99: RayCAD Manual

Commands - Optimize Command

93

Place surface moves the surface to the location lastproduced by Adjust.

Restore view brings back view prior to entering Adjust.

Notice that the Mirror (SURF-6) has moved.

Note: Use Surface|Sfnumber|Onlabel to update thesurface number to it's appropriate location.

View prior to Adjust is saved as RAYADJ.Ready to leave Adjust.../Place surface/Restore view/eXit<X>: P

New location for surface is (10.9923 3.0808 1.5)View prior to Adjust is saved as RAYADJ.Ready to leave Adjust../Place surface/Restore view/eXit <X>: RCommand:

Page 100: RayCAD Manual

Chapter 4

94

RayCAD|Optimize|Rotate

The Rotate command provides a means of rotating youroptical surface and immediately retrace all of your inputrays.

You can use supplied drawing RAYCAD3.DWG to followalong with our example of this command.

Select RayCAD|Optimize|Rotate

Using the Surface Selection dialog box, choose the MirrorSurf-6 to rotate.

Any point can be used for a base point. In this case, we

Base point ins

Page 101: RayCAD Manual

Commands - Optimize Command

95

pick the center of the surface. Type INS on the commandline.

Point to SURF-6.

Hint: Using AutoCAD ZOOM makes it easier to pick thesurface itself and not the body. Usually the body insertionpoint coincides with the surface insertion point.

We are using an existing ray as our reference. Type END

Point to the far end of the existing ray.

You can type the angle relative to the reference ray or youcan point. For example, to raise the ray 1" on SURF-7, themirror needs to rotate 1/2 that amount. Point to a distance1/2" away from existing ray (See Ref. 1 in drawing below).

Rays are drawn and the Mirror (SURF-6) is rotated.

of

Reference point END

of

New angle:

Page 102: RayCAD Manual

Chapter 4

96

Note: Use ERASE to remove the old body of SURF-6 thenuse the Bodycommand to add a new body.

Note: Sometimes you may find it easier to use AutoCAD'sROTATE command where you can rotate the body alongwith the surface or many surfaces and then use Raytrace toproduce a new trace.

Drawing in progress.Command:

Page 103: RayCAD Manual

Commands - Optimize Command

97

RayCAD|Optimize|Mode

Mode affects the way the program looks for and decideson the surface to intersect next.

If your design has a predictable ray path and surfacesequence, you may want to select Sequential. This modeis the quickest since a search for an intersection point isconfined to the next number in a sequence and, when thelast surface is reached, trace is terminated.

In Non-sequential mode, all surfaces are interrogated foran intersection point. The surface with an intersectionpoint closest to the last starting point of the input ray isused.

In some layouts you must use the non-sequential mode, i.e.any time you have multiple ray paths generated by abeamsplitter or multiple surface intersections (the multiplesurface intersections rule does not apply to fibers or hollowwaveguides. They trace fine in sequential mode).

Note: The current mode is shown on top of the commandprompt.

The sequential vs. non-sequential mode is saved in theRAY.INI file and will be the default for the next editingsession.

Page 104: RayCAD Manual

Chapter 4

98

RayCAD|Optimize|Mode

The "Grid Setting" window is used by the Grid tracecommand. The value in the Height and Width edit boxesis used to divide your first surface (SURF-1) into rows andcolumns. In this case, 25 rays would be generated. TheWidth corresponds to the X Y plane and the Height is laidout in the Z direction.

Page 105: RayCAD Manual

Commands -Raytrace Command

99

RAYTRACE COMMANDRT is a shorthand command for Raytrace and can becalled directly from the command line.

The Raytrace command covers:

Trace (tracing of rays) ........… .......... Page 100Grid ...................................… … ........ Page 102Random (visualize the light path) .... Page 102Option ........................................… ... Page 103Spot (see image formation) .............. Page 104

Raytrace searches data base for blocks named SURF-nr(starting with SURF-1 to SURF-nr) and look up X Y Zlocation, rotation and twist. It will also read attributes forindex data then write this to a file named SURF.DAT.

Raytrace calls RAYW.EXE, a "C" program, to docalculations. RAYW.EXE returns X Y Z coordinatesrepresenting ray to surface intersections and saves this in afile named RAY.DAT. It will then draw 3D polylinesbetween the coordinates.

The color of the trace defaults to the current color settingin AutoCAD. However, the trace color can be modifiedfrom the INPutray command using Gather. For moreinformation, see INPutray|Gather on page on page 64.

Page 106: RayCAD Manual

Chapter 4

100

Note: See Display|Dataprint on page on page 56 fordetailed display of intersections and ray directions.

You can interruptthe ray trace at anytime by pressingany key

If there are no display settings activated, a string of surfacenumbers are displayed (default). This will show you if aray is stuck bouncing between two surfaces. Pressing anykey at that point will produce this prompt:

Any time a particular ray makes more than two hundredintersections, a note indicating "Ray NR n has made 200intersections" and the above prompt is generated.

RayCAD|Raytrace|Trace

Choosing Trace will begin the tracing of rays.

Note: Change trace mode to sequential or non-sequentialby using the Option command.

Ray trace isdrawn

Each input ray is projected into 3-D space. If a rayintersects a surface, the point of intersection and the surfacenormal at that point are calculated.

In Non-sequential mode, all surfaces are interrogated for anintersection point. The surface with an intersection pointclosest to the last starting point of the input ray is used.

In Sequential mode, the next surface sequence number is

Raytrace is paused /Continue/Next Ray/eXit/ <X>:

Page 107: RayCAD Manual

Commands -Raytrace Command

101

used and trace will terminate if no intersection exists.

At each intersection point, the ray direction is then changedaccording to the type of surface encountered. This pointand new direction become the start point for the next rayprojection.

Note: Rays will terminate when there are no more surfaceintersections found. Therefore, if you find rays terminateprematurely, they are most likely missing the next intendedsurface. In this case, if you insert one or more largescreens in your design , you can catch these rays by seeingwhere they go.

You have the option of erasing your last ray trace.

Raytrace will return a message "No rays drawn" in the caseof:

- no input rays were gathered. See INPutray command on page on page 60.

- less than two surfaces present. See SURFace| Makesurf command on page on page 116.

- invalid index name.

Page 108: RayCAD Manual

Chapter 4

102

RayCAD|Raytrace|Grid

The Grid command will produce rows and columns ofinput rays projected toward surface number 1 (SURF-1) andoriginating from the source point illustrated by the firstinput ray in your input ray selection. If the first two raysselected by the INPutray|Gather command are parallel, eachray produced by the Grid command will be parallel. Thenumber of rows and columns are determined by settings inthe Raytrace|Option command.

Grid is very useful in combination with theOptimize|Adjust command. Since rays are produced in anorderly row and column fashion, the Optimize|Adjustcommand clearly illustrates spot size, aberrations and otherdistortions.

RayCAD|Raytrace|Random

Random will use the random generator to produce a set of50 input rays. and trace them all.

The random generator can generate input rays forming twopatterns - polar and parallel. The pattern used is determinedby the input rays from the INPutray|Gather command. Ifthe first two input rays are parallel, all rays generated willbe parallel to your input rays and randomly distributed to fitinside the first surface (SURF-1). If the first two rays arenot parallel, then the end of the first input ray furthest awayfrom the first surface is used as a focus for all the rays andthe direction is set so rays fit inside the first surface.

Page 109: RayCAD Manual

Commands -Raytrace Command

103

SURF-1 must bepresent in thedrawing

The generation of many rays helps to visualize your lightpath. It can be useful in testing a field stop by filling thearea with rays.

RayCAD|Raytrace|Option

The Options Trace Settings dialog box allows you tochange the Trace Mode to sequential or non-sequential andaffect the Grid setting.

If your design has a predictable ray path and surfacesequence, you may want to select Sequential. This mode isthe quickest since a search for an intersection point isconfined to the next number in a sequence and, when thelast surface is reached, trace is terminated.

In Non-sequential mode, all surfaces are interrogated for an

Page 110: RayCAD Manual

Chapter 4

104

intersection point. The surface with an intersection pointclosest to the last starting point of the input ray is used.

Values entered in the Height and Width edit boxes are usedby the Grid command.

Note: All settings are remembered for the next editingsession.

RayCAD|Raytrace|Spot

The Spot command helps to visualize the image formationof your ray trace. Many spots are projected onto a targetthat you select.

Note: The Spot command only needs a target.

Note: Accessing the following commands from the top pull-down menu calls the desired command and leaves you in acommand line menu where you can interactively drawspots, change size and colors, etc. When finished, pressENTER to eXit.

Page 111: RayCAD Manual

Commands -Raytrace Command

105

Since spots are placed on a surface, make sure that yourviewing angle is set in such a way that the face of thesurface is visible. Looking straight down on a surface won'tshow you any spots since they have no thickness. As partof the main spot menu you will find the Clip command -helpful in viewing the spots.

The random and the grid input ray generators are used toproduce the input rays needed to compute the spots.

In the following, we will first use the Clip command to giveus a viewable surface.

RayCAD|Raytrace|Spot|Clip

RayCAD|Raytrace|Spot|Unclip

Use the Clip command to view the target surface end-on.Everything in front and behind it is clipped off.

The Unclip command takes you back to the view before theClip command was used.

RayCAD|Raytrace|Spot|Front

RayCAD|Raytrace|Spot|Back

The distance in front and back can be modified through theFront and Back command (default is 0.05). You may needto increase these distances if you are looking at a curvedsurface as some of the spots may fall outside the viewingslice.

Page 112: RayCAD Manual

Chapter 4

106

RayCAD|Raytrace|Spot|Grid spots

Grid spots produces uniform rows and columns of inputrays.

Note: Spots may not show depending upon your viewdirection. See Spot|Clip on page on page 105 forinformation.

RayCAD|Raytrace|Spot|Random spots

This command will randomly pick an input ray directionand will produce 200 spots.

Page 113: RayCAD Manual

Commands -Raytrace Command

107

RayCAD|Raytrace|Spot|Point style

The Point style command allows you to change the spotshape and size.

Page 114: RayCAD Manual

Chapter 4

108

RayCAD|Raytrace|Spot|Color

COlor allows you to change the color so that if you use Gridspots or Random spots again, the new spots can bedistinguished from prior spots.

Page 115: RayCAD Manual

Commands -Raytrace Command

109

RayCAD|Raytrace|Spot|Zoom

Use the Zoom command to get a close up of your spots.The Zoom command is transparent and can be used at anytime.

Note: Before leaving the Spot command, you may want toUnclip to restore view.

The RayCAD|Display|Restore scrn can always be used. Seepage on page 58.

RayCAD|Raytrace|Spot|Options

This is the same dialog box used in the Optimize|Mode andRaytrace|Option commands. For details, see pages on page97 and on page 103.

Page 116: RayCAD Manual

Chapter 4

110

REMOVE COMMANDRE is shorthand for REmove and can be called directlyfrom the command line.

REmove discards a selected surface anywhere in thesequence and then fills the vacant place by renaming therest.

Use Sfnumber labels It can be most helpful if you turn labels on by usingRayCAD|Surface|Sfnumber|Onlabel before you beginREmove. This makes it easier to see exactly whichsurface(s) you want to eliminate.

Note: If you are trying to remove half of a doublet lens,it can be difficult by pointing to determine whichsurfaces to remove since two surfaces in the doublet willbe on top of one another. By using the number given byRayCAD|Surface|Sfnumber|Onlabel you can easilyselect the correct surface part of the doublet to discard.

Select by pointing tobody

Note: The body is not part of the surface block itself.However, it is possible to pick a surface by pointing tothe body. The program will select a surface with aninsertion point coinciding with that of the body. In a twosurface component, the body insertion point is that of thelast entered of the two surfaces.

Important! If removing one part of a two surfacecomponent, make sure that another surface withmatching index is put in its place or remove the secondsurface, too.

Page 117: RayCAD Manual

Commands - Remove Command

111

RayCAD|Remove|Remove renumber

Remove renumber will rename existing surfaces to closegaps in the number sequence.

RayCAD|Remove|Erase

Erase merely erases the surface block but it is still presentin the database and will leave a gap in the number sequence.This is not a problem for either sequential or non-sequentialray tracing and later, when making a new surface, you cansimply give it the number of the gap and it will fill it.

Note: When Remove encounters an erased surface, it willrename it "OLDSURF-n". After many repeated Erase andRemove renumber there will be many OLDSURF-Ns in thedatabase. You may want to clean up your database byusing PURGE BLOCK as the first thing in an editingsession for Rel. 12. Rel. 13 can be PURGE'd at any time.Don't be afraid of answering Yes to the purging ofOLDSURF-N and BODY-N. If any surface is currentlyused in your drawing it will not be listed and cannot bepurged.

Page 118: RayCAD Manual

Chapter 4

112

SURFACE COMMANDSF is a shorthand command for SURFace and can becalled directly from the command line.

The SURFace command let's you select optical componenttypes and index table, either by using self constructedcomponents or from a vendor catalog.

You can look at the attributes of a surface, change thoseattributes, make a copy of a surface, and assign on-screennumber labels.

Summary of SURFace command:

Makesurf (user created surfaces) ...… … .… … .. Page 116Catalog (from optical catalog) .............… … … . Page 145Sfnumber (affects surface numbering) ...… … ... Page 146Listsurf (info on surfaces) .....................… … ... Page 149Editsurf (change surface characteristics) … … ... Page 150Clone (duplicate a surface) ........… … … ......… . Page 151Redraw (update a surface block) ............… … .. Page 152Deactivate (exclude surface(s) from Raytrace)… Page 153Activate (reverses Deactivate) … … … … … … .. Page 153Export .......................................................… Page 153Import .......................................................… Page 153

Page 119: RayCAD Manual

Commands - Surface Command

113

Coordinate System

Our samples and descriptions are described as if the workis in a world (top) view, looking down on the design andcomponents are placed from left to right in the X direction.

For the next illustration you can open sample drawingRayCAD3.dwg and use RayCAD | Display | Viewportsand place cursor in the isometric view to make this thecurrent view.

Type UCS World to place UCS in a World coordinate.

Command: UCSOrigin/ZAxis/3point/OBject/View/X/Y/Z/Prev/Restore/Save/Del/?/<World>: W

Page 120: RayCAD Manual

Chapter 4

114

The coordinate system consists of a lab coordinate and alocal coordinate. The lab coordinate corresponds to theUCS (User Coordinate System). The local coordinateapplies to a single surface where the normal at the originextends in the Z direction, height in the Y direction andwidth in the X direction.To illustrate this, make sure UCSICON is set to Origin. Ifnot, on command line type UCSICON Origin.

The HIDE commandwas used to makethe UCS icon morevisible for theillustration.

To set UCS to a local coordinate, type UCS OBject forObject.

Command: UCSOrigin/ZAxis/3point/OBject/View/X/Y/Z/Prev/Restore/Save/Del/?/<World>: OB

Page 121: RayCAD Manual

Commands - Surface Command

115

Good Advice

Preparing yourdrawing

Before you begin to insert components, it pays off toorganize your layout. Under the Display command youwill find ways that arrange your screen to three view ports- one being a world (top) view, one a front view, and onean isometric view. You don't have to use these views.Surfaces can be inserted anywhere.

As a reminder, set the SNAP and UCS before beginningthe insertion.

The snap size should be set to match your design.

The RayCAD|Display|Restore scrn command restores thescreen to a single view port with a World coordinate,removing any screen clipping and isometric viewing. Thismay be a good start for a new layout.

Page 122: RayCAD Manual

Chapter 4

116

RayCAD|Surface|Makesurf

Makesurf is used to create optical componentsusing your specifications. Be sure to verify thatyour creation can be manufactured.

Summary of Makesurf:

• Pass-Through surfaces ............................ 117• Refractive surfaces .................................. 120• Index Data ............................................... 124• Medium ................................................... 130• Refractive … … … … … … ..… ................... 120• Diffractive surfaces.................................. 131• Reflective surfaces .................................. 133• Contour of surface .................................. 134• Component thickness .............................. 141• Surface name ........................................... 141• Defining second surface .......................... 142• Rotating surface ...................................... 143

Some components are single surfaces, others are doublesurfaces. For example, a lens has two surfaces and amirror has one surface. Each surface is made into a block.This means that the two surfaces of a lens are not attachedin any other way than they share the index name and theyare named in sequence.

Because surfaces are separate blocks, this allows forindependent rotations and spacing. After a component iscompleted, body is applied to each surface to give it thelook of a whole component. See Body on page on page 51for further details.

Note: If another surface is placed in the middle of a lens,

Page 123: RayCAD Manual

Commands - Surface Command

117

you can count on an unexpected result.

Surfaces can be divided into categories depending on theirinteraction with light: Pass-Through, Refraction,Diffraction, Reflection.

The following section is separated according to thesecategories. An example of each is provided and alsoserves as an index to shared subcommands.

Pass-Through Surfaces

Pass-Through surfaces include:

Aperture, a round or rectangular hole in 3D space thatallows light to pass through.

• In sequential mode, rays missing the aperture areterminated.

• • In non-sequential mode, rays missing the aperture will

not intersect but will continue. However, if the apertureis used in conjunction with a baffle, rays missing theaperture will be blocked.

Baffle, an opaque surface. Use this any where to blockrays. If an aperture is placed on top of a baffle, it becomesa hole in the baffle.

Screen, a surface that can be inserted anywhere in youroptical layout since it does not change ray direction. Usedprimarily to study ray intersection and image formation.Also used for projection of spot diagrams. Many timesused as the last surface.

Page 124: RayCAD Manual

Chapter 4

118

This example will illustrate the Makesurf command usingan Aperture (Pass-Through).

Select RayCAD|Surface|Makesurf|ApertureUsing SNAPhelps in preciseplacement

Use your pointer to place surface or key in coordinates.

To produce a rectangular shape, click on Rectangle. Enterin the height and width and press OK.

Place center of surface location:

First free Surface number is 1.Surface Number.. Enter any number <1>: 1

Page 125: RayCAD Manual

Commands - Surface Command

119

Prompt for baffle If choosing Yes, a baffle would be placed at the sameinsertion point as the aperture. Multiple apertures can beplaced on a baffle to create holes. The aperture and bafflesurfaces must line up such that the ray intersection betweenthe two surfaces is less than 1 * 10-6.

Here we type N for No.

The completed Aperture is shown below.

For information onSurface|Sfnumber,see page on page146.

Note: The surface label (SURF-1) can be turned on or off.

Aperture opening can be placed into a BAffle.Do the baffle definition now...(Y/N) <Y>: N

Page 126: RayCAD Manual

Chapter 4

120

Refractive Surfaces

Refractive surfaces include:

Beamsplitter, two types are provided, one being a long andshort wavelength pass, the other having a partial reflection.

Fiber consists of two cylindrical rods that can be placed indrawings independently of each other but a ray tracestarting in one end will exit the other.

Fresnel, a lens resembling a plano-convex or plano-concave lens that is cut into narrow rings and flattened out.

Lens, a refractive, two surface component.

PLates, a refractive component consisting of two flatsurfaces. Also used for construction wave guides.

Prism, a dispersing, transparent component consisting oftwo surfaces.

Tube, a single surface used with other refractive surfaces tomodel holes or rods.

We will use a Lens (Refractive) to illustrate the Makesurfcommand. The input required is typical for all refractivecomponents. Refractive surfaces requiring unique input isdescribed on page 135.

Page 127: RayCAD Manual

Commands - Surface Command

121

Select RayCAD|Surface|Makesurf|Lens

SNAP (F9) andORTHO (F8) help inprecision placement

Use your pointer to place surface or key in coordinates.

The Glass Selection dialog box appears. Here you controlthe medium and select glass type.

Place center of surface location: 2,1,0

Page 128: RayCAD Manual

Chapter 4

122

For information onMedium, see pageon page 130.

For details on Source of Index, see page on page 124.

Note: Medium defaults to the index of air.

For Source of Index Data, we chose Schott1.ind A-Kwhich allows you to choose an index from a supplied list.

Pick BAK-1, then press OK.

Note: If you were making a Fiber, you would select amaterial for the core and then are prompted for a materialfor the cladding.

Page 129: RayCAD Manual

Commands - Surface Command

123

For moreinformation oncontour, see page onpage 134.

The contour of the first surface of the Lens we will makespherical with a diameter of 2.0.

For surface curvature, we made the radius 3.0.

Press OK.

For detailedinformation onThickness, see pageon page 141

Make the thickness 0.5.

For detailedinformation, seeSurface Name onpage on page 141.

Because the Lens is the first surface drawn, it is namedSURF-1. Press ENTER to accept.

For detailedinformation, seeDefining SecondSurface on page onpage 142.

Construct the second part of the surface. Make the contourSpherical and keep 2.0 diameter. Change the curvature toConcave. Press OK.

Component thickness..Center to center (not the edge) <0.5>: 0.5

First free Surface number is 1Surface Number...Enter any number<1>: Enter

Second surface's definition..(Y/N) <Y>: Yes

Page 130: RayCAD Manual

Chapter 4

124

The completed Lens is shown below. This is the end of theLens example.

Index Data

Each refractive surface has an index file name and a nameof the glass type saved as an attribute with the surfaceblock. The Glass Selection dialog box is used for selecting

Page 131: RayCAD Manual

Commands - Surface Command

125

glass manufacturers and glass types. When a glass name ischosen, the information about the particular glass is shownin the lower portion of the dialog box.

Source of Index data:

Schott, Corning or ZEMAX: Allows you to choose fromglass manufacturer (Corning and Schott) or a ZEMAXcompatible index file.

Note: If you wish, you can add index tables to the fileRAYCONST.INX. This file contains all the informationnecessary to calculate the index for a particularwavelength using one of two formulas.

To show what the RAYCONST.INX file looks like, thefollowing is an excerpt. Each line contains:

• Glass name (when 2 names are on 1 line, they areequivalent)

• Formula 1 or 2• 6 numbers (A0 - A5) which are the constants for the

dispersion formulas• Media index

GLASSNAME

GLASSNAME

FOR-MULA A0 A1 A2 A3 A4 A5 MEDIA

A63-65 FK-3 1 2.121650 -9.503490E-03 8.318686E-03 3.339573E-04 -2.364166E-05 9.972179E-07 1.0003A86-82 FK-52 1 2.185857 -5.201463E-03 8.107487E-03 1.008583E-04 -2.224178E-06 1.919751E-07 1.0003A87-70 FK-5 1 2.188523 -9.598334E-03 8.635329E-03 2.395636E-04 -1.547314E-05 6.879645E-07 1.0003A87-84 1 2.188331 -5.365878E-03 7.743657E-03 1.312934E-04 -7.417952E-06 4.581512E-07 1.0003B10-63 BK-1 1 2.250616 -9.247589E-03 1.099293E-02 6.033767E-05 1.460288E-05 -7.160412E-07 1.0003B11-60 K-7 1 2.250586 -8.155770E-03 1.218439E-02 -8.656369E-05 3.749854E-05 -1.850241E-06 1.0003B16-64 BK-7 1 2.271176 -9.700709E-03 0.0110971000 4.622809E-05 1.616105E-05 -8.285043E-07 1.0003B18-60 BALK-N3 1 2.272935 -9.344543E-03 1.182611E-02 7.960521E-05 1.382893E-05 -4.952685E-07 1.0003B18-65 PK-2 1 2.275718 -9.777224E-03 1.105575E-02 1.910096E-05 1.949133E-05 -1.015542E-06 1.0003B23-59 K-5 1 2.287966 -9.829138E-03 1.111679E-02 3.82463E-04 -2.412558E-05 1.418343E-06 1.0003

Page 132: RayCAD Manual

Chapter 4

126

Using the existing file as a guide, you can insert a similarline for a glass not available from the supplied file.

The refractive index of a glass in the wavelength range of365 to 1014 nm was calculated from the following formula(from Melles Griot - Optics Guide 5):

Formula 1

n2 = A

0 + A

1l2 + A

2l-2

+ A3l-4

+ A4l-6

+ A5l-8

Here λ, the wavelength, is in microns, and the constants A0through A5 are given by the manufacturer for eachdifferent glass. This equation yields a value for index thatis accurate to ±3 x 10-6 between 400 and 750 nm, andaccurate to ±5 x 10-6 from 750 to 1014 nm.

For shorter wavelengths, the refractive index wascalculated from the following formula (from Melles Griot -Optics Guide 5):

Formula 2

nA

A

A

A

A

A2

02

212

22

23

24

2

25

21− =−

+−

+−

λλ

λλ

λλ

Page 133: RayCAD Manual

Commands - Surface Command

127

User File.Inx: Allows you to use an index file generatedby you to enable specialty glass, plastic, etc. to be used.Some index tables are supplied by RayCAD.

A file created with Single can also be recalled here.

If the index file found has 1 set of data points (Single),RayCAD uses that wavelength and index.

If the index file found has 4 through 50 sets of data points,RayCAD extracts 4 sets of data surrounding thewavelength specified from the INPutray|Gather commandand does a power fit to return an index.

A dialog box to Select Index File appears. Here youchoose the index file you want.

If you selected Fiber, RayCAD requests a file to containindex for the cladding.

If you want to create your own index table to be used withInxfile, this can be accomplished by using any editor. Usea supplied index file as an example of the format.

Page 134: RayCAD Manual

Chapter 4

128

The following example shows the first four data points inan index file. Note that the first line must be the GasIndex. The second line must be a wavelength, the next itsassociated index, and so on. The maximum set of indexvalues and wavelengths in an .INX file is 50. Program willprint the following message if more than 50 sets of dataare encountered: !!!Only the first 50 sets of Index data areused !!!.

If you desire, comments can be placed on a line in .INX ifproceeded by a semi-colon. It is okay to have empty linesin your Index Table.

A Powerfit calculation will fit desired wavelength to anexcerpt of the table, Power curve fit; y = ax^b (a>0). IfDisplay|Dataprint has been activated, a r^2 value isprinted for each wavelength and represents the coefficientof determination. A r^2 close to 1.00 indicates a better fitthan values close to zero.

Page 135: RayCAD Manual

Commands - Surface Command

129

Make Single Wave.INX: Distinguishes itself from aregular index file in that only one wavelength, one indexand one medium is required. It is for those who arefrequently using a single wavelength (i.e., a laser). A.INX file is automatically generated. Since only onewavelength and one index is provided, no fitting of indexis performed.

NOTE: The Wave entered next will override Wave fromINPut Gather command.

The wavelength entered in the Single index file willoverride the wavelength supplied through theINPUTray|Gather command.

The dialog box to Select Index File appears. Here yougive the single index file a name so that it can be stored

b nIn x

n

a n b In x n

rIn x)

nIn y)

n

=−

= −

LNM

OQP

−LNMM

OQPP −LNMM

OQPP

∑ ∑∑

∑∑

∑ ∑

∑∑∑

∑∑ ∑∑

∧∧

∧∧

∧∧

(In x)(In y) -

In x In y

(In x)

esp In y

= (In x)(In y) -

( In x)( In y)n

(In x) (In y)

b gb gb g

b g b g

22

22

22

22

/ /

( (

Page 136: RayCAD Manual

Chapter 4

130

and called on later if desired.

To use a file created from Single again, call it usingINXFILE.

Here's an example of how a Single index file looks:

1.003 ; Gas Index

240.0 ; Starts with wavelength in nm

1.51333 ; Associated Index

If you had selected Fiber, RayCAD requests a file tocontain index for the cladding.

RayCAD Original.INX: For compatibility to earlierversions of RayCAD, RayCAD Original is included.

Medium: Change Medium if components are operating ina different environment than air (water, oil, vacuum, etc.).Note: A vacuum equals 1.000.

Note: The medium is not wavelength specific. It isnecessary to model space between glasses as surfaces withtheir own index for greater accuracy.

Page 137: RayCAD Manual

Commands - Surface Command

131

Refractive surfaces requiring unique input

Beamsplitters need additional input. You will beprompted to Enter W for Wave dependent or a percentageto pass through

If you want to choose a percentage, enter at the prompt.

For furtherinformation onBeamsplitters, seepage on page 120.

Also, see theOPTimize commandon page on page 75.

If you choose Wave dependent, next prompt requests youenter pass wavelength in nm.

A beamsplitter is a two surface component and is treatedas a pair.

Fresnel is modeled and specified as a Lens. Conic andaspheric curvatures are valid.

Diffractive Surfaces

Diffractive surfaces include:

Echelle, a high resolution, coarsely ruled grating thatconsists of one surface and is always flat.

Grating, a holographic or ruled grating can be curved.Consists of one surface.

Transmission Grating, a transparent diffraction gratingthat serves to transmit light. A TGrating can besandwiched between 2 glass plates.

Note: If a grating is added to one side of a transparentmaterial, a small space must be created between the 2surfaces in the order of 1.0e-4 to 1.0e-5 depending uponthe thickness of the emulsion.

Page 138: RayCAD Manual

Chapter 4

132

Makesurf command using a Grating (Diffractive):

Select RayCAD|Surface|Makesurf|Grating

Use your pointer to place surface or key in coordinates.

Use the Estimated Usable Orders evaluator to find avalid order. Since grooves, wavelength, angle ofincoming ray and the order are interrelated, use theEstimated Usable Orders evaluator to find anappropriate order and enter this value into Order toTrace. Measure angle between surface normal andincoming ray. Enter a positive angle when grating rotationis counterclockwise measured from surface normal toincoming ray. The data in the Grooves/mm field andOrder to Trace field will be part of the surface attribute.The wavelength and the angles are determined by thecurrent wavelength and angle of actual trace.

Note: For a ray trace to be successful, a correctcombination of grooves, blaze angles, wavelengths, orders

Place center of surface location:

Page 139: RayCAD Manual

Commands - Surface Command

133

and rotation of diffractive components is important.

See "Appendix C-Troubleshooting,Grating/Echelles"and "Glossary,Orders" for moreinformation.

Echelles and gratings can only produce diffractions whenangles and wavelength ranges are not violating thediffraction formula.

Note: Follow the instructions for a regular grating in theuse of TGratings.

Reflective Surfaces

Reflective surfaces include:

Hollow Waveguide consists of two cylindrical rods thatcan be placed in drawings independently of each other buta ray trace starting in one end will exit the other.

Mirror, a reflective component consisting of one surface.

Reflector, a curved reflective component that can have ahole in the center. A reflector can only be round.

Note: If a rectangular reflector is needed, use a mirrorinstead of a reflector. The only difference between amirror and a reflector is that a reflector is drawn as amulti-wire mesh and can only be round and has nothickness. A mirror prompts for a thickness which, ifsupplied as a zero, will not add a body to it.Use the Contour Maker dialog box to enter contour,diameter, hole size (if any) and to specify round orrectangular.

Page 140: RayCAD Manual

Chapter 4

134

Contour

From a default Contour dialog box, several specializedcurvature dialog boxes can be accessed. Use the "MoreShapes" pull-down menu to select the curve you need.Some components limit the selection. For example, anaperture can only be flat.

These dialog boxes allows for a visual way of creatingcurves and are used in both generation of new surfaces andediting of existing surfaces.

The Aspheric dialog is unique in that all contours can beentered through it.

Conic Parameters Slider and Edit Boxes:Radius and five coefficients can be controlled by clickingup or down on the slider buttons. The contour display isupdated each time a slider is activated. The colored + and- buttons will increment and decrement the digit acted onby the slider and it's setting is shown in the box titledSlides Scaling.

The sliders can be made to operate continuously if Singlestep is disabled.

Each variable is shown in the edit box to the right. Placingthe cursor in the edit box allows for direct entering ofvalues.

Round and Rectangular Radio Buttons:Use these radio buttons to define the outside shape of yourcomponent. Rectangle mode is only valid when operatingon a single surface.

Page 141: RayCAD Manual

Commands - Surface Command

135

Diameter, Hole, Height and Width Edit Boxes:Place cursor in edit box for direct entry of values. Thediameter must be larger than the hole.

Curve Pull-Down:This shows convex, concave and flat. When generatingnew surfaces, select the appropriate curvature. In the caseof convex and concave, you will see no change to thedialog box. But, if concave was picked, the surface will bespun around 180 degrees when the surface is finallygenerated.

Show Button:Press this any time to update the contour display.

"Contour is" Display:Lower left shows the current conic shape under the labelcalled "Contour is".

This status label will change as coefficients are beingedited to reflect the current conic shape.

Note: A error message is displayed when parameters areinvalid. For example, generating a surface using a 1 inchdiameter and a radius less than .5 will produce an error.Follow suggestions to correct the problem.

Inputting a negative radius will cause the surface to berotated 180 deg. upon insertion automatically producing aconcave surface if viewed from the world (top) view withthe rays traveling from left to right. Of course, in a threedimensional environment, the terms concave and convexwill depend on direction of the light and direction of thesurface.

The radius extends in the same direction as the surface

Page 142: RayCAD Manual

Chapter 4

136

normal.

Curvature allows you to enter the radius as 1/r (thereciprocal of the surface radius).

K, A1, A2, A3 Aspheric surfaces need not just a radius but also aconstant "K" which gives the eccentricity of a conicsurface and four aspheric deformation constants A1, A2,A3 and A4. The formula below describes a curve that,when revolved around the Z axis, defines an opticalsurface. A point S2 distance from Z axis will equate to z,the height along the Z axis.

Where S2 = X2 + Y2 and c=1/radius

Hyperboloid K<-1Paraboloid K=-1Ellipsoid rotated about it's major axis -1<K<0Sphere K=0Ellipsoid rotated about it's minor axis K> 0

zcS

K c SA S A S A S A S=

+ − ++ + + +

2

2 2 14

26

38

410

1 1 11 2

( )/

Page 143: RayCAD Manual

Commands - Surface Command

137

Parameters for conic surfaces:

The positions of the foci for the conic surfaces arefunctions of r and K and are given by the followingrelations and in illustration..

dr

K

dr

KK

d dr

KK

dr

d d rK

K

1

2

3 4

5

6 7

1

12

11

2

11

=+

=+

=+

± −

=

=+

− ±

( )

, ( )

, ( )

Page 144: RayCAD Manual

Chapter 4

138

Samples of Isolating the r and K values

How to find valuesfor r and K

The Contour Maker dialog box requires input in terms ofthe r and K values. Below are examples of r and K valuesfor the illustration..

Sample of Ellipsoid from Figure 24a.:

If given and d

r = d1

Result is K = 0.403 r = 2.21

2d

Kd

dK

1 1575 2 0

21 4

12

2

= =

=⋅

⋅ +

. .

( )

Figure 24

Page 145: RayCAD Manual

Commands - Surface Command

139

Sample of Ellipsoid from Figure 24b:

Sample of Paraboloid from Figure 24c:

Sample of Hyperboloid from Figure 24d:

If given d3 = 3.0 d4 = 1.0

K = r = -d4(K +1)

-K - 1)

Result is K - 0.25 r = 1.5

− −+

⋅( )( )

d dd d

3 43 4

2

2 e j

If given d5 = 3.0

K = -1.0 and r = 2 d5

Result is K = -1.0 and r = 6

If given d6 = -1 d7 = -2

K =-(d6 + d7)(-d7 + d6)

r

Result is K = -9 r = 2

2

2 = ⋅ +− +

dK

K6

1

1

( )

e j

Page 146: RayCAD Manual

Chapter 4

140

EccentricityConstant K

Hyperboloid, Paraboloid and Ellipsoid need a radius andthe eccentricity constant K. See formulas above foralternative input.

COne is modeled from a surface of the type axiconrepresented by the hyperboloid with an extremely smallradius. The K and diameter determine the length of thecone. It should be noted that the extreme tip of the coneforms the shape of a hyperboloid.

Sphere and Cylinder require only a radius.

Cylinder is inserted so that the central axis of the cylinderlies along the Z axis therefore affecting a light ray in theXY plane. If you want to use the cylinder affecting therays in the Z plane, follow these steps to spin the cylinderaround it's normal:

After placement, and after exiting RayCAD, type UCSENTRY. Point to the cylinder. This will cause the UCS tobe set to the coordinate for the surface of the cylinder.Then type ROTATE. Point to the cylinder surface andtype 90 for rotation. Type UCS PREVIOUS to get back toyour normal user coordinate.

Note: To change any of the parameters, use theSURface|Editsurf|Contour command. The new shape isredrawn to allow visual inspection and is ready to betraced.

Enter K, the conic constant K <-1.../<1.070>

Page 147: RayCAD Manual

Commands - Surface Command

141

Component Thickness

Thickness is notprompted forAperture, Baffle andScreen as they haveno thickness.

If surface's contouris to be cylindrical,you must selectHeight and Widthfor the size.

Select the thickness of the component. This indicates thethickness from the center of the surface to the backside. Ina two surface component, the thickness is the center pointbetween the two surfaces.

Note: Thickness is only used for the initial spacing ofsurfaces on a multi surface component. To later changethe spacing between surfaces, use the AutoCAD MOVEcommand. The thickness value is inconsequential at thispoint.

The Body command uses the thickness for single surfacesto draw the wire mesh. Editing of thickness only affectsthe thickness of the body - not the spacing betweensurfaces.

If the component is a Fiber or Hollow Waveguide, insteadof thickness, you will be requested for the Length ofstraight part of Fiber.

Surface Name

For visual aid innumbering, useSurfnr|Onlabel

Each surface is made into a block named SURF-1 throughSURF-nr. Ray is traced in sequence from 1 through n insequential mode. In non-sequential mode, all surfaces arechecked for an intersection point and the nearestintersection point is used - even if this is the surface itself.

Note: In non-sequential trace mode, the order of thesurface numbers are not important except in the case offiber, hollow waveguide and beamsplitter. For fiber andhollow waveguide, the two ends must be numberedadjacent to each other. For beamsplitter, the backside

Page 148: RayCAD Manual

Chapter 4

142

must be numbered adjacent to each other.

The prompted <nr> is the first unused sequence number.It can be an empty location or at the end. Press RETURNto accept default or type free nr at the end to add a newsurface to the end of the sequence. To insert a surface intoan existing sequence, simply enter the number where youwant the insertion to take place and all surfaces followingit will be incremented by one. The same applies if you areusing Catalog to insert surfaces. If you know the numberin the sequence, just enter the number and the surface isinserted in that slot.

Defining Second Surface

See Helpful Hints,Curvature on pageon page 161.

A two surface component needs defining of the secondsurface. The second surface will assume the same Indexand Size of the first surface.

Select the contour and the second surface is drawn. Thebody is drawn between the two surface component. If youneed to reposition or rotate one surface of a two surfacecomponent, just ERASE the body, use MOVE orROTATE, then, when finished, use the Body command toredo the body.

First free Surface number is nr.

Surface Number..

Enter any number <nr>:

First free Surface number is nr and nr is available at the end.

Surface Number...

Enter any number <nr>:

Page 149: RayCAD Manual

Commands - Surface Command

143

For surfaces like Fibers, Hollow Waveguides andBeamsplitters, it is recommended that the second surfacebe defined when prompted. These types of surfaces needto have the surface numbers adjacent to each other. Theprogram must treat these surfaces as a pair.

A Plate can be used to construct wave guides, in whichcase you would give a zero thickness and may not want todefine the second surface at the prompt.

Different types of refractive surfaces can be combined tomake complex objects. Tube can make holes and rods orholes in rods.

Rotation

Grating rotationcan be tricky

Rotation of a surface is only requested at creation time forPrisms, Echelles, Fibers and Hollow Waveguides.

At prompt for Rotation Angle, key in an angle or point.

Convex curvatures are made concave by rotating thesurface 180°.

If a positive radius is supplied, the surface will be insertedwith the normal pointing in the X direction. If the raytrace is in the X direction this will be looked at as a convexsurface. If, however, you supplied a negative value for thecurvature, the surface is automatically rotated 180°providing you with a concave surface.

Note: Supplying a negative curvature would have thesame effect as if you supplied a positive curvature and thenused AutoCAD ROTATE and rotated 180°.

Gratings must be rotated according to their blaze angle.

Page 150: RayCAD Manual

Chapter 4

144

Rotating any surface

Groove facet must face the direction of the incoming ray.

A text string is written on top of a grating indicating blazeangle. When the word blaze is able to be read, you arelooking at the front face of the grating with the arrowpointing toward the blaze direction.

An easy way to do this is to use the Display|Surflookcommand to view the grating in question head-on. The useof x y to step off the end-on view will enable you todetermine the position of your inputrays relative to thegrating. Also, the Hide command can be of help.

Example: If a ray's direction is going from left to right(positive x direction) and an echelle grating blazed at63.4349° (= atan 2) is inserted, you then have to rotate thesurface approximately -63°. This will insure the ruledfacet to be facing the incoming ray. In this configuration,the -63° counterclockwise rotation, the face of the gratingwill face up (the surface normal points in a positive ydirection). If your design requires the grating surface toface down instead of up, you CANNOT just rotate positive63° because light would be striking the wrong side of thegrooves. You will have to spin the grating 180° around itsnormal.

The UCS ENTRY command can be useful when rotating asurface. Type UCS ENTRY. Point to the surface youwant to rotate. This will cause the UCS to be set to thecoordinate for the surface. Now type UCS X or Y 90.This will turn the UCS 90° allowing rotation around the Zaxis. Then type ROTATE. Point to the surface and enterthe desired angle. Type UCS PREVIOUS twice to getback to your normal user coordinate.

At the end of the SURFace command, a block is created.

Page 151: RayCAD Manual

Commands - Surface Command

145

The index file is saved as an Attribute.

RayCAD|Surface|Catalog

Catalog gives you access to over 600 lenses (includingaspherics) that have been selected from majormanufacturer's and distributor's optical catalogs.

Using the Lens Catalog dialog box, choose themanufacturer by clicking the Browse...button. Pick acomponent and the details appear.

Page 152: RayCAD Manual

Chapter 4

146

Following is an example of a surface created from theCatalog of lenses.

Melles Griot - GLC diode CLC001 8 - 8 surfaces created.

RayCAD|Surface|Sfnumber

Non-sequential

Sequential

Choosing Sfnumber allows you to see surface labels, turnoff surface labels, swap numbers on surfaces, assign a sizefor label height and rename surfaces.

Sequence numbering is important for a sequential tracemode. The sequence is much less important in the non-sequential mode.

In non-sequential mode, it is only important that a sequenceis maintained for Beamsplitters, Fibers, and HollowWaveguides. These components must be numbered adjacentto each other.

In a sequential trace mode, a ray can enter each surface onlyonce. Surfaces must be in a sequence of blocks namedSURF-1 to SURF-nr. Empty sequence numbers are okay.

Page 153: RayCAD Manual

Commands - Surface Command

147

The sequence of surface names and locations must beadhered to and maintained. For example, a ray travelingleft to right will encounter SURF-1 first, and then SURF-2.If a mirror is encountered at SURF-3, the ray will reversedirection so that SURF-4 will have to be to the left ofSURF-3.

RayCAD|Surface|Sfnumber|Onlabel

Onlabel shows the surface label of each surface on thescreen. Also used to refresh labels.

RayCAD|Surface|Sfnumber|Offlabel

OFflabel hides all surface labels from screen and keepsthem off.

RayCAD|Surface|Sfnumber|Rename

Rename allows you to change a surface label.

RayCAD|Surface|Sfnumber|Swaplabel

If surface numbers are out of sequence, use Swaplabel.This command allows you to swap surface numbers to putthem back into the correct sequence.

Using the Surface Selection dialog box, choose one surfaceto swap then choose other surface to swap number with.

It is easy to check that surface numbers were swappedcorrectly by using Listsurf.

Page 154: RayCAD Manual

Chapter 4

148

RayCAD|Surface|Sfnumber|Close gap

Close gap automatically renumbers each surface tomaintain sequence. This is useful if you have erased asurface and want to fill the vacant place.

RayCAD|Surface|Sfnumber|Labelsize

Labelsize lets you set the label height for display in thedrawing.

Note: If a text style has been set to a height other thanzero, you will see message "Unknown command. Type ?for list of commands". At this point, type U to Undo yourlast entry. See "Appendix C - Troubleshooting".

Page 155: RayCAD Manual

Commands - Surface Command

149

RayCAD|Surface|Listsurf

Information aboutsurface.

The Listsurf command provides information about theselected surface, such as surface name, surface type,height, width, radius, etc., all of which were written intoAttributes when the surface was created.

Page 156: RayCAD Manual

Chapter 4

150

RayCAD|Surface|Editsurf

Using Editsurf allows you to change characteristics of asurface using the Surface Edit dialog box.

Selecting Surface Attributes calls up the Edit Attributesdialog box allows editing of all attributes. Each parameterhas a name, for example, "Index" "BK-7". You are free tochange the "BK-7" but not the name "Index". Also, don'tremove the mark separating fields. Caution! It may besafer to use the command relating to the item to be edited.All data can be changed using Index, Size, Thick andContour. When editing is finished, the surface is redrawnusing the new parameters.

Page 157: RayCAD Manual

Commands - Surface Command

151

Index/Defraction/Splitter… takes you through the sameprompts as when you generated the surface allowingchanges to be made. See page, SURFace|Makesurf .

Size and Contour provides you with the Contour Makerdialog box.

RayCAD|Surface|Clone

Clone allows you to easily make a duplicate of a surface.

RayCAD|Surface|Clone|Mirror a surf

RayCAD|Surface|Clone|Copy a surf

Mirror a surf and Copy a surf are different than regularAutoCAD MIRROR and COPY commands in that theMirror a surf and Copy a surf make a clone of the

Page 158: RayCAD Manual

Chapter 4

152

selected surface with it's own Sfnumber.

AutoCAD commands like MIRROR, COPY, ARRAY andOFFSETS will not clone a surface but only make a copy. Asurface multiplied using these commands will adhere toAutoCAD's standard handling of blocks. If, for example,you made five copies of a surface, then usedRayCAD|Surface| Editsurf to change one copy of the fivesurfaces, all five would be changed. All copies would havethe same name and all would be affected by renaming orsurface number swapping.

To Clone a two surface component, use Clone for eachsurface, then use Body to make 3-D.

Note: Avoid copying optical surfaces using AutoCAD'sCopy command if you are intending to optimize using thatsurface. Instead, use the Clone|Copy or Clone|Mirrorcommand. The optimization receives the name of a surface;and, since AutoCAD's Copy command names a copy of ablock the same name as the original, the optimization mayoptimize the wrong surface.

RayCAD|Surface|Redraw

Redraw can be useful to update any surface block where achange has been made. It reads all the attributes and thenredraws the surface according to the changes.

Redraw will update the surface using a current color on acurrent layer, thus enabling easy color and layer changes.

Since surfaces are made into blocks, changing the color andthe layer can be difficult. To change the color and/or layer,follow these steps:

Page 159: RayCAD Manual

Commands - Surface Command

153

From the MODIFY menu use CHANGE PROPERTIES,pick the surface to be changed and, from the dialog box,select the desired layer and color. Change the current color,i.e. COLOR Red. From RayCAD's pull-down selectSURFace|Redraw. Pick a surface or enter the surfacenumber. Surface is now redrawn with the newconfiguration.

Use Redraw any time there is a suspected discrepancybetween an attribute for a surface and the way the surfacelooks on the screen. (This will occur if you use AutoCAD'sEDIT ATTRIBUTE).

RayCAD|Surface|Deactivate

Deactivate allows you to select a surface or surfaces to beexcluded from the ray trace.

RayCAD|Surface|Activate

Activate reverses the Deactivate command and enables allsurfaces to be part of the trace.

RayCAD|Surface|Export

RayCAD|Surface|Import

The same dialog box is used for both Export and Import.

Selecting the RayCAD .SUF format reads and writes textfiles which can be created and/or edited using a text editorlike Notepad.

Selecting ZEMAX .ZMX format creates and/or writes a.ZMX file.

Page 160: RayCAD Manual

Chapter 4

154

Select the format type and direction.

ZEMAX Interface

HINTS: It is helpfulto leave ZEMAXopen in order toreference betweenRayCAD andZEMAX.

The ZEMAX Import Translation grouping is onlyactivated when selected format is ZEMAX and direction isImport. It can add diameters to surfaces and provide areview and edit of the translated surface data.

In order for a surface to exist in AutoCAD it must have adiameter. The following two check boxes are controllingan automatic diameter generation. If a surface diameter is0.0 in the .ZMX file, the following will help in automatingthe addition of diameters. You can also use the <Reviewand Edit Translation Data> button to add diameters.

When import is finished you may need to use Zoom All inorder to view all the surfaces. Sometimes a surface maybe far away and very small looking as a point.

Use Diameters from Prescription Data:If checked, the program will look for a Prescription Datafile created from ZEMAX. The file name is the same asthe current .ZMX file, except .TXT is used as the suffix.Use the ZEMAX Reports | Prescription Data menu andsave a Prescription file using the same name and directoryas current .ZMX Lens Data file. If a diameter is found inthe SURFACE DATA SUMMARY section of thePrescription file, it will be used to replace the 0 diameter.If a file of that name is not found, a file dialog boxappears. This is optional. Select a Prescription file or presscancel. Pressing cancel has the same effect as clearing tocheck mark.

Since not all surfaces can derive a diameter from thePrescription file, the following command can be useful.

Page 161: RayCAD Manual

Commands - Surface Command

155

Inherit Diameters from Prior Surface:A second pass through the surfaces is done in order toprovide a diameter to any surface still specifying a zero asthe diameter. A new diameter is adopted from the priorsurface containing a diameter.

Review and Edit Translation Data:This will list all surfaces in a row and column format andallow edit to some of the data.

If some diameters are still missing, a prompt just below theedit field reminds you which surface numbers are missinga diameter (i.e. Dia is needed for 4,6). You can supply aDia or Height and Width. If you ignore the prompt, atsurface creation time you will be prompted again and alsogiven you the option to provide the surface size bypointing. Not all Surface parameters can be modified. Forexample, to change the world coordinate use the Spacingparameter. If you change the Radius of flat surface from 0

Page 162: RayCAD Manual

Chapter 4

156

to some value, make sure to change Shape to Sphere.

Body Thickness:Single surfaces Imported from ZEMAX do not containinformation regarding the body thickness. Use the ImportEdit/Review to add thickness to a surface such as a mirror.Positive and negative thickness will determine the side ofthe surface to which the body is applied.

Header Part:Information in the .ZMX file starting from the top down towhere SURF 0 starts is remembered from the last Importand surface data from a subsequent Export is appended toit. To load the header portion only without generating anysurfaces, perform an Import and select Data preview thenOK to return to the main Import/Export dialog box andpress Cancel.

Export Option:Pressing <Pick Surfaces> allows you to select specificsurfaces to be included in the export.

Select file Name:Use the Browse button to select a file name. Dependingon the Format, the extension default to .ZMX or .SUF.

Note: Sequential vs. Non-SequentialIn most case you can trace in Sequential mode, and, in thecase where one or more surfaces is doubled up in order tobe represented in ZEMAX, you must set the trace mode toSequential. Use RayCAD | Raytrace | Options. In somecases it may be necessary to Deactivate a baffle in order tomake possible a sequential trace as in the case ofhoughton.zmx from the sample section. Use RayCAD |Surface | Deactivate to deactivate a surface.

Page 163: RayCAD Manual

Commands - Surface Command

157

Surf 0:It is recommended that the first surface, SURF 0, isdescribing an OBJ type only. SURF 0 is only generated ifit has a glass entry. When Exporting, the DISZ dimensionis loaded with the distance from inputrays starting point or0 if InpuRays are parallel.

Surface Numbering:Surfaces numbering is important since this will determinethe surface sequence in ZEMAX. Use theRayCAD|Surface|Clone|Copy commands to copy surfacesinstead of the ACAD Copy command. This assures that aunique Surface number will be assigned. The same is truefor the Clone|Mirror command.

If you have used the ACAD COPY command to copyoptical surfaces and plan to Export to ZEMAX, you maywant to use the RayCAD Clone|Copy command (for thereasons described above) and then erase the original. Ifyou place the copied surfaces on top of the original it canbe difficult to select the surface below the copy. Thefollowing helps - Use Crossing in response to SelectObject and select both surfaces. Then type R Enter and LEnter to remove the last from the selection. Press Enteragain to complete the ERASE command.

A Rectangular obscuration SQOB and Circularobscuration OBSC is modeled as separated surfaces inAutoCAD. A baffle in RayCAD, which is intended totranslate to SQOB or OBSC in ZEMAX, must be named ina special way. Append a -B to the surface name (i.e.SURF-3-B). An Export to ZEMAX will combine SURF-3and SURF-3-B to become a SQOB or OBSC. Whenimporting these surfaces from ZEMAX, the surface namegets the -B appended to it automatically.

Page 164: RayCAD Manual

Chapter 4

158

In the case of glass to glass, as in a doublet, an extrasurface is produced taking on the outline and indexinformation from the first glass and surface shape from thesecond glass. It has "-a" appended to it's name.

Tilted Surfaces:If a surface in RayCAD is flat and tilted in respect to theaxis, established by the prior surface, and the next surfacedirection does not match that of the flat in question, aTILTSURF is reported to ZEMAX. You can control thetilted conversion by placing a screen in the front or behindit, so their directing can control the conversion. Doing socauses a coordbrk to be generated using the appropriatedecanters and axis rotations. Since a tilt is determined bysurfaces in the front and back of it, a tilted surface can notbe the first or the last.

Stop Surfaces:A STOP surface having no GLAS is modeled as a Baffle.The hole diameter is DIAM*2 and the outside diameter ismade 50% larger than the hole.

COORDBRK:When importing, the Coordbrk are eliminated beforesurfaces are drawn in ACAD.

Coordinates Conversion:RayCAD X =Zemax Z , Y =Zemax Y and Z =Zemax X

If from the ACAD world view you rotate view 90 degaround the Y axis, you get the same view as if you rightclick on the ZEMAX 3d layout and enter 90 degrees in theY rotations axis.

Diameter and Curvature:If a diameter is causing the conic formula to fail, the

Page 165: RayCAD Manual

Commands - Surface Command

159

surface dialog box will appear prompting you for thecorrect diameter or radius. For example, a surface diametergreater than twice the radius of a Spherical surface willcause this action. The surface dialog box will appear at thetime of drawing the surfaces.

Shortcoming and Fixes to Come:A cylindrical surface using a round outline will be drawnas a sweep surface and appear spherical. However, theraytracing recognizes the Cylinder shape and will performaccurate traces. Making the Cylinder surfaces outlinerectangular will display correctly.

A Toroid may be modeled as a Cylinder if the radius orPARM 1 is infinity, otherwise it is modeled as a Sphere orif one of the PARM 2..6 is not zero.

The Body command does not work for surfaces containinga Decentering.

Page 166: RayCAD Manual

160

Page 167: RayCAD Manual

Helpful Hints

161

Chapter 5Helpful HintsADJUST

Q: How can I get a better view when using Adjust?

A: Adjust gives you an excellent way to study ray intersections. It allows youto look perpendicularly into a surface and take a thin slice (depth of focus)of the rays passing through this slice. In order to have a good display ofintersections, you should have many rays going through this surface. It issuggested you run RayCAD|Raytrace|Random two or three times or theRayCAD|Raytrace|Grid to give you a lot of rays to look at. You may needto set the grid spacing by using RayCAD|Raytrace|Options first. Settingthe Height to 15 and the Width to 15 for a total of 225 rays would beadequate. The Random and Grid generator fills up the opening of the firstsurface with rays and, because of that, generates a 3D ray trace. SeeFigure 25

Page 168: RayCAD Manual

Chapter 5

162

Front view of surface #6 (screen).View is clipped to a default depth of ±.05

Random Ray was run twice, creating100 rays.Adjust will be done on surface #6

Same view using ZOOM ismagnified for better viewing

Figure 25

Page 169: RayCAD Manual

Helpful Hints

163

CHANGING DRAWINGS

Q: Why do I get a strange ray trace when I go from one drawing to anotherdrawing?

A: STARTRAY.DAT files are shared by all drawings, therefore use theINPutray|Gather command when going from one drawing to another.

COLORS FOR DISTINGUISHING RAYS

Q: Does it matter whether I use color or not?

A: Make use of color selection in INPutray|Gather to distinguish betweendifferent output rays. This command allows for color association with thecurrent AutoCAD color, with input rays, with a wavelength label, with thecolors of the spectrum or cycle through AutoCAD's color numbering.

Note: The appropriate colors can be assigned to the input trays andwavelength labels using AutoCAD's CHANGE PROPERTY and should bedone prior to entering the INPutray command.

COORDINATES

Q: Why doesn't the coordinate reading on the top of the display change?

A: Many of RayCAD's commands can be input by typing, pointing ordragging. If pointing or dragging, it is best if the display is responding tothe motion of the pointer so that you can see where you are pointing to.Repeated pressing of ^D toggles the coordinate display on, off and angular.

Page 170: RayCAD Manual

Chapter 5

164

CURVATURE

Q: How can I make a curved surface negative?

A: A surface's curvature can be made negative or positive depending upon therotation. There are three ways:

1. A convex curvature is made negative (concave) by rotating the surface180°. This is done using the regular AutoCAD ROTATE command.

2. If using the contour dialog box to specify curvature, use the curve pull-down in the lower left to choose between convex and concave.

3. When making a surface, use the command line to enter a positive radiuswhich places the surface normal in the X direction (0° rotation). A negativeradius places the normal in the -X direction (180° rotation)..

Grating - Using a Grating

Q: What help can you offer on gratings?

A: When using a grating, you may want to find wavelength/order overlaps.See below:

If an input ray has a wavelength of 253.6 nm and is then traced through anechelle grating of 79 grooves/mm with a blaze angle of 63.43°, RayCADwill calculate and prompt with the appropriate order for you to use, in thiscase, the 89th order.

From a known wavelength or order, one can easily estimate where overlaps will

Page 171: RayCAD Manual

Helpful Hints

165

occur. Use one of the formulas below:

1. First, let's find the order for wavelength 555.0 nm.

To estimate an unknown order for wavelength 555.0 nm take the product ofthe known wavelength and known order, then divide by the desiredwavelength.

253.6 nm x 89 / 555.0 = 40.667 orderFractional orders must be rounded to nearest whole number.

2. To estimate an unknown wavelength for a given order, take the product ofthe known wavelength and known order, then divide by the desired order.

253.6 nm x 89 / 41 = 512.42 wavelength

INPUT RAYS - Keeping Input Rays

Q: Can I use input rays again?

A: Since all input rays are kept in a file named STARTRAY.DAT, you maywish to save a particular collection of input rays for later use.

Using the File Manager or SHELL COPY command, copySTARTRAY.DAT to MYSTART.DAT. Later on you can renameMYSTART.DAT back to STARTRAY.DAT.

COMPARING MULTIPLE OPTICAL SYSTEMS

Q: It would be useful to compare two similar optical systems. Can this bedone?

A: Use the COPY command and make 2 or more sets of your input rays. Alsogenerate additional surfaces for the extra systems. Lay them out in such away that rays do not cross into each other or place mirrors between them.Then, when gathering rays, gather all sets at one time (you can also gatherjust one set of rays at a time). This will trace all the systems when traced

Page 172: RayCAD Manual

Chapter 5

166

in non-sequential mode. It is OK to have multiple light sources.

PRISMS - Adding a Roof to a Prism

Q: How can I add a roof to a prism?

A: Use either the Plates or the Prism to generate a refractive surface. Whenrequested for second surface, just answer No. Give it a size to cover theroof. You can use the pointer in the size command. For example, toconnect 2 corners of the roof, respond to the prompt for size by typing INTfor intersection and point to an upper corner. For the prompt of NextPoint, type INT and point to the second corner. The key here is that, aslong as the index material is the same, you can combine any number ofrefractive surfaces.

RAY TRACE

Q: Why do rays pass through the outside of my aperture?

A: Use Sequential trace mode. If ray does not make it through, it is stopped.In Non-sequential mode, the ray will not make an intersection but will lookfor a surface beyond.

Q: How can I see the intersection point of a trace?

A: Just select a trace by pointing and all insertion points are indicated by asmall square (later versions of AutoCAD only). Traces are polylines.Therefore, the PEDIT EDIT VERTEX will display a cross on eachintersection as you press Next or Previous.

SAVING A DRAWING - Shared Viewing of an RayCAD Drawing

Q: How can someone look at my drawing if they don't have RayCAD?

A: You need to save your drawing with a menu other than RAY.MNU.Before saving your drawing, type on the command line MENU

Page 173: RayCAD Manual

Helpful Hints

167

ACAD.MNU. The AutoCAD menu will load. Then save the drawing. Adrawing saved in this manner can be viewed by anyone. Note: You willneed to load RAY.MNU to use this drawing with RayCAD again.

SURFACE - Inserting Surfaces

Q: How do I get back to my original set up to insert more surfaces?

A: It always pays off to organize your work before getting started by selectingthe VIEW and UCS where you will do surface insertions. If you save theVIEW and UCS by name (or stay with a World View), you can easilyrestore the original view. Thus, when adding surfaces, these new surfaceswill be oriented in the same way.

Another way is to use RayCAD's Display|Viewports or Display| SurflookTop (world) Front Left Right for a consistent way of looking at yourdesign.

Or, you could use an existing surface to set the coordinates:

Type UCS ENTRY (point to surface) <Enter>Type UCS Y -90 <Enter>Type UCS X -90 <Enter>

The coordinates are aligned so that the next insertion will line up with anexisting surface.

Page 174: RayCAD Manual

Chapter 5

168

SURFACE - Last Surface

Q: How many surfaces do I need to see a ray trace?

A: Remember to always have at least two surfaces when doing a ray trace.The last surface is not traced through, the rays are just projected onto thelast surface. It is common to use a Screen as the last surface.

SURFACE NORMAL - Using the Surface Normal

Q: What is a "Normal"?

A: Each surface has a normal which is a small line extending from the centerof the surface (also the block insertion point). This line represents thesurface normal and can be used as a reference when rotating the surface.

U for Undo

Q: Does Undo work with RayCAD?

A: AutoCAD command Undo works on all of RayCAD commands. Go aheadand do a focus and don't worry about the results - just use Undo to return tothe original layout.

You may need to use Undo more than once. Repeat Undo until you see"mark encountered".

Page 175: RayCAD Manual

Appendix

169

Appendix

A - Files for Data Transfer

B - Configuring AutoCAD for RayCAD menu

C - Troubleshooting

Page 176: RayCAD Manual

Appendix

170

APPENDIX A

Files for Data Transfer

Four files are used in data transfer between RAYW.EXE and RAYCAD.LSP.

1. STARTRAY.DAT

This data file contains records of input rays and is generated byRAYCAD.LSP. Each record contains the ray's starting point, it's direction,wavelength associated and the color of the trace. A blank file is supplied.

2. SURF.DAT

This data file contains records of surfaces and is generated byRAYCAD.LSP. Each record contains a name, location, orientation,rotation, curvature, component type (reflective, refractive, diffractive oraperture), index name and more.

Note: The number of surfaces and input rays are related in that they sharethe available memory (i.e., you may have 356 surfaces and only two inputrays or you may have 700 input rays and only three surfaces, or anycombination of the two).

3. RAY.DAT

A file that will be created by RAYW.EXE containing the calculated surfaceintersection points to be read and drawn by RAYCAD.LSP.

4. OBJECT.DAT

This contains coordinates for wire meshes if the optional Optical Object isinstalled.

Page 177: RayCAD Manual

Appendix

171

APPENDIX B

Configuring AutoCAD for RayCAD Menu

RayCAD supplies a menu file called ray.mnu. Upon initialization of RayCAD,the ray.mnu file is attached to the current menu. This way any customizationyou have is retained.

RayCAD also supplies a toolbar consisting of several fan-out toolbuttonsenabling most of RayCAD's functions.

If the toolbar shows "happy faces", it is probably due to one of two reasons:

If large buttons for your toolbar has been selected (which we do not support atthis point), please go View | Toolbars and clear the Large Buttons check mark.

AutoCAD may have lost track of toolbutton location. The best way toreestablish that connection is to provide AutoCAD with RayCAD's directorypath. Select Tools | Options and click Files tab. Select "Support File SearchPath" and click the Add button then the Browse button and locate theRayCAD6\source directory and click OK.

Page 178: RayCAD Manual

Appendix

172

APPENDIX C

Troubleshooting

There are situations where a ray trace is not possible such as when positioningand angles of components cause optical calculations to be violated (especiallywhen gratings are involved). Try using OPTimize to position and rotate yourcomponent to such a point where you get a complete trace. There are alsosituations where optimization is not possible. See Optimize, page on page 75for more information. If that does not solve the problem, check the followingfor a possible cause:

• Free Spectrum:The order for a given wavelength is calculated and prompted for each ray.Gratings can only work in a narrow range of orders per wavelength beforeviolating the grating equation.

• Gratings/Echelles:Gratings must be rotated according to their blaze angle. Groove facet mustface the direction of the incoming ray.

Example: If the ray's direction is going from left to right (positive xdirection), and an echelle grating blazed at 63.4349° (= atan 2) is inserted,you will have to rotate the surface approximately -63°. This will insure theruled facet to be facing the incoming ray. In this -63° counterclockwiserotation configuration, the face of the grating will be up (the surface normalpoints in a positive Y direction).

If your design requires the grating surface to face down instead of up:

You CANNOT just rotate positive 63° because light would be striking thewrong side of the grooves. You will have to spin the grating 180° around it'snormal. To accomplish this, set UCS to E ROTATE INS (point to surface)180.

Page 179: RayCAD Manual

Appendix

173

• Internal Reflection:TIR is a physical phenomenon which occurs when light tries to pass from adense medium to a less dense medium at too shallow an angle. This angle iscalled the critical angle and occurs around 42°. Ray trace will be completedas if it had encountered a mirror.

• Input ray Elevation:If input rays do not intersect the first optical surface, check elevation of inputrays (Z dimension). Use the RayCAD|Display|Viewports to make inspectioneasier.

• Input ray has Moved:If a input ray has moved, it must be reread by using INPutray|Gather.

• Surface/Block Missing:If a surface has been made part of another block, RayCAD will not find thatsurface.

• Surface Labels:If erroneous labels are displayed on each surface, there could be a text fontproblem. See "Unknown Command" below. Use ERASE to removeincorrect text labels afterward.

• Trace Stops Prematurely:Sequential surface numbering is important if tracing in sequential mode. UseRayCAD|Trace|Option and set the trace mode to non-sequential. Also, a raywill stop when there are no more surfaces that can be reached. Use Screensto catch any stray rays.

• "Unknown Command":This error is generated when AutoCAD does not recognize a command sentto it. Press U for Undo to restore AutoCAD to before the command causingthis error.

One of the causes can be when RayCAD requests a label height and the

Page 180: RayCAD Manual

Appendix

174

current loaded text style has been loaded with a height other than zero. To fixthis, use AutoCAD's pull-down menu under DRAW, press TEXT and selectSET STYLE. Choose the font you want and, when prompted for height enterzero, for width enter 1.00.

• Warning Message - !!! No index coefficient named <filename> was found !!!:Use Editsurf dialog box and review the index name making sure that a filewith that path and file name is on your disk.

Page 181: RayCAD Manual

Glossary

175

GlossaryAPERTURE: An opening through which light may pass. It can be used as a

field stop.

ASPHERIC: An optical surface that is not spherical. The surface deviatesfrom spherical, usually to reduce spherical aberration. Often generated bysurface of revolution about the surface normal.

ASPHERIC CONSTANT: A1, A2, A3 and A4 are the aspheric deformationconstants.

BAFFLE: An opaque shielding device designed to reduce the effect of straylight on an optical system.

BEAMSPLITTER: A device used to divide a beam into two or more separatebeams.

BLAZE: A plane that forms one side of the groove ruled on a diffractiongrating. In this way, spectral energy may be concentrated into one angularregion.

CLADDING: The low-refractive-index material that surrounds the core of anoptical fiber.

CLIP: The viewing of just a slice of the screen (same as CLIP underAutoCAD's DVIEW command).

COLLIMATE: Radiation in which every ray from any given object point canbe considered to be parallel to every other. This is hardly ever completelythe case: The light from a star is really diverging, and all collimators haveaberrations.

CONCAVE: A term describing a hollow curved surface; curved inward.

CONIC CONSTANT: K is a function of the eccentricity of a conic surface

Page 182: RayCAD Manual

Glossary

176

(K=-e2).

CONVEX: A term describing a spherical shaped surface; curved outward.

CURVATURE: A measurement of departure from a flat surface; thereciprocal of radius (1/radius).

CYLINDRICAL SURFACE: A surface formed by all the straight lines thatare parallel to a given line and that pass through a given curve which is notin the same plane as the reference line.

DIFFRACTION: As a wavefront of light passes by an opaque edge orthrough an opening, secondary weaker wavefronts are generated apparentlyoriginating at that edge. These secondary wavefronts will interfere with theprimary wavefront as well as with each other to form various diffractionpatterns.

ECHELLE: A grating that features useful efficiencies covering UV-IR in asingle grating, together with exceptionally high dispersion resulting insuperior resolution. An echelle grating often operates over hundreds oforders.

FIBER: A thin filament of drawn or extruded glass or plastic having a centralcore and a cladding of lower index material to promote internal reflection.

FIELD STOP: An aperture located at an image plane of an optical system thatdetermines the size and shape of the image.

FRESNEL: A lens resembling a plano-convex or plano-concave lens that is cutinto narrow rings and flattened out.

GRATING: A grating consists of a glass substrate with a series of parallel,equispaced lines with interstices between them on the front surface of theglass. It is used to disperse light by interference between wave trains fromthe interstices.

HOLLOW WAVEGUIDE: An infrared-transmitting optical fiber with a

Page 183: RayCAD Manual

Glossary

177

hollow core. Capable of carrying high laser power but subject to highbending losses.

INDEX OF REFRACTION: The ratio of the velocity of light in air to thevelocity of light in a refractive material for a given wavelength.

LENS: A refractive optical component consisting of two surfaces where thesurface is curved in such a way as to converge or diverge the transmittedrays from an object.

MEDIUM: Any substance or space through which electromagnetic radiationcan travel.

MIRROR: A smooth, highly polished surface, for reflecting light, that may beplane or curved. The actual reflecting surface is usually a thin coating ofsilver or aluminum on glass.

NANOMETER: A unit of length in the metric system equal to 10-9 meter.

NORMAL: A normal is illustrated by a small line through the center point onyour surface. This point is also the insertion point of the surface. The line isperpendicular to the tangent line at that point.

ORDERS: A particular wavelength will make a constructive interference at apoint in space where the difference in path length that a wavefront musttravel due to spacing between successive grating grooves that cause theinterference is a multiple of the wavelength. This multiple is called theOrder.

For example, a wavefront of a wavelength of 546 nm will appear in the 1stOrder if a total travel difference between grating grooves is 546 nm.Constructive interference will appear in the 2nd Order when travel differenceis 546 times 2 = 1092 nm.

Consequently, a coarse grating produces many orders while a fine gratingmay produce only one or two.

Page 184: RayCAD Manual

Glossary

178

PRISM: A transparent optical element having at least two faces inclinedrelative to each other, from which light is reflected or through which light isrefracted.

RAY: A geometric representation of a light path through an optical device; aline normal to the wave front indicating the direction of radiant energy flow.

REFLECTOR: A type of conducting surface or material used to reflectradiant energy. A curved reflective component that can have a hole in thecenter.

REFLECTION: Return of radiation by a surface, without change inwavelength.

REFRACTION: The bending of oblique incident rays as they pass from amedium having one refractive index into a medium with a differentrefractive index.

SCREEN: A surface, usually flat, onto which an image is projected forviewing.

SPHERICAL: Shaped like a sphere; rounded; globular.

SPOT DIAGRAM: A method of evaluating image quality whereby a largenumber of rays are traced through an optical system from a single objectpoint, and their intersections with the focal plane are plotted and analyzed.

SURFACE: One of the faces of an optical element.

TRANSMISSION GRATING: A transparent diffraction grating that serves totransmit light.

TUBE: A single surface used with other refractive surfaces to model holes orrods.

Page 185: RayCAD Manual

179

IndexActivate, 153Adjust, 161Aperture, 117, 175Aspheric, 175Aspheric Constant, 175Aspherics, 136Baffle, 117, 175Beamsplitter, 120, 175Beamsplitters, 131Blaze, 175Body command, 51Catalog lenses, 145Changing drawings, 163Cladding, 175Clip, 175Clone, 151Collimate, 175Commands, 49

Body, 51Display, 54Inputray, 60Object to Optical, 67Optimize, 75Raytrace, 99Remove, 110Surface, 112

Component thickness, 141Concave, 175Cone, 140Conic Constant, 175Conic surfaces, 137Contour, 134Convex, 176

Coordinate system, 113Coordinates, 163Curvature, 164, 176Cylinder, 140Cylindrical Surface, 176Deactivate, 153Defining second surface, 142Diffraction, 176Diffractive surfaces, 131Display command, 54

Dataprint, 56Render-Ready, 58Restore screen, 58Surflook, 55Viewports, 57

Echelle, 131, 176Editsurf, 150Ellipsoid, 140Export, 153Fiber, 120, 176Field Stop, 176Files for Data Transfer, 170Fresnel, 120, 131, 176Getting Started

Quick Start, 14Tutorial, 19

Good advice, 115Grating, 131, 164, 176Helpful Hints, 161Hollow Waveguide, 133, 176Hyperboloid, 140Import, 153Index Data, 124

Page 186: RayCAD Manual

180

Index of Refraction, 177Input Rays, 165Inputray command

Drawray, 62Gather, 64Listray, 66

Inputray Command, 60Installation, 9

First Time Installation, 9Index File Locations, 12Initialization, 10Menu Conflict, 11Troubleshooting, 12Upgrade Initialization, 11Upgrade Installation, 9

Isolating the r and K values, 138Lens, 120, 177List surface, 149Medium, 177Menu file, 171Mirror, 133, 177Nanometer, 177Normal, 177Object to Optical command, 67

3D objects, 72Assign optical properties, 68Sample drawing, 73

Optimize command, 75Adjust, 88Collimate group, 82Curvature optimizing, 85Focus group, 79Mode, 97Rotate, 94

Orders, 177Paraboloid, 140

Pass-through surfaces, 117Plates, 120Prism, 120, 166, 178Ray, 178Ray trace color, 163Ray tracing, 166Raytrace command, 99

Grid, 102Option, 103Random, 102Spot, 104Trace, 100

Redraw, 152Reflection, 178Reflective surfaces, 133Reflector, 133, 178Refraction, 178Refractive surfaces, 117, 120, 131Remove command, 110

Erase, 111Renumber, 111

Rotation, 143Screen, 117, 178Spherical, 178Spot Diagram, 178Surface, 178Surface cloning, 151Surface command, 112

Activate, 153Catalog, 145Clone, 151Deactivate, 153Editsurf, 150Export, 153Import, 153Listsurf, 149

Page 187: RayCAD Manual

181

Makesurf, 116Redraw, 152Sfnumber, 146

Surface editing, 150Surface name, 141Surface number, 146

Thickness, 141Transmission Grating, 131, 178Troubleshooting, 172Tube, 120, 178Tutorial, 19ZEMAX Interface, 154