On this page:
3.4.1 Command Line View Navigation:   Zoom, Pan and Rotate
3.4.2 Mouse Based View Navigation:   Zoom, Pan and Rotate
3.4.3 Updating the Display
3.4.4 Graphics Modes
3.4.5 Drawing, Locating, and Highlighting Entities
3.4.6 Graphics Clipping Plane
3.4.7 Colors
3.4.8 Drawing Locations, Lines and Polygons
3.4.9 Entity Labels
3.4.10 Graphics Camera
3.4.11 Graphics Window Size and Position
3.4.12 Hardcopy Output
3.4.13 Graphics Lighting Model
3.4.14 Mesh Visualization
3.4.15 Miscellaneous Graphics Options
3.4.16 Saving Graphics Views
3.4.17 Geometry and Mesh Entity Visibility
2021.11

3.4 Graphics Window Control

The graphics display windows present a graphical representation of the geometry and/or the mesh. The quality and speed of rendering the graphics, the visibility, location and orientation of objects in the window, and the labeling of entities, among other things, can all be controlled by the user. Unless the -nographics option was entered on the command line, a graphics window with a black background and an axis triad will appear when Cubit is first launched. The geometry and mesh will appear in this window, and can be viewed from various camera positions and drawn in various modes (wire frame, hidden line, smooth shade, etc.). This section will discuss methods for manipulating the graphics with the mouse and for controlling the appearance of entities drawn in the graphics window. Graphics in Cubit operates on the principle of a "display list", which keeps track of various entities known to the graphics. All geometry and mesh objects created in Cubit are put into the display list automatically. The visibility and various other attributes of entities in the display list can be controlled individually. In addition, Cubit can also optionally display entities in a temporary mode, independent of their visibility in the display list. Drawing of items in temporary mode can be combined with the display list to customize the appearance. The overall display is controlled by various attributes like graphics mode, camera position, and lighting, to further enhance the graphics functionality.

3.4.1 Command Line View Navigation: Zoom, Pan and Rotate

Commands used to affect camera position or other functions are listed below. All rotation, panning, and zooming operations can include the animation steps qualifier, makes the image pass smoothly through the total transformation. Animation also allows the user to see how a transformation command arrives at its destination by showing the intermediate positions.

3.4.1.1 Rotation

rotate <degrees> about [screen | camera | world] {X | Y | Z} [animation steps <number_steps>]

Rotation of the view can be specified by an angle about an axis in model coordinates, about the camera’s "at" point, or about the camera itself. Additionally rotations can be specified about any general axis by specifying start and end points to define the general vector. The right hand rule is used in all rotations. Plain degree rotations are in the Screen coordinate system by default, which is centered on the camera’s at point. The camera keyword causes the camera to rotate about itself (the camera’s From point). The world keyword causes the rotation to occur about the model’s coordinate system. Rotations can also be performed about the line joining the two end vertices of a curve in the model, or a line connecting two vertices in the model.

3.4.1.2 Panning

pan [{left|right} <factor1>] [{Up|Down} <factor2>] [Screen | World ] [animation steps <number_steps>]

Panning causes the camera to be moved up, down, left, or right. In terms of camera attributes, the from point and at point are translated equal distances and directions, while the perspective angle and up vector remain unchanged. The scene can also be panned by a factor of the graphics window size. Screen and World indicate which coordinate system <factor> is in. If screen is indicated (the default), <factor> is in screen coordinates, in which the width of the screen is one unit. If world is indicated, <factor> is expressed in the model units.

3.4.1.3 Zooming

zoom screen <factor> [animation steps <number_steps>]

zoom screen will move the camera <factor> times closer to its focal point. The result is that objects on the focal plane will appear <factor> times larger. Zooming on a specific portion of the screen is accomplished by specifying the zoom area in screen coordinates; for example, zoom 0 .25 .25 will zoom in on the bottom left quarter of the screen. Zooming on a particular entity in the model is accomplished by specifying the entity type and ID after entering zoom. The image will be adjusted to fit bounding box of the specified entity into the graphics window, and the specified entity will be highlighted. You can specify a final direction to look at when zooming by using the direction option. To center the view on all visible entities, use the zoom reset command. The GUI tool bar buttons for controlling zoom in, zoom out, and zoom reset are as follows:

Figure 62:

3.4.2 Mouse Based View Navigation: Zoom, Pan and Rotate

The mouse can be used to navigate through the scene using various view transformations. These transformations are accomplished by clicking a mouse button in the graphics window and dragging, sometimes while holding a modifier key such as Shift or Control. When run with graphics on, Cubit is always in mouse mode; that is, mouse-based transformations are always available, without needing to enter a Cubit command. Mouse-based view transformations are accomplished by placing the pointer in the graphics window and then either holding down a mouse button and dragging, or by clicking on a location in the graphics window. Some functions also require one or more modifier keys to be held down; the modifier keys used in Cubit are Shift and Control

Each of the available view transformations has a default binding to a mouse button-modifier key combination. This binding can be changed by the user if desired. Transformations and button mappings are summarized in the following table.

