'\" t
.\"     Title: VDRAW
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 08/28/2023
.\"    Manual: BRL-CAD MGED Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "VDRAW" "nged" "08/28/2023" "BRL\-CAD" "BRL\-CAD MGED Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
vdraw \- Allows drawing of lines and polygons (optionally with per vertex normals) in the MGED graphics display\&. It is used to build a named list of drawing commands for MGED, send the list to the MGED display, modify the list, or delete all or part of the list\&.
.SH "SYNOPSIS"
.HP \w'\fBvdraw\fR\ 'u
\fBvdraw\fR {\fIcommand\fR} [\fIargs\fR]
.SH "DESCRIPTION"
.PP
Allows drawing of lines and polygons (optionally with per vertex normals) in the MGED graphics display\&. It is used to build a named list of drawing commands for MGED, send the list to the MGED display, modify the list, or delete all or part of the list\&. All vertices in the
\fIvdraw\fR
command are in millimeters\&. The MGED drawing commands are represented by integers in the
\fIvdraw\fR
command\&. The MGED drawing commands and the integers that
\fIvdraw\fR
uses for them are:
.PP
.B Table\ \&1.\ \&Drawing Commands
.sp -1n
.TS
allbox center tab(:);
cB cB cB.
T{
MGED Drawing Command
T}:T{
Vdraw integer
T}:T{
MGED Action
T}
.T&
c c c
c c c
c c c
c c c
c c c
c c c
c c c.
T{
RT_VLIST_LINE_MOVE
T}:T{
0
T}:T{
Begin a new line at this point
T}
T{
RT_VLIST_LINE_DRAW
T}:T{
1
T}:T{
Draw line from previous point to this point
T}
T{
RT_VLIST_POLY_START
T}:T{
2
T}:T{
Start polygon (argument is surface normal)
T}
T{
RT_VLIST_POLY_MOVE
T}:T{
3
T}:T{
move to first polygon vertex
T}
T{
RT_VLIST_POLY_DRAW
T}:T{
4
T}:T{
Subsequent polygon vertices
T}
T{
RT_VLIST_POLY_END
T}:T{
5
T}:T{
Last polygon vertex (should be same as first)
T}
T{
RT_VLIST_POLY_VERTNORM
T}:T{
6
T}:T{
Vertex normal (for shading interpolation)
T}
.TE
.PP
The
\fBvdraw\fR
commands are as follows:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
open \-\- with no arguments, this returns 1 if there is a open list; 0 otherwise\&. If an argument is supplied, a command list is opened with the provided name\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
write\-\- with arguments of
\fI i c x y z\fR, the MGED drawing command
\fB#c\fR
is placed in the
\fIith\fR
position of the command list with the vertex as (\fI x y z\fR)\&.
.sp
\-\- with arguments of
\fI next c x y z\fR, the command is placed at the end of the list\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
insert \-\- with arguments of\fI i c x y z\fR, the MGED drawing command
\fI#c\fR
is inserted just before the
\fIith \fRposition of the command list\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
delete \-\- with an integer argument of i, the
\fIith\fR
command is deleted\&.
.sp
\-\- with an argument of "last," the last command on the list is deleted\&.
.sp
\-\- with an argument of "all," all the commands on the list are deleted\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
params \-\- with an argument of
\fI color rrggbb\fR, the color of all objects on this list is set\&. The
\fIrrggbb\fR
is a hex number representing the color, "ffffff" is white, "ff0000" is red, "00ff00" is green, etc\&.
.sp
\-\- with a single string argument, the name of the current list is changed\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
read \-\- with an integer argument of
\fIi\fR, the
\fIith\fR
command is returned\&.
.sp
\-\- with an argument of "color," the current color is returned\&.
.sp
\-\- with an argument of "length," the number of commands in the current list is returned\&.
.sp
\-\- with an argument of "name," the name of the current command list is returned\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
send \-\- send the current command list to the MGED display manager\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
vlist \-\- with an argument of "list," return a list of the names of all existing command lists\&.
.sp
\-\- with an argument of
\fIdelete list_name\fR, delete the specified command list\&.
.RE
.PP
All textual arguments may be abbreviated by their first letter\&.
.SH "EXAMPLES"
.PP
The eight examples show the use of the
\fBvdraw\fR
command with four different commands and various arguments to build a list of commands to draw a square\&.
.PP
\fBExample\ \&1.\ \&Open a specified list.\fR
.PP

mged>\fBvdraw open square\fR
.PP
Opens a list named
\fIsquare\fR\&.
.PP
\fBExample\ \&2.\ \&Set the color.\fR
.PP

mged>\fBvdraw params color ff00\fR
.PP
Sets the color to green\&.
.PP
\fBExample\ \&3.\ \&Start a line at the origin.\fR
.PP

mged>\fBvdraw write next 0 0 0 0\fR
.PP
Starts a line at the origin\&.
.PP
\fBExample\ \&4.\ \&Draw a line from the previous point to a specified point.\fR
.PP

mged>\fBvdraw write next 1 100 0 0\fR
.PP
Draws a line from the origin to (100 0 0)\&.
.PP
\fBExample\ \&5.\ \&Draw a line from the previous point to a specified point.\fR
.PP

mged>\fBvdraw write next 1 100 100 0\fR
.PP
Draws a line from the previous point to (100 100 0)\&.
.PP
\fBExample\ \&6.\ \&Draw a line from the previous point to a specified point.\fR
.PP

mged>\fBvdraw write next 1 0 100 0\fR
.PP
Draws a line from the previous point to (0 100 0)\&.
.PP
\fBExample\ \&7.\ \&Draw a line from the previous point to the origin.\fR
.PP

mged>\fBvdraw write next 1 0 0 0\fR
.PP
Draws a line from the previous point to the origin\&.
.PP
\fBExample\ \&8.\ \&Send the command list to the display manager.\fR
.PP

mged>\fBvdraw send\fR
.PP
Draws the square in the MGED display\&.
.SH "AUTHOR"
.PP
BRL\-CAD Team
.SH "BUG REPORTS"
.PP
Reports of bugs or problems should be submitted via electronic mail to
devs@brlcad\&.org
