|
|
When your geometry is very complicated, or your ray trace causes confusion in your cohorts, it may be possible to clarify yourself using text labels in ASAP®.
Text labels are created using an often-missed command argument, TEXT, in any of your common PLOT commands. Let's look at a script example.
!! PLOT ... TEXT example
!! Try this!
SYSTEM NEW
SURFACE
PLANE Z 0 RECT 9 9
OBJECT 'SQUARE_PLANE'
WINDOW Y -2@12 X -2@12
PLOT FACETS 3 3 0 TEXT
-8 10 0, 2 0 0, 0 2 0, 2, 'A square'
RETURN
$VIEW
!! end of script example
Here we make a PLANE, so we have something to plot. We set the window to show the plane, then do a PLOT FACETS to show this in a Plot Viewer window. However, a TEXT argument has been added to the PLOT FACETS command. The line following that, with the string of numbers and a quoted string at the end, tells the Plot Viewer what text to show, how big to make it, and where to start.
The first three numbers are the (X, Y, Z) location where the text writing starts. Thus we start writing text, in this case, at the point (X, Y, Z) = (-8, 10, 0).
The next three numbers are an (X, Y, Z) vector for the text character spacing. So the spacing here is 2 units along the X direction, with none in the Y or Z direction.
The third set of three numbers are an (X, Y, Z) vector for the text character height. So the height here is 2 units along the Y direction, with no height component in the X or Z direction.
The last number, here a 2, is the ASAP color number for the text, in this case the color 2, red.
Finally, the text string to write, 'A square', appears in single quotes.
Note that commas were used to show the grouping of the parts of the argument outlined here. These are not required, but they make it easier to verify your inputs in a glance.
The result is text that not only shows in the 2D Plot Viewer, but also in the 3D Viewer. This is why the XYZ location, spacing, and size must be provided, and it makes it possible to label 3-dimensional items in meaningful ways, regardless of their orientation. This is great for demonstrating your work to others and helping them to get oriented to it quickly.
There are examples in the ASAP example script to illustrate this. You may want to play with these example scripts: PLOT_TEXT01.INR, PLOT_TEXT02.INR, PLOT_TEXT03.INR, SPOTS_POS01.INR, and OPTICAL_ACTIVITY.INR to get an idea of how you could use this to your advantage. Note that this option applies to many plot commands, and not just to PLOT FACETS. Use your imagination, and you'll find many places where this will be useful.
该贴已经同步到 asdoptics的微博 |
|