These settings are applicable only to the UNIX command line version of Cubit. For a description of the Graphical User Interface Mouse Operations see GUI View Navigation.

The bindings are based on the following mouse button definitions:

Figure 63:

Figure 1. Default Mouse Function Mappings for the Command Line

Table 1. Mouse Function Bindings for Zoom, Pan, and Rotate

Function

Description

Binding

Rotate

Rotates the scene about the camera axis. Dragging the mouse near the center of the graphics window will rotate the camera’s X- or Y-axis; dragging near the edge of the window will rotate about the Z-axis (i.e. about the camera’s line of sight). Type a u in the graphics window to see the dividing line between the two types of rotation.

B1

Zoom

Zooms the scene in or out by clicking the mouse in the graphics window and dragging up or down. If the mouse has a wheel, the wheel will also zoom.

B2

Pan

"Drags" the scene around with the mouse

B3

Navigational Zoom

Zooms the scene by moving both the camera and its focal point forward.

shift_key.gif B2

Telephoto Zoom

Zooms the scene by decreasing the field of view.

shift_key.gif control_key.gif B2

Pan Cursor

Click on new center of view

shift_key.gif B3

3.4.2.1 Changing the View Transformation Button Bindings

The default mapping of functions to mouse buttons, described in the Default Mouse Function Mappings table above, can be modified. There are two ways to assign a function to a button/modifier combination. First, you can use the command

Mouse Function <function_id> Button <1|2|3> [Shift][Control]

Type help mouse function to see a list of function IDs that may be used in this command. Second, you can assign functions interactively. To do so, first put the pointer into a graphics window and then hit the F key. On-screen instructions will lead you through the rest of the process. The GUI Options panel for managing the mouse bindings can be found at Tools/Options/Mouse, and is as follows:

Figure 64:

3.4.2.2 Saving and Restoring Views

After performing view transformations, it may be useful to return to a previous view. A view is restored by setting the graphics camera attributes to a given set of values. The following keys, pressed while the pointer is in the graphics window, provide this capability:

V - Restores the view as it was the last time Display was entered.

F1 to F12 - These function keys represent 12 saved views. To save a view, hold down the Control key while pressing the function key. To restore that view later, press the same function key without the Control key.

In the Graphical User Interface version the F1, F2 and F3 keys are used as an alternate form of dynamic viewing, therefore the ability to save views is not currently supported in the GUI.

You can also save a view by entering the command

view save [position <1-12>] [window <window_id>]

The current view parameters will be stored in the specified position. If no position is specified, the view can be restored by pressing V in the graphics window. If a position is specified, the view can be restored with the command

view restore position <1-12> [window <window_id>]

These commands are useful in as entries in a .Cubit startup file. For example, to always have F1 refer to a front view of the model, the following commands could be entered into a .Cubit file:

from 0 1 at 0 up 0 1 0 graphics autocenter on view save position 1

The first three commands set the orientation of the camera. The fourth command ensures that the model will be centered each time the view is restored. The final command saves the view parameters in position 1. The view can be restored by pressing F1 while the cursor is in a graphics window. Additionally, you can change the ’gain’ on the mouse movements by changing the mouse gain setting, via the command:

mouse gain <value>

where a value of 3 would be 3X as sensitive to mouse movements, and a value of 0.5 would be half as sensitive.

set reversezoom {on|off}

Another user preference, the direction of ’zooming’ obtained by using the mouse can be ’flipped’, by toggling the reversezoom setting.

3.4.3 Updating the Display

Among the most common graphics-related commands is:

display

This command clears all highlighting and temporary drawing, and then redraws the model according to the current graphics settings. The GUI tool bar button for executing this command is:

Two related commands are:

graphics flush

graphics clear

graphics flush redraws the graphics without clearing highlighting or temporary drawing. graphics flush is useful when a previously executed command modified the graphics and didn’t update the screen and the user wishes to update the display. The graphics clear command clears the graphics window without redrawing the scene, leaving the window blank.

Although most changes to the model are immediately reflected in the graphics display, some are not (for graphics efficiency). Typing display will update the display after such commands. Ctrl-R will also update the display as long as the mouse is in the graphics window.

3.4.3.1 Prevent Graphics From Updating

For especially large models, it may take excessively long to update the display after an action has been performed. To prevent the graphics from automatically updating, use the following command:

graphics pause

This command prevents the graphics window from being updated until the next time the display command is issued.

The plot command is synonymous to the display command, and either can be used with identical results.

3.4.4 Graphics Modes

By default, the scene is viewed as a smoothshaded model. That is, only curves and edges are drawn, and surfaces are transparent. Surfaces can be drawn differently by changing the graphics mode:

Graphics Mode {Wireframe | Hiddenline | Smoothshade | Transparent } [Geometry | Mesh]

The GUI tool bar buttons for manipulating the graphics modes are as follows:

Figure 65:

Examples and a brief description of each mode are shown below

WireFrame - Surfaces are invisible. (This mode can also be accessed by typing ’wireframe’ at the command prompt.)

HiddenLine - Surfaces are not drawn, but they obscure what is behind them, giving a more realistic representation of the view. (This mode can also be accessed by typing ’hiddenline’ at the command prompt.)

