Drawing Locations, Lines and Polygons

In some cases it may be useful to simply draw a location, line or polygon to the screen to help visualize some aspect of the model. Locations, Lines and polygons are not geometry or mesh entities and are only visible until a refresh or display command is issued.

Drawing Locations

Draw Location {options}... [color <color_name>][no_flush]

A single point or series of points may be drawn to the graphics window using this command. Any number of locations may be specified that will be drawn to the graphics window as single points. Options for specifying a location are described in the section Specifying a Location. The optional color argument allows for a custom color to be used. The available color definitions are located in the appendix. Other options for drawing locations and directions are also available dscribed in the section Drawing a Location, Direction, or Axis.

Drawing Lines

Draw Line Location {options} Location {options} ... [color <color_name>][no_flush]

A straight line or series of segments may be drawn to the graphics window using this command. Any number of locations may be specified that will be connected with a line. Options for specifying a location are described in the section Specifying a Location. The optional color argument allows for a custom color to be used. The available color definitions are located in the appendix.

Drawing Polygons

Draw Polygon Location {options} Location {options} Location {options} ... [color <color_name>][no_flush]

A filled polygon may be drawn to the graphics window using this command. Any number of locations may be specified as vertices. At least three locations must be specified. Locations for vertices can be described using any of the standard location options described in Specifying a Location. The optional color argument allows for a custom color to be used for the fill. The available color definitions are located in the appendix.

Buffered Drawing

The optional no_flush argument for both the draw location, draw line and draw polygon commands may also be used when many simultaneous draw commands are being issued. This prevents the graphics from being drawn after each command is issued, which can be very inefficient. Instead the draw commands are buffered and sent all at once to be drawn. The following command:

graphics flush
can be used to force a draw following a series of commands that use the no_flush option.

Example

The following is a simple example that will draw the figure below using cubit commands

draw polygon location pos -1 -1 0 location pos 1 -1 0 location pos 1 1 0 location pos -1 1 0 color yellow no_flush
draw line location pos -1 0 0 location pos 1 0 0 color blue no_flush
draw line location pos 0 -1 0 location pos 0 1 0 color blue no_flush
draw location pos 0 0 0 color red no_flush
graphics flush
drawing example