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:
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
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.
Figure 1. Default Mouse Function Mappings for the Command Line
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
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
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
The plot command is synonymous to the display command, and either can be used with identical results.
3.4.4 Graphics Modes
Graphics Mode {Wireframe | Hiddenline | Smoothshade | Transparent } [Geometry | Mesh]
The GUI tool bar buttons for manipulating the graphics modes are as follows:
Examples and a brief description of each mode are shown below
|
| |
|
| |
|
| |
|
|
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
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 57: 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
graphics composite {on|off}
Figure 58: 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:
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|Remove]
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 remove option removes objects that were added to the display with the add option. The remove does not affect entities that are displayed and not drawn. 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}
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>
curve ( at 5 5 0 ordinal 1 )
locate location 5 5 0
{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
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.
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
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
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
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
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
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:
3.4.6 Graphics Clipping Plane
graphics clip manipulation {on|off}
The GUI tool bar buttons to enable and manipulate the Graphics Clipping Plane are shown below:
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:
Red Line - Clicking and dragging the left mouse on plane bounded by a red tube moves the plane along the arrow
Center Ball - Clicking and dragging the left mouse on the center ball moves the origin of the rotation plane
Arrow - Clicking and dragging the left mouse button on the arrow head or tail changes the direction on which the plane moves
Right Mouse Button - Clicking and dragging the right mouse button on any part of the window resizes it
Middle Mouse Button - Clicking and dragging the middle mouse button on the red plane moves both the center of rotation and the cutting plane
White Bounding Border - Clicking and dragging the left mouse on the white bounding border moves the whole widget
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
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
<color_name>
user "name"
ID <id>
default
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
color define "<name>" RGB <r g b>
color define "<name>" r <r> g <g b <b>
color release "<color_name>"
help color
draw colortable
3.4.7.3 Assigning Colors
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
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.