SmoothShade - Surfaces are filled and shaded. Shaded colors are interpolated across the entire surface using the graphics lighting model. This produces the most realistic results. (This mode can also be accessed by typing ’shaded’ at the command prompt.)

Transparent - Renders surfaces as semi-transparent shaded images, allowing objects to shine-through from behind. Is not supported on all platforms, and generally requires advanced graphics hardware. (This mode can also be accessed by typing ’transparent’ at the command prompt.)

This determines what pattern is used to draw lines behind surfaces (e.g. dotted, dashed, etc.; click here for a list of valid line patterns).

3.4.4.1 Displaying Using the Element Facets

There is another option that is similar to a graphics mode, set with the command

graphics use facets [on|off]

This command determines how shaded and filled surfaces are drawn when they are meshed. If Graphics Use Facets is on, the mesh facets (element faces) are used to render the model. This is particularly helpful for curved surfaces which may cut through some of the mesh faces. A comparison of graphics facets on and off is shown below.

Figure 66: A meshed cylinder shown with graphics facets off (left) and graphics facets on (right); note how geometry facets on the curved surface obscure mesh edges when facets are off.

3.4.4.2 Displaying Composite Surface Lines

Composite surfaces are surfaces that have been joined together using virtual geometry. By default, the underlying surfaces are marked with dashed lines. To toggle this setting so that underlying surfaces are not shown, use the following command:

graphics composite {on|off}

Figure 67: A part shown with (a) composite surfaces displayed (b) composite surfaces not displayed

The GUI tool bar button for toggling the display of graphics composites is as follows:

Figure 68:

3.4.5 Drawing, Locating, and Highlighting Entities

In order to effectively visualize the model, it is often necessary to draw an entity by itself, or several entities as a group. This is easily done with the command

Draw {Entity specification} [Color <color_spec>] [Zoom] [Add]

where Entity specification is an entity list as described in Command Line Entity Specification. This command clears the display before drawing the specified entity or entities. Specification of a color will draw those entities in that color. This will not permanently change the color of the entity. The zoom option will zoom in on the selected entities after drawing them in the graphics window. If the add option is specified, the display is not cleared, and the given entity is added to what is already drawn on the screen. The entities specified in this command are drawn regardless of their visibility setting (see Geometry and Mesh Entity Visibility for more details about visibility).

Entities may also be drawn by selecting them with the mouse and then typing Ctrl-D while the mouse is in the graphics window. This will clear the screen and then draw only those entities that are currently selected.

Entities can be highlighted using the command

highlight {entity specification}

This command highlights the specified entities in the current display with the current highlight color. Highlighting can be removed using the command

graphics clear highlight

To return to the normal display of the entire model, type display.

The locate command will label and point to the specified entity or location in the graphics window. The command syntax is:

locate <entity_list> locate <location options>

For example, suppose you have an idless reference to a curve of:

curve ( at 5 5 0 ordinal 1 )

You can find the curve with the following command:

locate location 5 5 0

Additionally, the visibility of individual entities, or sets of entities, can be controlled with the following visibility commands.

{Vertex|Curve|Surface|Volume|Body|Group} <range> [Geometry|Mesh] Visibility {on|off}

3.4.5.1 Drawing Other Objects

In addition to the common geometry, mesh and genesis entities, other objects may be drawn with variations of the Draw command. As with the other Draw commands, typing Display after drawing these objects will restore the scene to its normal display.

3.4.5.1.1 Displaying Entity Orientation

The normal to one or more surfaces, mesh faces, or mesh triangles may be drawn with the command

draw {surface | face | Tri} <id_range> normal [Length <length>] [face | tri] color <color> [add]

Surface normal command colors the surfaces using two different colors. The surface exposed to the positive half space (i.e, along the direction of normal), will always be colored black. The surace exposed to the negative half space will be colored using the specified <color>.

If the Face or Tri qualifier is included in the Draw Normal command, the normals for all faces or tris that belong to the specified surface are drawn.

Arrow representing the normal will be displayed if "Length" is specified.

Figure 69:

The forward, or tangent, direction of a curve can be drawn with the command:

draw curve <id_range> tangent [length <length>][color <color_spec>]

If a color is not specified, the tangent is drawn in the same color as the curve.

3.4.5.1.2 Volume Sources and Targets

Once the source and target surfaces have been set on a volume that will be meshed with the sweep algorithm, the source and target may be visually identified with the command

draw volume <volume_id_range> [source][target] [length <size>]

If the Source keyword is included, the normal of the source surface or surfaces will be drawn in green into the specified volume. If the Target keyword is included, the normal of the target surface or surfaces will be drawn in red into the specified volume.

3.4.5.1.3 Model Axis

The model axis may be drawn with the command

draw axis [length <length>]

The axis is drawn as three lines beginning at the model origin, one line in each of the three coordinate directions. The length of those lines is determined by the length parameter, which defaults to 1.

3.4.5.1.4 Surface Isoparameter Lines

Isoparameter lines may be drawn on surfaces in the model using the command

