VDRAW(nged)

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…

πŸ“… published 7.44.0, from nixpkgs unstable

🌸 NAME 🌸

Hey bestie πŸ’– welcome to VDRAW(nged), aka the BRL-CAD MGED Commands page that’s lowkey all about drawing lines and polygons (optionally with per vertex normals) in the MGED graphics display. It’s 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. Periodt. ✨


✨ SYNOPSIS ✨

vdraw {command} [args]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so 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.

All vertices in the vdraw command are in millimeters. The MGED drawing commands are represented by integers in the vdraw command. The MGED drawing commands and the integers that vdraw uses for them are:

πŸŽ€ Table 1. Drawing Commands πŸŽ€

  • RT_VLIST_LINE_MOVE β€” vdraw integer 0 β€” MGED action: begin a new line at this point.
  • RT_VLIST_LINE_DRAW β€” vdraw integer 1 β€” MGED action: draw line from previous point to this point.
  • RT_VLIST_POLY_START β€” vdraw integer 2 β€” MGED action: start polygon (argument is surface normal).
  • RT_VLIST_POLY_MOVE β€” vdraw integer 3 β€” MGED action: move to first polygon vertex.
  • RT_VLIST_POLY_DRAW β€” vdraw integer 4 β€” MGED action: subsequent polygon vertices.
  • RT_VLIST_POLY_END β€” vdraw integer 5 β€” MGED action: last polygon vertex (should be same as first).
  • RT_VLIST_POLY_VERTNORM β€” vdraw integer 6 β€” MGED action: vertex normal (for shading interpolation).

The vdraw commands are as follows:

  • open β€” with no arguments, this returns 1 if there is an open list; 0 otherwise. If an argument is supplied, a command list is opened with the provided name.
  • write β€” with arguments of i c x y z, the MGED drawing command #c is placed in the ith position of the command list with the vertex as ( x y z).
    • With arguments of next c x y z, the command is placed at the end of the list.
  • insert β€” with arguments of i c x y z, the MGED drawing command #c is inserted just before the ith position of the command list.
  • delete β€” with an integer argument of i, the ith command is deleted.
    • With an argument of last, the last command on the list is deleted.
    • With an argument of all, all the commands on the list are deleted.
  • params β€” with an argument of color rrggbb, the color of all objects on this list is set. The rrggbb is a hex number representing the color, ffffff is white, ff0000 is red, 00ff00 is green, etc.
    • With a single string argument, the name of the current list is changed.
  • read β€” with an integer argument of i, the ith command is returned.
    • With an argument of color, the current color is returned.
    • With an argument of length, the number of commands in the current list is returned.
    • With an argument of name, the name of the current command list is returned.
  • send β€” send the current command list to the MGED display manager.
  • vlist β€” with an argument of list, return a list of the names of all existing command lists.
    • With an argument of delete list_name, delete the specified command list.

All textual arguments may be abbreviated by their first letter. 🫢


πŸ”₯ EXAMPLES πŸ”₯

The eight examples show the use of the vdraw command with four different commands and various arguments to build a list of commands to draw a square.

🌈 Example 1. Open a specified list.

mged>vdraw open square

Opens a list named square.

🌈 Example 2. Set the color.

mged>vdraw params color ff00

Sets the color to green.

🌈 Example 3. Start a line at the origin.

mged>vdraw write next 0 0 0 0

Starts a line at the origin.

🌈 Example 4. Draw a line from the previous point to a specified point.

mged>vdraw write next 1 100 0 0

Draws a line from the origin to (100 0 0).

🌈 Example 5. Draw a line from the previous point to a specified point.

mged>vdraw write next 1 100 100 0

Draws a line from the previous point to (100 100 0).

🌈 Example 6. Draw a line from the previous point to a specified point.

mged>vdraw write next 1 0 100 0

Draws a line from the previous point to (0 100 0).

🌈 Example 7. Draw a line from the previous point to the origin.

mged>vdraw write next 1 0 0 0

Draws a line from the previous point to the origin.

🌈 Example 8. Send the command list to the display manager.

mged>vdraw send

Draws the square in the MGED display.


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team πŸ’œ


πŸ’€ BUG REPORTS πŸ’€

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org 🫢


Cute sign-off bestie: source/version BRL-CAD 🌈, manual page VDRAW(nged) ✨, date: not shown in the footer, so I’m not inventing one πŸ’…πŸŽ€

πŸ“¦ where this page comes from