grvecs
(grvecs vector_list [matrix])
The grvecs function lets you draw one or more vectors in the current viewport of the active drawing. The vectors are temporary and disappear with any command that refreshes the current viewport. The vectors can be displayed in any of the 255 system colors, and can be highlighted or drawn in XOR color.
Arguments
vector_list
The argument vector_list contains one or more pairs of a real number defining a color number and two point lists defining the start and end point of the vector to be drawn.
The format of the argument vector_list is as follows:
([color1] from_point_1 to_point_1
[color2] from_point_2 to_point_2
...
)
A pair of point lists, from_point_n and to_point_n, determine the end points by vector coordinates of the current CCS. These points can be defined in two dimensions or three dimensions. The points must be passed two by two for the grvecs function to be processed successfully. The value that defines the color is valid for succeeding vectors, as long as no other color is defined in subsequent parameters within the vector list.
Color |
Meaning |
-1 |
Vector is highlighted |
0 - 255 |
Standard colors |
256 |
Vector is drawn in XOR ink |
If the integer value specified for color is less than 0, the vector is highlighted.
If the integer value specified for color is greater than 255, the vectors are drawn in XOR ink. XOR ink complements anything it draws over.
matrix
The argument matrix is a 4x4 transformation matrix that transforms the vectors before they are displayed.
The argument allows manipulation of the location and the proportion of the vectors defined in the vector list. The matrix is a list that contains four additional lists that are composed of real numbers.
Return Value
The function always returns nil (indicating that it has been processed successfully).
Note: If the vectors exceed the current display, they are clipped.
The expession
(grvecs '( 1 (1.0 1.0) (1.0 6.0)))
draws a vertical red vector from 1,1 to 1,6 in the graphics area.
The expession
(grvecs '( -1 (1.0 1.0) (1.0 6.0)))
draws a highlighted vector from 1,1 to 1,6 in the graphics area.
The following expression draws five lines in different colors in the current viewport:
(grvecs '(1 (1 2)(1 5) draws a red (1) line from 1,2 to 1,5
2 (2 2)(2 5) draws a yellow (2) line from 2,2 to 2,5
3 (3 2)(3 5) draws a green (3) line from 3,2 to 3,5
4 (4 2)(4 5) draws a cyan (4) line from 4,2 to 4,5
5 (5 2)(5 5) draws a blue (5) line from 5,2 to 5,5
))
The matrix below represents a uniform scaling of 1.0 and a parallel displacement of 3.0,3.0,0.0.
'((1.0 0.0 0.0 3.0)
(0.0 1.0 0.0 3.0)
(0.0 0.0 1.0 0.0)
(0.0 0.0 0.0 1.0)
)
grdraw, grread
grdraw draws a single vector in the graphics area