draw surface <surface_id_range> isoparametric [number <number>| [u <number>] [v <number>]]

If you specify the Number of lines, then the number of u- and v-parameter lines will be equal. You may specify instead a number of lines for each of the u and v parameters. The u-parameter lines will be drawn in red and the v-parameter lines will be drawn in blue.

3.4.5.1.5 Surface Overlap

The overlapping regions between two surfaces may be drawn with the command

draw surface <id> <id>overlap [add]

This command will draw the curves of each of the surfaces in green, and the portion of the surfaces that overlap in red. The Add keyword will draw the overlapping surfaces on top of the current graphics display. Without the Add keyword, the display will only show the specified surfaces and their overlapping regions.

3.4.5.1.6 Volume Overlap

The overlapping region between two volumes may be drawn with the command

draw volume <id> <id> overlap [add]

This command will draw the input volumes in transparent mode and draw the volume(s) of intersection as red, shaded solids. The add keyword will draw the results on top of the current graphics display. Without the add keyword, the display will only show the specified volumes along with the intersection volume(s).

3.4.5.1.7 Geometry Preview

Several options are available for previewing geometry without actually generating it. This is typically used in conjunction with webcutting and surface creation. The following Draw commands can be used for previewing geometry:

Draw Location On Curve

Draw Location

Draw Direction

Draw Line

Draw Polygon

Draw Axis

Draw Plane

Draw Cylinder

3.4.6 Graphics Clipping Plane

The graphics clipping plane feature allows the user to temporarily cut parts of the model away to help visualize the interior of a geometry or mesh. The command syntax is:

graphics clip {on|off} [ plane <plane> | [location <location>] [direction <direction>]]

graphics clip manipulation {on|off}

The GUI tool bar buttons to enable and manipulate the Graphics Clipping Plane are shown below:

Figure 70:

The first command activates the graphics clip manipulation tools in the graphics window. The keyboard shortcut "Shift-S" while the graphics window is active will also activate the clipping plane. The manipulation of the clipping plane is controlled as follows:

Figure 71: Graphics Clipping Plane

The second command turns on/off the visibility of manipulation widget in the graphics window. The clipping plane is still active, but the controls are hidden. The normal mouse-based view navigation controls apply.

3.4.6.1 Examples

brick x 10 sphere rad 1 graphics clip on location -2 0 0 rotate -45 about y #shows the sphere inside the brick

brick x 10 cylinder rad 2 z 12 subtract 2 from 1 mesh vol 1 quality vol 1 draw mesh graphics clip on #shows the mesh quality on interior elements

Figure 72: Viewing mesh quality of interior elements

3.4.7 Colors
3.4.7.1 Specifying Colors in Commands

There are five ways to refer to a color in a command. They are

  1. <color_name>

  2. user "name"

  3. ID <id>

  4. default

  5. highlight

The first option uses the name of a pre-defined color as listed in the Available Colors Appendix. This option may not be used for user-defined colors. An example of a pre-defined color assignment is given below:

color volume 1 lightblue

The second option is used with user-defined colors only. Include the name of the user-defined color in quotes. Pre-defined colors will not work with this command.

color volume 1 user "mycolor"

The third option allows you to identify a pre-defined color by its ID. The color IDs are also listed in the Available Colors appendix. This option is rarely used.

color volume 1 id 5

The default option is used to set an entity’s color to its default value. The default color may also be specified in drawing commands, but the command’s behavior will be the same as if the color option had not been included at all.

color volume 1 default

The fifth option refers to the current highlight color.

draw curve 1 tangent color highlight

3.4.7.2 User-Defined Colors

Cubit has a palette of 85 pre-defined colors, listed in the Appendix under Available Colors. Users may also define their own colors in addition to those defined by Cubit. Each color is defined by a name and by its RGB components, which range from 0 to 1. To define an additional color, use either of the commands

color define "<name>" RGB <r g b>

color define "<name>" r <r> g <g b <b>

A maximum of 15 user-defined colors may be stored at one time, so it may be necessary to clear a color definition. This is done with the command

color release "<color_name>"

Color names can be listed with the command

help color

They are also listed in the appendix of this manual, along with their RGB definitions. To view a chart of color names and IDs, including those for user-defined colors, use the command

draw colortable

3.4.7.3 Assigning Colors

Colors may be assigned to all geometric entities, and to some other objects as well. To assign a color to an entity or other object, use one of the following commands.

color axis labels {<color_name>| id <color_id>}

color axis labels {<color_name>| id <color_id>}color axis labels {<color_name>| id <color_id>}

Color Block <block_id_range>{<color_name> | id <color_id>}color axis labels {<color_name>| id <color_id>}

Color Body <body_id_range> [Geometry|Mesh] {<color_name>| id <color_id> | Default}

Color Curve <curve_id_range> [Geometry|Mesh] {<color_name>| id <color_id> | Default}

Color Highlight {<color_name>| id <color_id>}

Color Lines <color_name>

Color NodeSet <id_range> { <color_name> | id <color_id> | Default }

Color SideSet <id_range>{ <color_name> | id <color_id> | Default }

Color Surface <surface_id_range> [Geometry|Mesh] {<color_name>|Default}

Color Title {<color_name>|id <color_id>}

Color Volume <volume_id_range> [Geometry|Mesh] {<color_name>| id <color_id> | Default}

Color Group <group_id_range> expand [Geometry|Mesh] {color_name> | id <color_id> | Default}

The use of the ’expand’ keyword for coloring groups. Expanding the group will result in colors applied to each individual member of the group.

Including the Mesh keyword will change the color of the mesh belonging to the specified entity, without changing the color of the entity geometry itself. Conversely, including the Geometry keyword will change the geometry color without changing the mesh color. Including both keywords is identical to including neither keyword.

Colors are inherited by child entities. If you explicitly set the color for a volume, for example, all of its surfaces will also be drawn in that color. Once you assign a color to an entity, however, it will remain that color and will no longer follow color changes to parent entities. To make an entity follow the color of its parent after having explicitly set another color, use Default as the color name in the color command.

Colors can also be assigned to nodesets, sidesets, and element blocks. These colors do not take effect, however, unless the nodeset, sideset, or element block is drawn with a Draw command.

The background color and the color used to draw highlighted entities can be changed to any color.

By default, the axes are labeled with a white X, Y, and Z, indicating the three primary coordinate directions. If the background is changed to white, these labels are impossible to read; the color used to draw axis labels can be changed to any color. Changing the axis label color will change the text color for both the model axis and the triad (corner axis).

When several entity types are labeled, it can become difficult to determine which labels apply to which entities. To help distinguish which entities are being referred to by the labels, you may want to change the color of labels for specific entity types.

When a meshed surface is drawn in a shaded graphics mode, the mesh edges are not drawn in the same color as the surface. This is to prevent confusion between mesh edges and geometric curves, and to make the mesh edges more visible. The color used to draw mesh edges in this situation is known as the line color, and is gray by default; this color can be changed to any color.

3.4.7.4 Assigning Global Colors

Colors may be assigned globally also. To assign a global color, use one of the following commands. Global color assignment is useful if one desires all entities to appear the same.

color global {<color_name>| id <color_id> | default}

Color Global Surface {<color_name>| id <color_id> | default} Curve {<color_name>| id <color_id> | default} Vertex {<color_name>| id <color_id> | default}

The first command assigns the desired color to all geometry entities. The color may be enter by color name or color id. The default option resets colors to the default value.

The second command assigns the desired colors to surfaces, curves and vertices. All three value must be entered. For example, users my select global colors for surface and vertex and specify that curves have default colors.

3.4.8 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.

3.4.8.1 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.

3.4.8.2 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.

3.4.8.3 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.

3.4.8.4 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.

3.4.8.5 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

Figure 73: drawing example

3.4.9 Entity Labels

Most entities may be labeled with text that is drawn at the centroid of the entity. Mesh entities can be labeled with their ID number or their Element ID. Element ID labels are only valid after putting the mesh entities into a block.

Geometric entities can be labeled with their ID number or with other information.

Labels for groups of entity types can be turned on or off.

The following commands will accomplish this.

Label [On|Off|Name [Only|ID]|ID|Interval|Size|Merge|Firmness]

Label All [On|Off|Name [Only|ID]|ID|Interval|Size|Merge|Firmness]

Label Body [On|Off| Name [Only|ID] |ID|Interval|Size| Merge |Firmness]

Label Curve [On|Off|Name [Only|ID] |ID| Interval| Size| Merge| Firmness]

Label {Hex|Tet|Face|Tri|Edge} [On|Off|ElementId]

Label Element [On|Off]

Label Geometry [On|Off|Name [Only|ID] |ID| Interval| Size| Merge| Firmness]

Label Mesh [On|Off]

Label Node [On|Off|ElementId|SphereId]

Label Surface [On|Off|Name [Only|ID] |ID| Interval| Scheme| Size| Merge| Firmness]

Label Vertex [On|Off|Name [Only|ID] |ID|Interval| Size| Merge| Firmness]

Label Volume [On|Off|Name [Only|ID] |ID |Interval| Size |Scheme |Merge |Firmness]

The meaning of each of each label type is listed below. Note that some label types don’t make sense for every entity type.

On - The same as IDs.

Name - Name of the entity, if the entity has been named. Default name otherwise.

Name Only - If the entity has been named, use the name as the label. Otherwise, don’t use a label.

Name IDs - If the entity has been named, use the name as the label. Otherwise, use the ID as the label.

Interval - The number of intervals set on the entity.

Firmness - Same as interval, but followed by a letter indicating the firmness of the interval setting (see the Mesh Generation chapter for description of firmness settings.)

Merge - Whether or not the entity is mergeable. Note that this is sometimes not clear, because, for example, a curve may show that it isn’t mergeable because one of its owning surfaces may be unmergeable, while another owning surface may be mergeable.

Size - The mesh size set on this entity.

ElementId - The Global Element Id of each element. Will only be labeled for hexes, tets, tris, etc. which are in a block.

SphereId - The id of the sphere element associated with this node, if there is one. A sphere element is only associated with a node if the node (or it’s geometry owner) is put into a block.

Three dimensional entity types such as body will have their labels displayed in the center of the entity. Thus, in the smooth shade and hidden line graphics modes the labels will be hidden.

The GUI includes command panels to manipulate the labels settings for any given entity type. The command panel for the Volumes labels settings is shown below as an example:

Figure 74:

3.4.10 Graphics Camera

One way to change what is visible in the graphics window is to manipulate the camera used to generate the scene. A scene camera has attributes described below, and depicted graphically in Figure 75. The values of these camera attributes determine how the scene appears in the graphics window. These view settings may be accessed in the GUI via the Display/View Point menu.

Position (From) - The location of the camera in model coordinates.

View Direction (At) - The focal point of the camera in model coordinates.

Up Direction (Up) - The point indicating the direction to which the top of the camera is pointing. The Up point determines how the camera is rotated about its line of sight.

Projection - Determines how the three-dimensional model is mapped to the two-dimensional graphics window.

Perspective Angle - Twice the angle between the line of sight and the edge of the visible portion of the scene.

camera.gif

Figure 75: Schematic of From, At, Up, and Perspective Angle

The camera can be moved to one of several predefined orientations using the command

View {Front | Back | Top | Bottom | Right | Left | Iso}

At any time, the camera can be moved back to its original position and view using the command

view reset

To see the current settings of these attributes, use the command

list view

The current value of the view attributes will be printed to the terminal window, along with other useful view information such as the current graphics mode and the width of the current scene in model coordinates.

Camera Attributes can be changed using the Rotate, Zoom and Pan commands, or directly as follows.

3.4.10.1 Changing Camera Attributes Directly

Camera attributes are most easily modified using interactive mouse manipulation (see Mouse-Based View Navigation) or using the rotate, pan and zoom commands. However, the camera attributes can also be modified directly with the following commands:

from <x y z>

at <x y z>

at {body|volume|surface|curve|vertex|hex|tet|wedge|tri|face|node}<id_list>

up <x y z>

graphics perspective <on|off>

graphics perspective angle <degrees>

If graphics perspective is on, a perspective projection is used; if graphics perspective is off, an orthographic projection is used. With a perspective projection, the scene is drawn as it would look to a real camera. This gives a three-dimensional sense of depth, but causes most parallel lines to be drawn non-parallel to each other. If an orthographic projection is used, no sense of depth is given, but parallel lines are always drawn parallel to each other.

In a perspective view, changing the perspective angle changes the field of view by changing the angle from the line of sight to the edge of the visible scene. The effect is similar to a telephoto zoom with a camera. A smaller perspective angle results in a larger zoom. This command has no effect when graphics perspective is off.

The GUI tool bar button for changing the graphics perspective mode is as follows:

3.4.11 Graphics Window Size and Position

By default in the command line version, Cubit will create a single graphics window when it starts up (to run Cubit without a graphics window, include -nographics on the command line when launching Cubit.) The graphics window position and size is most easily adjusted using the mouse, like any other window on an X-windows screen. However, the size of the graphics window can also be controlled using the following commands:

graphics windowsize <width_in_pixels> <height_in_pixels>

graphics windowsize maximum

graphics windowsize minimum

After using the graphics windowsize maximum and graphics windowsize minimum commands, the previous window size can be restored by using the command

graphics windowsize restore

The position of the graphics window can also be controlled using the graphics windowlocation command.

graphics windowlocation <x> <y>

The <x> and <y> coordinates refer to the distance in pixels from the upper left hand corner of the monitor. In addition, on Unix workstations, the graphics window size and position can be controlled by placing the following line in the user’s .Xdefaults file:

cubit.graphics.geometry xxY+xpos+ypos

where the X and Y are window width and height in pixels, respectively, and xpos and ypos are the offsets from the upper left hand corner.

3.4.11.1 Using Multiple Windows

You can use up to ten graphics windows simultaneously, each with its own camera and view. Each window has an ID, from 1 to 10, shown in the title bar of the window. Commands that control camera attributes apply to only one window at a time, the active window. Currently, the display lists of all windows are identical.

The following commands are used to create, delete, and make active additional graphics windows. These commands are also valid in the GUI (by typing at the command line prompt.)

graphics window create [ID]

graphics window delete <ID>

graphics window active <ID>

3.4.12 Hardcopy Output

Cubit’s Graphical User Interface provides the capability to print the contents of the graphics window directly to a printer.Use File/Export/Screen Shot to access this functionality. In addition, a command line option is provided for dumping the contents of the graphics window to postscript or image files. The command for generating hardcopy output files is:

hardcopy ’<filename>’ {jpg | gif | bmp | pnm | tiff | eps} [Window <window_id>]

Each of these options saves the view in the specified window (or the current window), to the specified file, in the format indicated. The file can then be sent to a printer or inserted into another document.

3.4.12.1 Screen Capture Programs

It should also be noted that many commercial applications are available for capturing screen images. In many cases, these applications may be more convenient for interactively capturing and saving a portion of the screen than the hardcopy command discussed above. On UNIX platforms, the http://www.trilon.com is a good choice. In some cases this utility or its equivalent may be included with your system software. For Windows users, the Print Screen button will send a copy of the screen to the clipboard which can then be pasted into a paint program.

3.4.13 Graphics Lighting Model

For shaded graphics display modes, the lighting model controls the intensity of the highlights and shadows for objects displayed in the graphics window. Cubit offers two commands for controlling the lighting model.

Graphics Ambient Intensity {<intensity> | <r g b>}

Graphics Light Intensity {<intensity> | <r g b>}

The ambient intensity is the light available in the environment. There is no particular direction to the light source. In contrast, the light intensity is the effect of a simulated light source placed at the viewer’s line of sight. The light intensity affects the intensity of the highlights and shadows, while the ambient intensity affects the brightness of the objects in the overall scene.

An intensity value from 0 to 1 can be used, where 0 represents no light and 1 represents maximum. Alternatively r g b color components can be used. This changes the color of the directional or ambient light source, affecting the resulting color of the objects in the model.

The GUI Options panel for manipulating these settings is found under Tools/Options and is shown below:

Figure 76:

3.4.14 Mesh Visualization

A volume mesh can be viewed one layer at a time using a visualization tool known as mesh slicing. This tool divides the elements of one or more volumes into axis-aligned layers, and then allows the mesh to be displayed one layer at a time. Mesh slicing is especially useful to view the quality of swept meshes that are axis aligned.

3.4.14.1 Notes on Mesh Slicing

Mesh slicing is only intended to be a rough visualization tool. Because the average mesh edge length is used to determine the thickness of each layer, a layer may be more than one element deep. Unstructured meshes, meshes with large variations in edge length, and non-axis-aligned meshes will be more difficult to visualize with this tool.

3.4.14.2 Mesh Slicing Command

Mesh slicing can be started either by entering a keypress in the graphics window, which slices the mesh of the entire model, or by entering the command

Graphics Slice {Body | Volume} <id_range> Axis {X | Y | Z}

which slices only the bodies or volumes indicated, with a plane along the axis specified.

Key presses in the graphics window which control mesh slicing are summarized in the following table.

Key

Action

X,Y or Z

Initiate mesh slicing using the X, Y or Z plane

K

Move the slicing plane in the positive coordinate direction

J

Move the slicing plane in the negative coordinate direction

S

Toggles drawing single or multiple slice layers in the view

Q

Exit from mesh slicing mode

See Graphics Clipping Plane for instructions on clipping the graphics using the GUI clipping plane.

3.4.15 Miscellaneous Graphics Options

In addition to the commands discussed above, there are several other graphics system options in Cubit that can be controlled by the user.

3.4.15.1 Silhouette Lines

Some shapes, such as cylinders, are drawn with silhouette lines; these lines don’t represent true geometric curves, but help visualize the shape of a surface. Silhouette lines can be turned on or off with the command

Graphics Silhouette [On|Off]

The pattern used to draw silhouette lines can be set using the command

Graphics Silhouette Pattern [Solid | Dashdot | Dashed | Dotted | Dash_2dot | Dash_3dot | Long_dash | Phantom]

3.4.15.2 Line Width

This option controls the width of the lines used in the wireframe, shaded, transparent, hiddenline and truehiddenline displays. The default is 1 pixel wide. The command to set the line width is

Graphics LineWidth <width_in_pixels>

3.4.15.3 Highlight Line Width

This option controls the width of the lines used when highlighting an entity. Setting this to a width greater than the global line width often makes it easier to locate highlighted entities. If this setting has not been changed, the line width set in the command above is used. After using this command, it is necessary to refresh the graphics by either typing "display" or clicking the Refresh Graphics button. The command to set the highlighting line width is

Highlight LineWidth <width_in_pixels>

3.4.15.4 Text Size

This option controls the size of text drawn in the graphics window. The size given in this command is the desired size relative to the default size. After using this command, it is necessary to refresh the graphics by either typing "display" or clicking the Refresh Graphics button. The command to set the text size is

Graphics Text Size <size>

3.4.15.5 Point Size

This option controls the size of points drawn in the graphics window, such as vertices or heads of vectors; alternatively, the size of points representing nodes or vertices can be set independently of the global point size. The commands to set the point sizes are

Graphics Point Size <size>

Graphics [Node|Vertex] Point Size <size>

3.4.15.6 Graphics Status

All graphics commands can be disabled or re-enabled with the command

Graphics {On|Off}

While graphics are off, changes in the model will not appear in the graphics window, and all graphics commands will be ignored. When graphics are again turned on, the scene will be updated to reflect the current state of the model.

3.4.15.7 Graphics Scale

A graphical scale can be drawn in the graphics window within the viewing area to obtain a bearing on model or part sizes. The command to turn the graphical scale on and off is:

Graphics Scale [On|Off]

3.4.15.8 Model Axis

The model axis may be drawn in the scene at the model origin. The axis is controlled with the command

Graphics Axis [Type <AXIS | Origin>] [On|Off]

The command is used to specify whether the model axis is visible, and to determine how the axis is drawn. If you include Type Axis , the axis will be drawn as three orthogonal lines; if you include Type Origin, the axis will be drawn as a circle at the model origin.

3.4.15.9 Corner Axis (Triad)

By default, an axis appears in the corner of the graphics window. This corner axis, also called the triad, can be disabled or re-enabled with the command

Graphics Triad [On | Off]

3.4.15.10 Resetting the Graphics

Many of the graphic options can be reset back to default values with the command:

Graphics Reset

The graphic options set to defaults are:

In addition, this command also:

3.4.15.11 Shrink

The shrink graphics attribute allows you to view the elements shrunken about their centroid. This is useful for viewing 3D meshes, permitting viewing of interior elements. It may also be useful for visually inspecting the mesh for missing elements. To use the shrink option use:

graphics shrink <value>

draw hex <range>

draw tet <range>

where value is a number between 0 and 1. One (1) will shrink the elements to a point, while zero (0) will not shrink the elements. The following figures illustrate the effect of element shrink on a hex mesh.

Figure 77: Top: shrink=0.2, Bottom: shrink=0.5

3.4.15.12 Facet Tolerance

The graphics tolerance commands change the way that facets are drawn in the graphics window. It does not affect the underlying geometry, just the graphics display. It can be useful to change the facet tolerance on large models if the refresh speed is slow.

graphics tolerance [ [ANGLE|distance] <val>|default ]

Specifying an angle will change the maximum allowable angle between neighboring facets. The distance option will set a maximum distance between adjacent facets. Increasing either of these numbers will result in coarser facets. The default option will return values to their default settings.

The GUI Options panel for manipulating these settings is found under Tools/Options and is shown below:

Figure 78:

3.4.16 Saving Graphics Views

The current graphics view can be saved and restored using the following commands:

view save position <n>

View Restore Position <n>

When you save a view, you save the camera settings in effect at the time the command is issued. When you restore the view, the camera is returned to the saved position, orientation, and field of view.

If autocenter is on at the time you save the view, then restoring the view will automatically adjust the camera settings to center on the entire model and fit the entire model on the screen, a lot like "zoom reset." You turn autocenter on by typing "graphics autocenter on."

Example of how to save a top view:

at 0

from 0 1 0

up 1 0

graphics autocenter on

view save position 3

Use this command to restore that view:

view restore position 3

The view will then be looking down the y-axis, with the x-axis to the top and the z-axis to the right. The model will be centered in the view and zoomed so that everything just fits into the graphics window. This is true even if the model is not centered on the origin.

If autocenter is off when the "view save" command is issued, the camera is not adjusted to fit the scene into the graphics window. Instead, it is placed exactly where it was at the time the "save" command was issued.

Note that many graphics commands, such as "at", "from", and "up", do not change what appears in the graphics window until a "display" command is issued. They do, however, take immediate effect internally, and they do affect what is saved by the "view save" command.

In the command line version of Cubit, you can save a view by holding down the shift key and pressing one of the function keys (F1-F12). Each function key corresponds to a different saved view. A total of 12 views can be saved. A view can be restored at a later time by pressing the appropriate function key WITHOUT holding down the shift key.

It may be useful to save views in your Cubit file so that they are available every time you run Cubit. Use Cubit to save front, top, and side views in positions 1, 2, and 3. If views are saved in your Cubit file, it is convenient to add a "view reset" command after the views have been saved. Then the graphics will initially appear as they would if the view commands had not been included in your Cubit file.

3.4.17 Geometry and Mesh Entity Visibility

The visibility of geometric and mesh entities can be turned on or off, either individually, by entity type, by general entity class (mesh, geometry, etc.), or globally. Note that these commands do not refresh automatically. To refresh type display or graphics flush or click in the display window.

The commands to set the visibility are:

{ {Body|Curve|Surface|Volume} <range> } [Mesh][Geometry] Visibility [On|Off]

Edge Visibility [On | Off]

Vertex [Visibility] [on|off]

{Mesh|Geometry|BC} { [Visibility] [on|off] }

Boundary_layer visibility {on|off}

If the mesh keyword is included, only the visibility of the mesh belonging to the specified entity is affected. Similarly, if the geometry keyword is included, only the visibility of the geometry is affected. Including neither keyword is identical to using both keywords.

Entity visibility is also controlled via context (right-click) menus in the Tree and in the graphics window.

The GUI tool bar buttons for manipulating geometry, mesh, boundary conditions, and boundary layers visibility are the following:

Figure 79:

]{}

Invisibility of geometry is inherited; visibility is not. For example, if a volume is invisible, its surfaces are also invisible unless they also belong to some other visible volume. As another case, if the volume is visible, but a surface is set to invisible, the surface will not follow its parent’s visibility setting, but will remain invisible.

If edge visibility is off, mesh edges will not be drawn when mesh faces are drawn.

If vertex visibility is turned on, the vertices of the geometry become visible. The default for vertex visibility is off.

After turning mesh visibility off, all mesh will remain invisible until mesh visibility is turned on again. This is true no matter what other visibility commands are entered.

Similarly, after turning geometry visibility off, all geometry will remain invisible until geometry visibility is turned on again. This is true no matter what other visibility commands are entered.