MGED Commands

%
Start a ``/bin/sh'' shell process for the user. The mged prompt will be replaced by a system prompt for the shell and the user may perform any legal shell commands. The mged process waits for the shell process to finish, which occurs when the user exits the shell.
Examples:
mged> %
-- Start a new shell process.
$ ls -al
-- Issue any shell commands.
$ exit
-- Exit the shell.
mged>
-- Continue editing in mged.

3ptarb [ arb_name x1 y1 z1 x2 y2 z2 x3 y3 z3 x|y|z coord1 coord2 thickness]
Build an ARB8 solid by extruding a quadrilateral through a given thickness. The parameters may be provided on the command line; if they are not, they will be prompted for. The x1, y1, and z1 are the coordinates of one corner of the quadrilateral. x2, y2, z2, and x3, y3, z3 are the coordinates of two other corners. Only two coordinates of the fourth point are specified, and the code calculates the third coordinate to insure all four points are coplanar. The x|y|z parameter indicates which coordinate of the fourth point will be calculated by the code. The coord1 and coord2 parameters supply the other two coordinates. The direction of extrusion for the quadrilateral is determined from the order of the four resulting points by the right­hand rule: the quadrilateral is extruded toward a viewer for whom the points appear in counter­clockwise order.
Examples:
mged> 3ptarb
-- Start the 3ptarb command.
Enter name for this arb: thing
-- The new ARB8 will be named thing.
Enter X, Y, Z for point 1: 0 0 0
-- Point one is at the origin.
Enter X, Y, Z for point 2: 1 0 0
-- Point two is at (1, 0, 0).
Enter X, Y, Z for point 3: 1 1 0
-- Point three is at (1, 1, 0).
Enter coordinate to solve for (x, y, or z): z
-- The code will calculate the Z coordinate of the fourth point.
Enter the X, Y coordinate values: 0 1
-- The x and y coordinates of the fourth point are 0 and 1.
Enter thickness for this arb: 3
-- The new ARB8 will be 3 units thick.
mged> 3ptarb thing 0 0 0 1 0 0 1 1 0 z 0 1 3
-- Same as above example, but with all parameters supplied on the command line.

?
Provide a list of available mged commands. The help, helplib, and ?lib commands provide additional information on available commands.
Examples:
mged> ?
-- get a list of available commands.

?lib
Provide a list of available BRL­CAD library interface commands. The help, helplib, and ? commands provide additional information on available commands.
Examples:
mged> ?lib
-- get a list of available BRL­CAD library interface commands.

B &l;objects>
Clear the mged display of any currently displayed objects, then display the list of objects provided in the parameter list. Equivalent to the Z command followed by the command draw <objects>.
Examples:
mged> B some_object
-- Clear the display, then display the object named some_object.

E [-s] <objects>
Display objects in an evaluated form. All the Boolean operations indicated in each object in objects will be performed and a resulting facetted approximation of the actual objects will be displayed. Note that this is usually much slower than using the usual draw command. The -s option provides a more accurate, but slower, approximation.
Examples:
mged> E some_object
-- display a facetted approximation of some_object.

M 1|0 xpos ypos
Send a middle mouse-button event. The first argument indicates whether the event should be a button press (1) or release (0). The xpos and ypos arguments specify the mouse position in mged screen coordinates between -2047 and +2047. With the default bindings, a middle-button-press event while in the viewing mode moves the view so that the point currently at screen position (xpos, ypos) is repositioned to the center of the mged display (compare to the center command). The M command may also be used in other editing modes to simulate a middle mouse button event.
Examples:
mged> M 1 100 100
-- translate the point a screen coordinates (100, 100) to the center of the mged display.

Z
Zap (i.e., clear) the mged display.
Examples:
mged> Z
-- Clear the mged display.

adc [a1|a2|dst|dh|dv|hv|dx|dy|dz|x|y|xyz|reset|help values]
Control the angle/distance cursor. The adc command with no arguments toggles the display of the angle/distance cursor (ADC). The command may also be used with any one of the optional subcommands to adjust values of the ADC as follows: You can also control the position, angles, and radius of the ADC using a knob or the knob command.
Examples:
mged> adc
-- display the angle/distance cursor.
mged> adc a1 37.5
-- set angle1 to 37.5 degrees

ae [-i] azimuth elevation [twist]
Set the view orientation for the mged display by rotating the eye position about the center of the viewing cube. The eye position is determined by the supplied azimuth and elevation angles (degrees). The azimuth angle is measured in the XY plane with the positive X direction corresponding to an azimuth of zero degrees. Positive azimuth angles are measured counter­clockwise about the positive Z axis. Elevation angles are measured from the XY plane with +90 degrees corresponding to the positive Z direction and -90 corresponding to the negative Z direction. If an optional twist angle is included, the view will be rotated about the viewing direction by the spcified twist angle. The -i option results in the angles supplied being interpreted as increments.
Examples:
mged> ae -90 90
-- view from top direction
mged> ae 270 0
-- view from right hand side
mged> ae 35 25 10
-- view from azimuth 35, elevation 25, with view rotated by 10 degrees
mged> ae -i 0 0 5
-- rotate the current view through 5 degrees about the viewing direction

aip [f|b]
The ``aip'' command advances the illumination pointer when mged is in the solid illuminate state or the object illuminate state. In either of the illuminate states, a single primitive solid is highlighted at one time, and the path to that solid is displayed. Moving the mouse vertically in the mged display causes different solids to be highlighted and their paths to be displayed. The aip command causes the next solid in the list to be highlighted (if used with no arguments or the f argument), or it causes the previous solid in the list to be highlighted (if used with the b argument). Once the desired solid is highlighted, it is selected by clicking the middle mouse button or by using the M command. If mged is in the object path state, the place along the path where the edit is to take place will advance. Once the desired path position is displayed, it is selected by clicking the middle mouse button or by using the M command. This command was designed to be used within a Tcl script.
Examples:
mged> press sill
-- enter solid illuminate mode
mged> aip
-- hightlight the next solid
mged> aip b
-- highlight the previous solid
mged> M 1 0 0
-- select the highlighted solid

analyze [arb_name]
The ``analyze'' command displays the rotation and fallback angles, surface area, and plane equation for each face of the ARB specified on the command line. The total surface area and volume and the length of each edge is also displayed. If executed while editing an ARB the arb_name may be omitted, and the ARB being edited will be analyzed.
Examples:
mged> analyze arb_name
-- analyze the ARB named arb_name

apropos keyword
The ``apropos'' command searches through the one line usage messages for each mged command and displays the name of each command where a match is found.
Examples:
mged> apropos region
-- list all commands that contain the word ``region'' in their one line usage messages.

arb arb_name rotation fallback
The ``arb'' command creates a new ARB solid with the specified arb_name. The new ARB will be 20 inches by 20 inches and 2 inches thick. The square faces will be perpendicular to the direction defined by the rotation and fallback angles. This direction can be determined by interpreting the rotation angle as an azimuth and the fallback angle as an elevation as in the ae command.
Examples:
mged> arb new_arb 35 25
-- Create new_arb with a rotation angle angle of 35 degrees and a fallback angle of 25 degrees
mged> ae 35 25
-- rotate view to look straight on at square face of new_arb

arced comb/memb anim_command
The objects in a BRL­CAD model are stored as Boolean combinations of primitive solids and/or other combinations. These combinations are stored as Boolean trees with each leaf of the tree including a corresponding transformation matrix. The ``arced'' command provides a means for directly editing these matrices. The first argument to the ``arced'' command must identify the combination and which member's matrix is to be edited. The comb/memb argument indicates that member memb of combination comb has the matrix to be edited. The remainder of the ``arced'' command line consists of an animation command to be applied to that matrix. The available animation commands are:
Examples:
mged> arced body/head matrix rot 0 0 45
-- rotate member head (in combination body) about the z axis through a 45 degree angle

By default, the matrix comands expect a list of 16 matrix elements to define a matrix. The xlate option may be used along with three translation distances in the x, y, and z directions (in mm) as a shorthand notation for a matrix that is pure translation. Similarly, the rot option along with rotation angles (degrees) about the x, y, and z axes may be used as shorthand for a matrix that is pure rotation.


area [tolerance]
The ``area'' command calculates an approximate presented area of one region in the mged display. For this command to work properly, a single BRL­CAD region must be displayed using the E comand. The tolerance is the distance required between two vertices in order for them to be recognized as distinct vertices. This calculation considers only the minimum bounding polygon of the region and ignores holes.
Examples:
mged> Z
-- clear the mged display
mged> E region_1
-- E a single region
mged> area
-- calculate the presented area of the enclosing polygon of the region

arot x y z angle
The ``arot'' command performs a rotation about the specified axis (x y z) in screen coordinates (-2048 to +2048). The amount of rotation is determined by angle which is in degrees. Exactly what is rotated and how is dependant on MGED's state as well as the state of the display manager. For example, in normal viewing mode this command simply rotates the view. But in solid edit mode, it rotates the solid being edited.
Examples:
mged> arot 0 0 1 10
-- rotate 10 degrees about z axis

attach [-d display_string] [-i init_script] [-n name] [-t is_toplevel] [-W width] [-N height] [-S square_size] win_type
The ``attach'' command is used to open a display window. The set of supported window types includes X and ogl. It should be noted that attach no longer releases previously attached display windows (.i.e multiple attaches are supported). To destroy a display window use the release command.
Examples:
mged> attach ogl
-- Open a ogl display window named .dm_ogl0 (assuming this is the first ogl display window opened using the default naming scheme)
mged> attach ogl
-- Open a ogl display window named .dm_ogl1
mged> attach -n myOgl -W 720 -N 486 ogl
-- Open a 720x486 OpenGL display window named myOgl
mged> attach -n myX -d remote_host:0 -i myInit X
-- Open an X display window named myX on remote_host that is initialized by myInit
-- myInit might contain user specified bindings like those found in the default bindings.
mged> toplevel .t
-- Create a toplevel window named .t
mged> attach -t 0 -S 800 -n .t.ogl ogl
-- Open a 800x800 OpenGl display window named .t.ogl that is not a toplevel window
mged> button .t.dismiss -text Dismiss -command \"release .t.ogl; destroy .t\"
-- Create a button to dismiss the display manager etc.
mged> pack .t.ogl -expand 1 -fill both
-- Pack the display manager inside .t
mged> pack .t.dismiss
-- Pack the Dismiss button inside .t
mged> attach
-- list the help message which includes the valid display types

bev [-t] [-P#] new_obj Boolean_formula
The ``bev'' command performs the operations indicated in the Boolean_formula and stores the result in new_obj. The new_obj will be stored as an NMG solid (it may be converted to a polysolid by using the nmg_simplify command). If the -t option is specified, then the resulting object will consist entirely of triangular facets. The default is to allow facets of any complexity, including holes. The -P option specifies the number of CPU's to use for the calculation (however, this is currently ignored). Only simple Boolean_formulae are allowed. No parentheses are allowed and the operations are performed from left to right with no precedence. More complex expressions must be expressed as BRL­CAD objects using the r, g, or c commands and evaluated using the facetize or ev comands.
Examples:
mged> bev -t triangulated_lens sphere1 + sphere2
-- Create a triangulated object by intersecting objects sphere1 and sphere2

c [-g|r] combination_name [Boolean_expression]
The ``c'' command creates a BRL­CAD combination with the name combination_name. The -g option is the default and indicates that the combination should be flagged as a BRL­CAD group and the -r option indicates that the combination is a BRL­CAD region. The Boolean_expression allows parentheses. Where no order is specified, intersections are performed before subtractions or unions, then subtractions and unions are performed, left to right. With no Boolean_expression and combination_name does not already exist, a new empty combination will be created. If no Boolean_expression is provided, and combination_name does already exist and one of -g or -r is specified, then combination_name is flagged to agree with the indicated option. If a new region is created with this command, its region specific attributes will be set according to the current defaults (see regdef). The comb and r commands may also be used to create combinations.
Examples:
mged> c -g abc (a u b) - (a + d)
-- create a combination named abc according to the formula (a u b) - (a + d)

cat <objects>
The ``cat'' command displays a brief description of each item in the list of objects. If the item is a primitive solid, the type of solid and its vertex are displayed. If the item is a combination, the Boolean formula for that combination is displayed including operands, operators, and parentheses. If the combination is flagged as a region, then that fact is also displayed along with the regions ident code, air code, los, and GIFT material code.
Examples:
mged> cat region_1 region_2
-- display the Boolean formulae for some regions

center x y z
The ``center'' command positions the center of the mged viewing cube at the specified model coordinates. This is accomplished by moving the eye while not changing the viewing direction. The lookat command performs a similar function by changing the viewing direction, but not moving the eye location.
Examples:
mged> center 12.5 5.6 8.7
-- move the center of the mged display to the point (12.5, 5.6, 8.7)

cmd_close id
This command releases id's internal data structures. The parameter, id, refers to a command window.
Examples:
mged> cmd_close my_id
-- closes the command window my_id

cmd_get
This command returns information about the current command window. More specifically, it returns the following: This command was designed to be used within a Tcl script.
Examples:
mged> cmd_get
.my_window .their_window me {{them} {me} }
-- the current command window is me and is
tied to .my_window. The display window .their_window is sharing its view state with .my_window. Also, .their_window is sharing its view state with the display manager window that is tied to them.

cmd_init id
This command is used to create the internal data structures for a new command window. This command was designed to be used within a Tcl script.
Examples:
mged> cmd_init my_id
-- create another command window named my_id

cmd_set id
This command sets the current command window to id. If this command window is associated with a display manager, that display manager becomes the current display manager. This command was designed to be used within a Tcl script.
Examples:
mged> cmd_set my_id
-- my_id becomes the current command window

color low high r g b str
The ``color'' command creates an entry in the database that functions as part of a color lookup table for displayed regions. The ident number for the region is used to find the appropriate color from the lookup table. The low and high values are the limits of region ident numbers to have the indicated r g b color (0-255) applied. The str parameter is intended to be an identifying character string, but is currently ignored. The current list of color table entries may be displayed with the prcolor command, and the entire color table may be edited using the edcolor command. If a color lookup table exists, its entries will override any color assigned using the mater command.
Examples:
mged> color 1100 1200 255 0 0 fake_string
-- make an entry in the color lookup table for regions with idents from 1100 to 1200 using the color red

comb combination_name <operation object>
The ``comb'' command creates a new combination or extends an existing one. If combination_name does not already exist, then it will be created using the indicated list of operations and objects.. If it does exist, the list of operations and objects will be appended to the end of the existing combination. The <operation object> list is expected to be in the same form as used in the r command. The c command may also be used to create a combination.
Examples:
mged> comb abc u a - b + c
-- create combination abc as ((a - b) + c)

comb_color combination_name r g b
The ``comb_color'' command assigns the color r g b (0-255) to the existing combination named combination_name.
Examples:
mged> comb_color region1 0 255 0
-- assign the color green to region1

copyeval new_solid path_to_old_solid
Objects in a BRL­CAD model are stored as Boolean trees (combinations), with the members being primitive solids or other Boolean trees. Each member has a transformation matrix associated with it. This arrangement allows a solid to be a member of a combination, and that combination may be a member of another combination, and so on. When a combination is displayed, the transformation matrices are applied to its members and passed down through the combinations to the leaf (primitive solid) level. The accumulated transformation matrix is then applied to the solid before it is drawn on the screen. The ``copyeval'' command creates a new_solid by applying the transformation matrices accumulated along the path_to_old_solid to the leaf solid at the end of the path and saving the result under the name new_solid. The path_to_old_solid must be a legitimate path ending with a primitive solid.
Examples:
mged> copyeval solidb comb1/comb2/comb3/solida
-- create solidb from solida by applying the accumulated transformation matrices from the path comb1/comb2/comb3

copymat comb1/memb1 comb2/memb2
The ``copymat'' command copies the transformation matrix from a member of one combination to the member of another.
Examples:
mged> copymat comb1/memb1 comb2/memb2
-- set the matrix for member memb2 in combination comb2 equal to the matrix for member memb1 in combaination comb1

cp from_object to_object
The ``cp'' command makes a duplicate of an object (solid or combination). If from_object is a solid, then it is simply copied to a new solid named to_object. If from_object is a combination, then a new combination is created that contains exactly the same members, transformation matrices, etc, and it is named to_object.
Examples:
mged> cp comb1 comb2
-- make a duplicate of combination comb1 and call it comb2

cpi old_tgc new_tgc
The ``cpi'' command copies old_tgc (an existing TGC solid) to a new TGC solid (new_tgc), positions the new TGC such that its base vertex is coincident with the center of the top of old_tgc, and puts mged into the solid edit state with new_tgc selected for editing. This command was typically used in creating models of wiring or piping runs, however, a new pipe solid has since been added to BRL­CAD to handle such requirements.
Examples:
mged> cpi tgc_a tgc_b
-- copy tgc_a to tgc_b and translate tgc_b to the end of tgc_a

d <objects>
The ``d'' command deletes the specified list of objects from the mged display. This is a synonym for the erase command. Only objects that have been explicitly displayed may be deleted with the ``d'' command (use the who command to see a list of explicitly displayed objects). Objects that are displayed as members of explicitly displayed combinations cannot be deleted from the display with this command (see dall or erase_all). Note that this has no effect on the BRL­CAD database itself. To actually remove objects from the database, use the kill command.
Examples:
mged> d region1 solida
-- delete region1 and solida from the mged display

dall <objects>
The ``dall'' command deletes the specified list of objects from the mged display. This is a synonym for the erase_all command. This command will allow the user to delete objects that have not been explicitly displayed (unlike the d command). Note that this has no effect on the BRL­CAD database itself. To actually remove objects from the database, use the kill command.
Examples:
mged> dall region1 solida
-- delete region1 and solida from the mged display

db command [args...]
The ``db'' command provides an interface to a number of database manipulation routines. Note that this command always operates in units of millimeters. The command must be one of the following with appropriate arguments:
Examples:
mged> db match *.s
-- get a list of all objects in the database that end with ``.s''.
mged> db get cone.s
-- get a list of all the attributes and their values for solid cone.s.
mged> db get cone.s V
-- get the value of the V (vertex) attribute of solid cone.s.
mged> db put new_cone.s tgc V {0 0 0} H {0 0 1} A {1 0 0} B {0 1 0} C {5 0 0} D {0 5 0}
-- create a new
TGC solid named new_cone.s with the specified attributes.
mged> db adjust new_cone.s V {0 0 10}
-- adjust the V (vertex) attribute of new_cone.s to the value {0 0 10}.
nged> db form tgc
-- display the format used by the get and put commands for the TGC solid type.

dbconcat database_file [prefix]
The ``dbconcat'' command concats an existing BRL­CAD database to the database currently being edited. If a prefix is supplied, then all objects from the database_file will have prefix added to the beginning of their names. Note that each BRL­CAD object must have a unique name, so care must be taken not to ``dbconcat'' a database that has objects with names the same as objects in the current database. The dup command may be used to check for duplicate names. If the dup command finds duplicate names, use the prefix option to both the dup and dbconcat commands to find a prefix that produces no duplicates. If duplicate names are encountered during the ``dbconcat'' process, computer generated prefixes will be added to the object names coming from the database_file (but member names appearing in combinations will not be modified, so this is a dangerous practice and should be avoided).
Examples:
mged> dbconcat model_two.g two_
-- copy all the objects in model_two.g to the current database, but prefix the name of every object copied with the string two_.

debugbu [hex_code]
The ``debugbu'' command allows the user to set or check the debug flags used by libbu. With no arguments, the debugbu command displays all the possible settings for the bu_debug flag and the current value. When a hex_code is supplied, that value is used as the new value for bu_debug. Similar debug commands for other BRL­CAD libraries are debuglib for librt and debugnmg for the NMG portion of librt. Other debugging commands include debugmem and debugdir.
Examples:
mged> debugbu
-- get a list of available bu_debug values and the current value.
mged> debugbu 2
-- set bu_debug to <MEM_CHECK>.

debugdir
The ``debugdir'' command displays a dump of the in­memory directory for the current database file. The information listed for each directory entry includes:
Examples:
mged> debugdir
-- get a dump of the in­memory directory.

debuglib [hex_code]
The ``debuglib'' command allows the user to set or check the debug flags used by librt. With no arguments, the debuglib command displays all the possible settings for the librt debug flag and the current value. When a hex_code is supplied, that value is used as the new value for the flag. Similar debug commands for other BRL­CAD libraries are debugbu for libbu and debugnmg for the NMG portion of librt. Other debugging commands include debugmem and debugdir.
Examples:
mged> debuglib
-- get a list of available debug values for librt and the current value.
mged> debuglib 1
-- set the librt debug flag to <DEBUG_ALLRAYS> (print info about rays).

debugmem
The ``debugmem'' command prints a list of all the memory blocks that have been allocated and recorded in the memdebug table. Memory alocation is not normally recorded in the memdebug table, but executing the debugbu 2 command will turn on the <MEM_CHECK> flag and as long as that flag is set, all memory allocation will be recorded.
Examples:
mged> debugmem
-- get a list of allocated memory blocks.

debugnmg
The ``debugnmg'' command with no options displays a list of all possible debug flags available for NMG processing. If the comand is invoked with a hex number argument, that value is used as the new value for the NMG debug flag. Similar debug commands for other BRL­CAD libraries are debuglib for librt and debugbu for libbu. Other debugging commands include debugmem and debugdir.
Examples:
mged> debugnmg 100
-- set the NMG debug flag to get details on the classification process

decompose NMG_solid [prefix]
The ``decompose'' command processes an NMG solid and produces a series of new NMG solids comsisting of each maximally connected shell in the original NMG solid. If an optional prefix is supplied, the resulting NMG solids will be named by using the prefix and adding an underscore character and a number to make the name unique. If no prefix is supplied, the default prefix ``sh'' wil be used.
Examples:
mged> decompose solid.nmg part
-- decompose the NMG solid named solid.nmg into maximally connected shells and put each resulting shell into a seperate NMG solid named part_1, part_2, ...

delay seconds microseconds
The ``delay'' command simply provides a delay of the specified time before the next command will be processed. This is mainly intended for use in MGED command scripts.
Examples:
mged> delay 5 0
-- delay for 5 seconds

dm command [args]
The ``dm'' command provides a means to interact with the display manager at a lower level. This command was designed to be used within a Tcl script.
set [var [val]]
The ``set'' command provides a means to set or query display manager specific variables. Invoked without any arguments, the set command will return a list of all available internal display manager variables. If only the var argument is specified, the value of that variable is returned. If both var and val are given, then var will be set to val.
size [width height]
The ``size'' command provides a means to set or query the window size. If no arguments are given, the display manager's window size is returned. If width and height are specified, the display manager makes a request to have its window resized accordingly.
m button x y
The ``m'' command is used to simulate a M command. The button argument determines which mouse button is being used to trigger a call to this command. This value is used in the event handler to effect dragging the faceplate scrollbars. The x and y arguments are in X screen coordinates which are converted to mged screen coordinates before being passed to the M command.
am <r | t | s> x y
The ``am'' command effects mged's alternate mouse mode. The alternate mouse mode gives the user a different way of manipulating the view or an object. For example, the user can drag an object or rotate the view while using the mouse. The first argument indicates the type of operation to perform (i.e. r for rotation, t for translation, and s for scale). The x and y arguments are in X screen coordinates and are transformed appropriately before being passed to the knob command.
adc <1 | 2 | t | d> x y
The ``adc'' command provides a way of manipulating the angle distance cursor while using the mouse. The first argument indicates the type of operation to perform (i.e. 1 for angle 1, 2 for angle 2, t for translate, and d for tick distance). The x and y arguments are in X screen coordinates and are transformed appropriately before being passed to the adc command (i.e. not ``dm adc'').
con <r | t | s> <x | y | z> xpos ypos
This form of the ``con'' command provides a way to effect constrained manipulation of the view or an object while using the mouse. This simulates the behavior of sliders without taking up screen real estate. The first argument indicates the type of operation to perform (i.e. r for rotation, t for translation, and s for scale). The <x | y | z> argument is the axis of rotation, translation, or scale. The xpos and ypos arguments are in X screen coordinates and are transformed appropriately before being passed to the knob command.
con a <x | y | 1 | 2 | d> xpos ypos
This form of the ``con'' command provides a way to effect constrained manipulation of the angle distance cursor while using the mouse. This simulates the behavior of sliders without taking up screen real estate. The first argument indicates that this is to be applied to the angle distance cursor. The next argument indicates the type of operation to perform (i.e. x for translate in the X direction, y for translate in the Y direction, 1 for angle 1, 2 for angle 2, and d for tick distance). The xpos and ypos arguments are in X screen coordinates and are transformed appropriately before being passed to the knob command.
Examples:
mged> dm set
-- get a list of the available display manager internal variables.
mged> dm set perspective 1
-- turn on perspective projection in the display.
mged> dm size
-- return the size ot the display manager
mged> dm size 900 900
-- request that the display manager window be resized to 900x900
mged> dm m 2 100 200
-- simulate a button2 press at (100, 200) in X screen coordinates
mged> dm am r 400 100
-- start an alternate mouse mode rotation
mged> dm adc d 300 200
-- start a tick distance manipulation
mged> dm con t z 200 200
-- start a constrained translation down the Z axis
mged> dm con a d 200 100
-- start a constrained tick distance manipulation
mged> dm idle
-- end drag

draw <objects>
Add <objects> to the display list so that they will appear on the MGED display. The e command is a synonym for draw.
Examples:
mged> draw object1 object2
-- draw object1 and object2 in the MGED display.

dup file [prefix]
The ``dup'' command checks the specified file (which is expected to contain a BRL­CAD model) for names that are the same as those in the current model. If a prefix is included on the command line, all names in the specified file will have that prefix added to their names before comparison with the current model. This command is often used prior to invoking the dbconcat command to insure that there are no name clashes.
Examples:
mged> dup other_model.g
-- check other_model.g for names duplicating those in the current model.
mged> dup other_model.g abc
-- do the same check as above, but prefix all the names in other_model.g with abc before comparing with the names in the current model.

e <objects>
The ``e'' command adds the objects in the argument list to the display list so that they will appear on the MGED display. This is a synonym for the draw command.
Examples:
mged> e object1 object2
-- draw object1 and object2 in the MGED display.

eac <aircodes>
The ``eac'' command adds all the regions in the current model that have one of the aircodes in the argument list to the display list so that they will appear on the MGED display. Regions that have non-zero ident numbers will not be listed by this command. The whichair command will perform the same search, but just lists the results.
Examples:
mged> eac 1 2 3
-- draw all regions with aircodes 1, 2, or 3 in the MGED display.

echo text
The ``echo'' command merely echos whatever text is provided as an argument on the command line. This is intended for use in MGED scripts.
Examples:
mged> echo some text goes here
-- display the text, "some text goes here".

edcodes <objects>
The ``edcodes'' command puts the user into an editor to edit a file that has been filled with the ident, air code, material code, LOS, and name of all the regions in the specified objects. The user may then modify the entries (except for the names). The editor used is whatever the user has set in the environment variable EDITOR. If EDITOR is not set, then /bin/ed is used.
Examples:
mged> edcodes object1 object2
-- edit the region codes for all region below object1 and object2.

edcolor
The ``edcolor'' command puts the user into an editor to edit a file that has been filled with the ident based color lookup table. The entire table may be seen with the prcolor command, and entries may be added using the color command. The editor used is whatever the user has set in the environment variable EDITOR. If EDITOR is not set, then /bin/ed is used.
Examples:
mged> edcolor
-- edit the color table

edcomb combname R|G regionid air_code los [material_code]
The ``edcomb'' command allows the user to modify the attributes of a combination. The combname is the name of the combination to be modified. An R flag indicates that the region flag should be set, otherwise the region flag is unset. If the region flag is not being set, then the remainder of the attributes are ignored. If the region flag is being set, then the region_id, air_code, los, and material_code are set according to the parameters supplied.
Examples:
mged> edcomb comb1 R 1001 0 50 8
-- Make comb1 a region and set its ident to 1001, its air code to 0, its LOS to 50, and its material code to 8.
mged> edcomb comb1 0 0 0 0
-- unset the region flag for combination comb1

edgedir [x y z]|[rot fb]
The ``edgedir'' command allows the user to set the direction of an edge by specifying a direction vector in the form of x, y, and z components or via rotation and fallback angles. This can only be done while moving an edge of an ARB.
Examples:
mged> edgedir 0 1 0
-- rotate the edge being edited to be parallel to the Y axis.

edmater <combinations>
The ``edmater'' command places the user in an editor ready to edit a file filled with with shader parameters for the combinations listed on the command line. The parameters placed in the file for editing are the shader name and parameters, RGB color, RGB_valid flag, and the inheritance flag. The editor used is whatever the user has set in the environment variable EDITOR. If EDITOR is not set, then /bin/ed is used.
Examples:
mged> edmater comb1 comb2
-- edit the shader parameters for combinations named comb1 and comb2.

eqn A B C
The ``eqn'' command allows the user to rotate the face of an ARB solid by providing the coefficients of an equation of the desired plane for the face. The coefficients A, B, and C are from the plane equation:
	Ax + By + Cz = D
The user must be editing an ARB solid and be rotating a face of the ARB for this command to have any effect. When entering such a state, the user will be asked which of the face vertices should be held constant, and from this information the D coefficient of the equation is determined.
Examples:
mged> eqn 0 0 1
-- rotate the face of the ARB being edited to be parallel to the XY plane.

erase <objects>
The ``erase'' command deletes the specified list of objects from the mged display. This is a synonym for the d command. Only objects that have been explicitly displayed may be deleted with the ``erase'' command (use the who command to see a list of explicitly displayed objects). Objects that are displayed as members of explicitly displayed combinations cannot be deleted from the display with this command (see dall or erase_all). Note that this has no effect on the BRL­CAD database itself. To actually remove objects from the database, use the kill command.
Examples:
mged> erase region1 solida
-- delete region1 and solida from the mged display

erase_all <objects>
The ``erase_all'' command deletes the specified list of objects from the mged display. This is a synonym for the dall command. This command will allow the user to delete objects that have not been explicitly displayed (unlike the d or erase commands). Note that this has no effect on the BRL­CAD database itself. To actually remove objects from the database, use the kill command.
Examples:
mged> erase_all region1 solida
-- delete region1 and solida from the mged display

ev [-dnqstuvwT] [-P #] <objects>
The ``ev'' command evaluates the objects specified by tesselating all primitive solids in the objects and then performing any Boolean operations specified in the objects. The result is then displayed in the MGED display according to the specified options:
Examples:
mged> ev region1 solida
-- display evaluated region1 and solida as shaded polygons
mged> ev -wT region1
-- display evaluated region1 as wireframe without triangulating

exit
The ``exit'' command ends the MGED process. This is a synonym for the quit command.
Examples:
mged> exit
-- stop MGED

expand regular_expression
The ``expand'' command performs matching of the regular_expression with the names of all the objects in the database. It returns all those that successfully match.
Examples:
mged> expand *.r
-- display a list of all database object names that end in ``.r''

extrude #### distance
The ``extrude'' command modifies an ARB solid by extruding the specified face through the specified distance to determine the position of the opposing face. The face to be extruded is identified by listing its vertex numbers as they are labeled in the MGED display when the ARB is edited. Note that the face identified is not moved, but the opposite face is adjusted so that it is the specified distance from the specified face. The order that the vertex numbers are listed determines the direction of the extrusion using the right­hand­rule.
Examples:
mged> extrude 1234 5
-- move face 5678 so that it is 5 units from face 1234.

eye_pt x y z
The ``eye_pt'' command positions the eye point to the given x, y, and z coordinates (specified in mm)
Examples:
mged> eye_pt 100 0 0
-- position the eye at 100 mm along the X­axis

e_muves MUVES_component1 MUVES_component2 ...
The ``e_muves'' command displays the BRL­CAD regions that are part of the indicated MUVES components. The internal list of MUVES components must have been created earlier by the read_muves command. The MUVES components listed on the command line must not use any wildcards (the expansion will result in BRL­CAD objects, not MUVES components).
Examples:
mged> e_muves fuel transmission
-- Display the BRL­CAD regions that make up the MUVES components named ``fuel'' and ``transmission''.

facedef #### [a|b|c|d parameters]
The ``facedef'' command allows the user to redefine any face of an ARB8 solid. The user must be in solid edit mode with an ARB selected for editing. The optional parameters may be omitted, and MGED will prompt for the missing values. The options are:
Examples:
mged> facedef 1234 a 1 0 0 20
-- move face 1234 such that it is in the YZ plane at X=20
mged> facedef 5678 b 0 0 10 10 0 10 10 10 10
-- move face 5678 such that it is in the plane formed by the three points (0 0 10), (10 0 10), and (10 10 10)

facetize [-tT] [-P#] new_object old_object
The ``facetize'' command creates new_object as an NMG solid by tessellating all the primitive solids in old_object and then performing any Boolean operations specified in old_object. The -T option indicates that all faces in the new_object should be triangulated. The -t option is to create TNURB faces rather than planar approximations (this option is still under development). The -P option is intended to allow the user to specifiy the number of CPU's to use for this command, but it is currently ignored.
Examples:
mged> facetize region1.nmg region1.r
-- create a facetized NMG version of existing object region1.r

find <objects>
The ``find'' command displays all combinations that have any of the objects specified as a member.
Examples:
mged> find solida
-- list all combinations that refer to solida

fracture NMG_solid [prefix]
The ``fracture'' command creates a new NMG solid for every "face" in the specified NMG_solid. The new solids will be named by adding and underscore and a number to the prefix. If no prefix is specified, then the NMG_solid name provided is used in place of the prefix.
Examples:
mged> fracture solid1.nmg f
-- create a series of NMG solids named "f_#", one for each face in solid1.nmg

g groupname <objects>
The ``g'' command creates a special type of combination often referred to as a group. This builds a combination by unioning together all the listed objects. If groupname already exists, then the list of objects will be unioned to the end of it (Note that an existing groupname is not restricted to being a group, any combination is legal). Other commands to build combinations are c, r, or comb.
Examples:
mged> g solid1.nmg f
-- create a series of NMG solids named "f_#", one for each face in solid1.nmg

garbage_collect
The ``garbage_collect'' command eliminates unused space in a BRL-CAD database file.
Examples:
mged> garbage_collect
-- clean out unsued space in the database

get_comb comb_name
The ``get_comb'' command returns a Tcl list of information about comb_name. If comb_name is a region, the following information is returned:

NAME REGION REGION_ID AIRCODE GIFT_MATERIAL
LOS COLOR SHADER INHERIT BOOLEAN_FORMULA

Otherwise, the following shorter list is returned:

NAME REGION COLOR SHADER INHERIT BOOLEAN_FORMULA

This command was designed to be used within a Tcl/Tk interface script.
Examples:
mged> get_comb some_region
some_region Yes 1000 0 1 100 {0 220 220} plastic No { u box
- ball
}
mged> get_comb some_non_region
some_non_region No {0 220 220} plastic No { u box2
- ball2
}

help [command]
The ``help'' command provides a list of available mged commands along with a one line usage message for each. If a command is supplied as an argument, the one line usage message for that command is displayed. The ?lib, helplib and ? commands provide additional information on available commands.
Examples:
mged> help ae
-- display a one-line usage message for the ae command

helplib [command]
The ``helplib'' command provides a list of available library commands along with a one line usage message for each. If a command is supplied as an argument, the one line usage message for that command is displayed. The ?lib, help and ? commands provide additional information on available commands.
Examples:
mged> helplib mat_trn
-- display a one-line usage message for the mat_trn command

hist_add [command]
The ``hist_add'' command adds command to the history list of commands executed during the current mged session without actually executing it. If command is more than one word, it must be surrounded by ``{'' and ``}''.
Examples:
mged> hist_add {ae 35 25}
-- add the command ``ae 35 25'' to the history list without actually executing it.

hist_next
The ``hist_next'' command returns the next command in the command history list. This command is used in the implimentation of the command line editing available in mged.
Examples:
mged> hist_next
-- return the next command in the command history list.

hist_prev
The ``hist_prev'' command returns the previous command in the command history list. This command is used in the implimentation of the command line editing available in mged.
Examples:
mged> hist_prev
-- return the previous command in the command history list.

history [-delays]
The ``history'' command displays the list of commands executed during the current mged session. The one exception is the hist_add command which can add a command to the history list without executing it. If the -delays option is used, then the delays between commands will also be displayed.
Examples:
mged> history
-- display the command history list.

i obj_name comb_name [operation]
The ``i'' command adds obj_name to the end of the combination named comb_name. The operation may be ``+'', ``-'', or ``u''. If no operation is specified, ``u'' is assumed. If comb_name does not exist, it is created.
Examples:
mged> i region3 group5
-- add region3 to the combination group5

idents file_name <objects>
The ``idents'' command places a summary of the regions in the list of objects specified in the file specified. If any regions include other regions, then only the first encountered region in that tree will be listed. The resulting file will contain two lists of regions, one in the order encountered in the list of objects, and the other ordered by ident number. The data written for each region includes (in this order) a sequential region count, the ident number, the air code, the material code, the LOS, and the path to the region.
Examples:
mged> idents regions_file group1 group2 region3
-- create a file named regions_file and list all the regions in group1, group2, and region3 in the file.

ill obj_name
The ``ill'' command performs the function of selecting an object after entering solid illuminate or object illuminate mode. In solid illuminate mode, this command selects the specific solid for editing. In object illuminate mode, this command selects the leaf object for the object path, then the user may use the mouse to select where along the object path the editing should be applied. In both modes, the ill command will only succeed if the specified obj_name is only referenced once in the displayed objects, otherwise a multiply referenced message will be displayed. If the ill command fails, the user must resort to either using the mouse to make the selection, or using aip and M 1 0 0.
Examples:
mged> ill solida
-- select solida for editing.

in [-f] [-s] new_solid_name solid_type <parameters>
The ``in'' command allows the user to type in the parameters needed to create a solid with the name new_solid_name of the type solid_type. The command may be invoked with no arguments, and it will prompt the user for all needed information. The -s option will invoke the solid edit mode on the new solid immediately after creation. The -f option does not draw the new solid, and therefore the -s option may not be used in conjunction with -f. The possible values for solid_type are:
Examples:
mged> in new1 raw 0 0 0 0 0 1 1 0 0 0 1 0
-- create an ARB named new1 in the form of a right angle wedge.

inside [outside_solid_name new_inside_solid_name <parameters>]
The ``inside'' command creates a new solid that is inside an existing solid. This command is typically used to create an inside solid that can be subtracted from the original solid to produce a hollow shell. The command is typically used with no arguments and it prompts the user for all needed information.
Examples:
mged> inside out_arb in_arb 1 1 1 1 1 1
-- create a solid named in_arb such that each face is 1
unit from the corresponding face in out_arb

item region_name ident_number [air_code [material_code [LOS]]]
The ``item'' command sets the values of ident_number, air_code, material_code, and LOS for the specified region.
Examples:
mged> item region_1 1137 0 8 100
-- set ident number to 1137, air code to 0, material code to 8, and los to 100 for region_1

jcs id
The ``jcs'' command is a tcl script that takes care of setting up the Tcl/Tk interface windows associated with id (i.e. windows created with openw) to join the collaborative session.
Examples:
mged> jcs its_me
-- its_me joined the collaborative session

joint command [options]
articulation/animation commands
?
This command returns a list of available joint commands.
accept [-m] [joint_names]
debug [hex code]
help [commands]
This command returns a usage message for each joint command.
holds [names]
list [names]
load file_name
mesh
move joint_name p1 [p2...p6]
reject [joint_names]
save file_name
solve constraint
test file_name
unload

journal [-d] [journal_file_name]
The ``journal'' command starts or stops the journalling of mged commands in a file. If executed with no arguments, the command stops journalling. If a journal_file_name is provided, that file will become the recipient of the journalling. If a -d option is also provided, the journalling will include the delays between commands. Journalling is off by default.
Examples:
mged> journal journal_file
-- start journalling to journal_file

keep keep_file <objects>
The ``keep'' command copies the objects specified to the keep_file. If keep_file does not exist, it is created. If keep_file does exist, the objects are appended to it. The keep_file is a BRL­CAD database file. The objects in the list must exist in the current database.
Examples:
mged> keep sample.g sample1 sample2
-- create sample.g file with objects sample1 and sample2 in it.

keypoint [x y z | reset]
The ``keypoint'' command without any options displays the current keypoint setting. If a point is specified, then that point becomes the keypoint. If reset is specified, then the default keypoint is restored. The keypoint is used as the center of rotation and scaling in solid edit or object edit modes. This command has no effect when used in non-editing modes.
Examples:
mged> keypoint 10 20 30
-- set the keypoint to the point (10 20 30) in model units

kill [-f] <objects>
The ``kill'' command deletes the specified objects from the current database. This command affects only the objects actually listed on the command line. If a combination is killed, its members are not affected. If the -f option is specified, then kill will not complain if some, or all, of the objects specified do not actaully exist in the database. Note that the objects are killed immediately. There is no need for a ``write file'' command in MGED, and there is no ``undo'' command. Use this command with caution. Other commands that remove objecvts from the database are killall and killtree.
Examples:
mged> kill group1 region2 solidb
-- destroy group1, region2, and solidb

killall <objects>
The ``killall'' command deletes the specified objects from the current database and removes all references to them from all combinations in the database. Note that the objects are killed immediately. There is no need for a ``write file'' command in MGED, and there is no ``undo'' command. Use this command with caution. Other commands that remove objects from the database are kill and killtree.
Examples:
mged> killall group1 region2 solidb
-- destroy group1, region2, and solidb and remove all references to these objects from the database.

killtree <objects>
The ``killtree'' command deletes the specified objects from the current database and recursively deletes all objects referenced by any of those objects. If one of the objects listed is a combination, then that combination will be deleted as well as any objects that are members of that combination. If a member of that combination is itself a combination, then all its members will also be destroyed. This continues recursively until the primitive solids are reached and destroyed. Note that the objects are killed immediately. There is no need for a ``write file'' command in MGED, and there is no ``undo'' command. Use this command with extreme caution. Other commands that remove objects from the database are kill and killall.
Examples:
mged> killtree group1 region2 solidb
-- destroy group1, region2, and solidb and remove all references to these objects from the database.

knob [-e -i -m -v] [-o v|m|e|k] [zap|zero|(id [val])]
The ``knob'' command is used internally by mged in the processing of knob input devices and is not recommended for users. The knob command provides a method for simulating knob input. With no options it will display the current values for the knobs. With the zap or zero command provided, all the knob values will be reset to zero. If an id and value are provided, the specified knob setting will be simulated. If the -i option is specified, then the value provided will be used as an increment to be applied to the indicated knob. The knobs have different functions depending on the current mode. When in solid or object edit mode and a rotation or translation function is selected the the knob effects are applied to the edited object by default. However, the -v (view coordinates) and -m (model coordinates) options may be used with the knob command to adjust the view without modifying any solid or object parameters. The -e option allows the knob effects to be applied to the edited object when they would normally be applied to the view. The -o option allows the origin of rotation to be specified. The units for value are degrees for rotation and local units for translation. The available knob ids are:
Examples:
mged> knob y 1
-- start the view rotating about the vertical axis

l <objects>
The ``l'' command displays a verbose description about the specified objects. For a combination, the l command will list the Boolean formula for the combination and will indicate any member transformations. If a shader and/or color has been assigned, the details will be listed. For a region, its ident, air code, material code, and LOS will also be listed. For primitive solids, detailed solid parameters will be displayed.
Examples:
mged> l region1
-- display details about region1

labelvert <objects>
The ``labelvert'' command labels the vertices of the indicated objects with their coordinate values in the mged display window. The objects must have already been displayed using e, E, ev, B, or any other command that results in the display of an object.
Examples:
mged> labelvert solidb
-- place coordinate values in display near the vertices of solidb

listeval [path]
Combinations may include transformation matrices to be applied to their members. A path through a series of combinations and ending with a primitive solid represents that primitive solid with the transformations accumulated through the path applied to it. The ``listeval'' command displays primitive solid parameters after applying the accumulated transformations from the indicated path. If the specified path does not end at a primitive solid, then all possible paths from the indicated path to any primitive solid will be evaluated and displayed.
Examples:
mged> listeval group1/region1/solidb
-- display the parameters for solidb after applying the transformation matrix from group1 for region1 and the transformation matrix from region1 for solidb

loadtk
The ``loadtk'' command loads the initialization for the Tk window library. This is normally done automatically when the user attaches any display manager for mged. If no display manager is attached, then the user must execute loadtk prior to using any Tk facilities.
Examples:
mged> loadtk
-- Initialize the Tk window library

lookat x y z
The ``lookat'' command adjusts the current view in mged such that the eye is looking in the direction of the given coordinates, but does not move the eye point nor change the viewsize. This is similar to just rotating the viewers head to look at the specified point, putting that point in the center of the mged display. The center command performs a similar function, but moves the eye_pt without changing the viewing direction.
Examples:
mged> lookat 10 20 30
-- rotate the view to place the point (10 20 30) (model coordinates) in the center of the display

ls [objects]
The ``ls'' command with no argument lists the name of every object in the database (in alphabetical order). If an argument is supplied, only those objects are listed. The argument may include regular expressions for matching. The ls command is a synonym for the t command.
Examples:
mged> ls solid*
-- list all objects with names beginning with ``solid''

l_muves MUVES_component1 MUVES_component2 ...
The ``l_muves'' command lists the BRL­CAD regions that are part of the indicated MUVES components. The internal list of MUVES components must have been created earlier by the read_muves command. The MUVES components listed on the command line must not use any wildcards (the expansion will result in BRL­CAD objects, not MUVES components).
Examples:
mged> l_muves fuel transmission
-- List the BRL­CAD regions that make up the MUVES components named ``fuel'' and ``transmission''.

make new_solid type
The ``make'' creates a new_solid of the indicated type. The new_solid is sized according to the current viewsize, and is dependent on the type. The possible values for type are:
Examples:
mged> make solida sph
-- create a sphere named solida

make_bb new_solid_name <objects|paths>
The ``make_bb'' (make bounding box) command builds a single axis-aligned rectangular parallelepiped (RPP) that will contain the objects and paths specified. The paths will include any transformation matrices that accumulate from combinations along the path. The listeval command may be used to see the effect of transformation matrices along a path.
Examples:
mged> make_bb new_bb solida group1/region3
-- create an RPP named new_bb that is large enough to contain solida and group1/region3

mater combination [shader_parameters[RGB [inheritance]]]
The ``mater'' command assigns shader parameters, RGB color, and inheritance to an existing combination. The information may be included on the command line, otherwise the user will be prompted it. Some available shaders are:
Examples:
mged> mater region1 "plastic {tr 0.5 re 0.2}" 210 100 100 0
-- set region1 to use the plastic shader with 50% transparency, 20% reflectivity, a base color of (210 100 100), and inheritance set to 0

matpick #|combination/member
The ``matpick'' command selects which matrix in the illuminated path should be edited. A number may be specified with 0 being the topmost selection. A combination/member may be specified to indicate that the matrix in combination that corresponds to mamber si to be edited. This command is only useful in object edit mode at the point where the user is selecting which matrix in the illuminated path should be edited. It is used internally by mged, the user should generally use the mouse to make this selection.
Examples:
mged> matpick group1/region3
-- select the matrix for region3 in group1 for editing

memprint
The ``memprint'' command displays memory maps for debugging purposes.
Examples:
mged> memprint
-- list memory maps

mged_update
The ``mged_update'' command refreshes the mged display. This is used internally in mged. It may be useful in Tcl scripts to get the mged display to update.
Examples:
mged> mged_update
-- update the mged display

mirface #### x|y|z
The ``mirface'' command modifies an ARB solid by mirroring the indicated face along the selected X, Y, or Z axis. An ARB solid must be selected for editing. Not all faces of all ARB types may be edited using this command.
Examples:
mged> mirface 1234 x
-- Modify currently edited ARB by moving the face opposite face 1234 such that it is the mirror image of face 1234 across the YZ-plane

mirror old_object new_object x|y|z
The ``mirror'' command creates new_object by duplicating old_object and reflecting it along the indicated axis. If old_object is a primitive solid, then a new solid is created, with parameters adjusted to accomplish the mirror operation. If old_object is a combination, then new_object will simply be a copy of old_object with all its members matrices set do perform the appropriate reflection.
Examples:
mged> mirror solid1 solid1_mirror x
-- make a copy of solid1, name it solid1_mirror, and adjust its parameters so that it is a mirror image of solid1 across the YZ-plane

model2view x y z
The ``model2view'' command converts the supplied point (in model coordinates) to view coordinates. View coordinates are the coordinates in the viewing cube with values between -1.0 and +1.0 being inside the viewing cube.
Examples:
mged> model2view 10 20 30
-- display the view coordinates that correspond to the point (10 20 30) in model space.

mv old_name new_name
The ``mv'' command changes the name of old_name to new_name. Note that this does not change any references to old_name that may appear in other combinations in the database. The mvall command will change an objects name everywhere.
Examples:
mged> mv solida solidb
-- change the name of solida to solidb

mvall old_name new_name
The ``mvall'' command changes the name of old_name to new_name. This will also change any references to old_name that may appear in other combinations in the database. The mv command will change an objects name without changing references to it. The prefix command will also change the names and references of objects.
Examples:
mged> mvall solida solidb
-- change the name of solida to solidb everywhere it occurs in the database.

nirt [nirt_args]
The ``nirt'' command runs the nirt program that is distributed with BRL­CAD to intersect a single ray with the displayed objects. By default, nirt is run using the current database and the currently displayed objects, and uses the current eye point as the ray start point and the current viewing direction as the ray direction. This effectively fires a ray at the center of the mged display. The resulting list of intersections between the ray and the objects are listed. Additional argumenst may be supplied on the nirt command line. See the man page of nirt for more details.
Examples:
mged> nirt
-- fire a single ray through the center of the mged display

nmg_collapse old_nmg_solid new_nmg_solid maximum_error_dist [minimum_angle]
The ``nmg_collapse'' command simplifies an existing nmg_solid by a process of edge decimation. Each edge in the old_nmg_solid is considered, if it can be deleted without creating an error greater than the spcified maximum_error_dist, then that edge is deleted. If a minimum_angle is specified (degrees), then the edge will not be deleted if it would create a triangle with an angle less than minimum_angle. The resulting solid is saved in new_nmg_solid. The old_nmg_solid must have been triangulated previous to using the nmg_collpase command. The resulting solid consists of all triangular faces.
Examples:
mged> nmg_collapse nmg_new nmg_old 1.0 10.0
-- Decimate edges in nmg_old to produce an NMG with an error no greater than 1.0 units. The process will not create any triangles with an angle less than 10 degrees. The new NMG solid will be named nmg_new.

nmg_simplify [arb|tgc|poly] new_solid nmg_solid
The ``nmg_simplify'' command attepts to convert an existing nmg_solid to a simpler primitive solid type. The user may specify which type to attempt by including arb, tgc, or poly on the command line. If no solid type is specified, all will be attempted in the above order. If tgc is specified, the code will attempt to determine if the nmg_solid is an approximation of a TGC solid.
Examples:
mged> nmg_simplify poly solida.poly solida.nmg
-- convert the NMG solid named solida.nmg to a polysolid named solida.poly

oed path_lhs path_rhs
The ``oed'' command places mged directly into the object edit mode. The path_rhs must be a path to a primitive solid, and path_lhs must be a path to a combination that includes the first component of path_rhs as one of its members. The edited matrix will be the matrix in the final component of path_lhs that corresponds to the first component of path_rhs. The last component in path_rhs is used as the reference solid during the object editing.
Examples:
mged> oed group1/group2 region1/solida
-- place mged into object edit mode, editing the matrix in group2 that corresponds to region1, using solida as the reference solid

opendb [database.g]
The ``opendb'' command closes the current database file and opens database.g. If database.g is not found, the current database is left open. If database.g is not specified on the command line, the name of the current database file is returned.
Examples:
mged> opendb model.g
-- close the current database file and open model.g
mged> opendb
-- return the name of the current database file

orientation x y z w
The ``orientation'' command sets the view direction for mged from the quaternion specified on the command line.
Examples:
mged> orientation 1 0 0 0
-- set viewing direction to bottom

orot [-i] xdeg ydeg zdeg
The ``orot'' command performs a rotation of an object during object edit. The rotation is performed, in order, xdeg degrees about the X-axis, then ydeg about the Y-axis, and finally zdeg about the Z-axis. If the -i flag is given, then the angles are interpreted as increments to the last object rotation. The rotobj command is a synonym for orot.
Examples:
mged> orot 0 0 35
-- rotate currently edited object by 35 degrees about the Z-axis

oscale scale_factor
The ``oscale'' command performs a uniform scale operation on the currently edited object. A scale_factor of 2 will double the size of the object, and a scale_factor of 0.5 will halve its size.
Examples:
mged> oscale 3
-- increase the size of the curently edited object by a factor of 3

overlay plot_file [name]
The ``overlay'' command plots the specified UNIX plot_file in the mged display. Phoney object names are created for each part of the plot file that is in a unique color. The names are created by adding a color to the specified name, or to ``_PLOT_OVER'' if no name is provided. The color suffix is built by converting the RGB color to a six digit hex number. Each color corresponds to 2 hex digits, so that white becomes "ffffff", red becomes "ff0000", green is "00ff00", etc.
Examples:
mged> overlay plot.upl tmp
-- plot the Unix plot file plot.upl in the mged display, using tmp as the base for the phoney object names.

p value1 [value2 value3]
The ``p'' command provides precise control over solid editing operations that would normally be done using the mouse or knobs. For example, a solid rotate may be performed by selecting rotate from the solid edit menu, then providing the rotation angles with the p command. A command of ``p 0 30 0'' would rotate the edited solid through 30 degrees about the Y-axis. Similarly, many of the individual parameters of the edited solid may be set exactly using the p command. If the scale H menu item is selected while editing a TCG, then the value1 supplied with a p command specifies the actual length of the height vector for that TGC. This method is the recommended technique to set precise values for solid parameters. The translate and rotobj commands provide a similar capability for object editing.
Examples:
mged> p 30
-- set the currently selected solid parameter of the currently edited solid to 30 units

pathlist <combinations>
The ``pathlist'' command lists all existing paths that start from the specified combinations and end at a primitive solid.
Examples:
mged> pathlist group1 region2
-- list all existing paths that start from the combinations group1 and region2 and end at primitive solids

paths path_start
The ``paths'' command lists all existing paths that start from the specified path_start and end at a primitive solid. The path_start may be specified as by ``/'' separated components or they may be separated by spaces (but not both).
Examples:
mged> paths group1 region2
-- list all existing paths that start from group1/region2 and end at a primitive solid

pcs
The ``pcs'' command prints a list of the mged players (i.e. the id's associated with the Tcl/Tk interface windows created with openw) taking part in the collaborative session.
Examples:
mged> pcs
lisa joe mike sue

-- shows that lisa, joe, mike, and sue are part of the collaborative session

pmp
This command prints a list of the mged players (i.e. the id's associated with the Tcl/Tk interface windows created with openw).
Examples:
mged> pmp
lisa joe mike sue larry moe curly

-- shows the current mged players

permute tuple
The ``permute'' command permutes the vertex labels for the face of an ARB solid that is currently being edited. The tuple indicates which face is affected and also indicates the desired result. The tuple is formed by concating the list of vertex numbers for the face in the order desired such that the first vertex listed will become vertex number one (and therefore, the default keypoint). Only a sufficient number of vertices to disambiguate need be included in the tuple. Note that this has no effect on the geometry of the ARB, but may affect any texture mapping involving this solid.
Examples:
mged> permute 321
-- rearrange the vertices of the currently edited ARB such that vertex #3 becomes vertex #1, vertex #2 remains #2, and vertex #1 becomes #3

pl [-float] [-zclip] [-2d] [-grid] out_file | ``|'' filter
The ``pl'' command creates a UNIX plot of the current mged display. If an output_file is specified, the plot is stored in that file. If a filter is specified, the output is sent to that filter. The -float option requests a plot file with real numbers rather than integers. The -zclip option requests that the plot be clipped to the viewing cube in the Z-direction. The -2d option requests a 2-dimensional plot (the default is 3D). The -grid option is intended to include a grid in the plot, but is currently not implimented. This command uses the dm-plot display manager. The plot command performs the same function, but does not use the dm-plot display manager.
Examples:
mged> pl -float | pldebug
-- create a UNIX plot of the current mged display and pipe the results to the pldebug command

plot [-float] [-zclip] [-2d] [-grid] out_file | ``|'' filter
The ``plot'' command creates a UNIX plot of the current mged display. If an output_file is specified, the plot is stored in that file. If a filter is specified, the output is sent to that filter. The -float option requests a plot file with real numbers rather than integers. The -zclip option requests that the plot be clipped to the viewing cube in the Z-direction. The -2d option requests a 2-dimensional plot (the default is 3D). The -grid option is intended to include a grid in the plot, but is currently not implimented. This command does not use the dm-plot display manager. The pl command performs the same function, but does use the dm-plot display manager.
Examples:
mged> plot -float | pldebug
-- create a UNIX plot of the current mged display and pipe the results to the pldebug command

prcolor
The ``prcolor'' command lists the entries in the ident based color table. The ident number for a displayed region is used to find the appropriate color from the lookup table. The low and high values are the limits of region ident numbers to have the indicated r g b color (0-255) applied. The color table entries may be modified using the color command, and the entire color table may be edited using the edcolor command. If a color lookup table exists, its entries will override any color assigned using the mater command.
Examples:
mged> prcolor -float | pldebug
-- create a UNIX prcolor of the current mged display and pipe the results to the pldebug command

prefix new_prefix <objects>
The ``prefix'' command changes the name of all the objects listed by adding the specified new_ prefix. All references to the objects will also be changed. The mvall command performs a similar function.
Examples:
mged> prefix test_ group1 regiona solidb
-- change the names of objects group1, regiona, and solidb to ``test_group1'', ``test_regiona'', and ``test_solidb''. All references to these objects will reflect the new names.

press button_label
The ``press'' command simulates the pressing of a button. The button_label indicates which button to simulate. The available buttons are:
Examples:
mged> press top
-- switch to view from the top direction

preview [-v] [-d delay] [-D start_frame_number] [-K end_frame_number] rt_script_file
The ``preview'' command allows the user to preview animation scripts in mged. The -d option provides a delay in seconds to be applied between each frame (the default is no delay). The -D option allows the user to specify a starting frame number, and the -K option allows the specification of an ending frame number. The -v flag indicates that the objects displayed in the mged graphics window should be displayed in ``evaluated'' mode, as would be the result of the ev command. Note that this may significantly slow the preview.
Examples:
mged> preview -D 101 -K 237 script.rt
-- preview the animation script stored in the file named script.rt from frame number 101 through frame number 237

ps [-f font] [-t title] [-c creator] [-s size_in_inches] [-l line_width] output_file
The ``ps'' command temporarily attaches the Postscript display manager and outputs the current mged display to the specified output_file in PostScript format. The -f option allows the font to be user-specified. The -t option allows the user to provide a title (the default is ``No Title''). The -c option allows the user to specify the creator of the file (the default is ``LIBDM dm-ps'').
Examples:
mged> ps -t "Test Title" test.ps
-- place a PostScript version of the current mged display in a file named test.ps and give it the title ``Test Title''.
mged> ps -l 10 -t "Test Fat Lines" fat_lines.ps
-- this time use fat lines.

push <objects>
The ``push'' command forces the effects of all transformation matrices that appear in any combinations in the trees from the specified objects down to the primitive solids. This will change the parameters of the primitive solids if any of the transformation matrices are not identity matices. All the transformation matrices visited will be set to identity matrices. This command will fail, and no changes will be made, if any primitive solid referenced by the list of objects is positioned differently in two or more combinations. The xpush command will perform a similar function, even if some solids are multiply referenced.
Examples:
mged> push group1 regiona
-- push the effects of any transformation matrices in the trees headed by group1 and regiona down to the primitive solids

put_comb comb_name is_Region [id air gift los] color shader inherit boolean_expr
The ``put_comb'' command defines the combination comb_name. If is_Region is Yes, then id, air, gift and los must be specified. If is_Region is No, then id, air, gift and los must not be specified. This command was designed to be used from within a script.
Examples:
mged> put_comb not_region No \"0 220 220\" plastic No \"u box\\n- ball\"
-- defines a combination called not_region
mged> put_comb my_region Yes 1000 0 1 100 \"0 220 220\" plastic No \"u box\\n- ball\"
-- defines a region called my_region

putmat comb_name/member_name {I | m0 m1 m2 m3 ... m16}
The ``putmat'' command replaces the existing transformation matrix in the combination specified that corresponds to the member specified. The transformation matrix may be specified with an ``I'' to indicate the identity matrix, or it may be specified as 16 elements listed row-by-row. The copymat command allows the user to copy an existing transformation matrix.
Examples:
mged> putmat group1/regiona I
-- set the transformation matrix for regiona in group1 to the identity matrix.

q
The ``q'' command ends the mged process. Note that there is no write database command in mged. All changes are made to the database as the user performs them. Therefore, a q comand will not restore the database to its pre-edited state. This is a synonym for the quit command.
Examples:
mged> q
-- quit the current mged session

qcs id
The ``qcs'' command is used to quit the collaborative session.
Examples:
mged> qcs my_id
-- my_id is removed from the collaborative session.

qorot x y z dx dy dz angle
The ``qorot'' command rotates an object through the specified angle (in degress). This command requires that mged already be in object edit mode. The edited object is rotated about the axis defined by the start point (x y z) and the direction vector (dx dy dz).
Examples:
mged> qorot 1 2 3 0 0 1 25
-- rotate the currently edited object through 25 degrees about the axis through the point (1, 2, 3) and in the Z-direction.

quit
The ``quit'' command ends the mged process. Note that there is no write database command in mged. All changes are made to the database as the user performs them. Therefore, a quit comand will not restore the database to its pre-edited state. This is a synonym for the q command.
Examples:
mged> quit
-- quit the current mged session

qvrot dx dy dz angle
The ``qvrot'' command adjusts the current mged viewing direction such the the eye is positioned along the direction vector (dx dy dz) from the view center and is looking towards the view center. The angle (in degrees) allows for a twist about the viewing direction. The ae command provides a similar capability.
Examples:
mged> qvrot 0 0 1 90
-- set the current view to the same as achieved by the press top command

r region_name <operation object>
The ``r'' command creates a region with the specified region_name. The region is constructed using the list of Boolean operation and object pairs. The operators are represented by the single characters ``+'', ``-'', and ``u'' for intersection, subtraction, and union respectively. The object associated with each operator may be a combination or a primitive solid. No parentheses or any grouping indication is allowed in the r command. The operator hierarchy for the r command has been established through the ancestry of BRL­CAD, and does not conform to accepted standards (see the c command for a more standard implementation). Intersection and subtraction operations are performed first proceeding left to right, then union operations are performed. BRL­CAD regions are special cases of BRL­CAD combinations and include special attributes. Default values for these attributes may be set using the regdef command. As new regions are built, the default ident number gets incremented. If region_name already exists, then the operation/object pairs get appended to its end.
Examples:
mged> r new_region + solid1 - solid2 u solid3 + group4
-- create a region named new_region that consists of two parts unioned together. The first part is solid1 with solid2 subtracted. The second part is the intersection of solid3 and the combination group4

rcodes file_name
The ``rcodes'' command reads the specified file and assigns the region attributes to the regions listed. The file is expected to be in the format produced by the wcodes command.
Examples:
mged> rcodes region_codes
-- read the file named region_codes and set the region specific attributes according to the values found in the file.

read_muves MUVES_regionmap_file
The ``read_muves'' command reads the indicated ``MUVES_regionmap_file'' and creates an internal list of all the MUVES components defined in the file along with the corresponding BRL­CAD regions. This list can then be used to display the regions in terms of the MUVES component names. See the e_muves, t_muves, and l_muves comands.
Examples:
mged> read_muves region_map
-- Read the MUVES file named region_map.

red combination
The ``red'' command creates a file describing the specified combination and starts an editor for the user to modify the combination. The environment EDITOR variable will be used to select the editor. If EDITOR is not set, then /bin/ed will be used. All the attributes of BRL­CAD regions and combinations may be edited in this way. The region specific attributes will be ignored if the combination is not a region and is not set to be a region during editing. It is not necessary to be in an editing mode to run this command. The rm, r, comb, c, and g commands provide some basic combination editing capabilities.
Examples:
mged> red group2
-- edit the combination group2 with the users editor of choice.

refresh
The ``refresh'' command updates the mged display
Examples:
mged> refresh
-- update the mged display

regdebug [debug_level]
The ``regdebug'' command with no options toggles the display manager debug flag. If a debug_level is supplied, then the display manager debug flag is set to that value.
Examples:
mged> regdebug
-- toggle the display manager debug flag

regdef item [air [los [material_code]]]
The ``regdef'' command sets the default region attributes used by the r and c commands when building a BRL­CAD region. The default ident number is incremented each time a new region is created with the r or c commands.
Examples:
mged> regdef 1003 0 100 8
-- set the region default attributes to an ident of 1003, an air code of 0, a los of 100%, and a material code of 8.

regions output_file <objects>
The ``regions'' command creates a summary of all the regions in the specified list of objects. The summary is written in the specified output_file. The summary includes, for each region, a sequential region number, its ident, air code, material code, los, the path from one of the objects to the region, and the Boolean formula for the region.
Examples:
mged> regions regions_file group1 group2
-- place a summary of all the regions from group1 and group2 in the file named regions_file

release [name]
The ``release'' command is used to close a display manager. If invoked with no arguments, the current display manager is closed. Otherwise, name (i.e. the Tcl/Tk path name of the display manager window) is closed.
Examples:
mged> release
-- close the current display manager
mged> release .dm_X0
-- close .dm_X0

rfarb
The ``rfarb'' command creates a new ARB8 solid based on rotation and fallback angles. The command prompts the user for all the required information. In addition to the name for the new solid and the rotation and fallback angles, the user is prompted for the coordinates of one corner of the ARB8 and for two of the three coordinates of the other three vertices of one face of the ARB8. The other cordinate of each of these vertices is calculated in order to insure that the face is planar. The user is then prompted for a thickness, and the first face is extruded normally by the specified thickness to complete the ARB8.
Examples:
mged> rfarb
-- create a new ARB8 solid according to parameters supplied in answer to prompts.

rm combination <members>
The ``rm'' command deletes all occurences of the listed members from the specified combination. The red, r, comb, c, and g commands provide other combination editing capabilities.
Examples:
mged> rm group1 regiona
-- delete regiona from group1

rmater file
The ``rmater'' command reads the specified file and sets the combination shader, color, and inheritance values according to those listed in the file. The format of the file is expected to be as produced by the wmater command.
Examples:
mged> rmater mater_file
-- read the file named mater_file and set the combination attributes according to those listed in the file.

rmats file
The ``rmats'' command reads the specified file and sets the current mged view to agree with the parameters in the file. The format of the file is expected to be as produced by the savekey command.
Examples:
mged> rmats key_file
-- read the file named key_file and set the current mged viewing direction according to the parameters found there.

rot x y z
The ``rot'' command rotates the view or an object by x, y, z degrees. Exactly what is rotated and how is dependant on MGED's state as well as the state of the display manager. See arot for a similar capability.
Examples:
mged> rot 0 0 45
-- rotate 45 degrees about the Z axis
mged> rot 45 45 0
-- rotate 45 degrees about the Y axis, then rotate 45 degrees about the X axis

rotobj [-i] x-angle y-angle z-angle
The ``rotobj'' command rotates the currently edited object by z-angle degrees about the Z-direction, y-angle about the Y-direction, and x-angle degrees about the X-direction in that order. If a -i option is inlcuded, then the rotations are treated as incrememts to the previous rotations. Mged must be in the object edit mode for this command to be useful. The p command provides a similar capability for solid editing.
Examples:
mged> rotobj 0 0 25
-- rotate the currently edited object through 25 degrees about the Z-direction.

rrt program [options]
The ``rrt'' command executes the specified program with the provided options and includes the current database name and the list of currently displayed objects on the command line. This command effectively executes:
	program options database_name objects
Rrt also provides the current mged viewing parameters to the program on standard input. Many BRL­CAD programs use the -M option to indicate that viewing parameters will be provided on standard input. The
rt command can be simulated with rrt as:
	rrt /usr/brlcad/bin/rt -M -s50
provided that perspective is not currently being used. Any executable routine may be run using rrt, however it will always be run with the provided options followed by the current database name and the list of currently displayed objects.
Examples:
mged> rrt echo
-- will list the current database name and the list of currently displayed objects

rt [options]
The ``rt'' command executes the BRL­CAD rt program with the default options of ``-s50 -M''. If perspective is turned on, then the -p option will be included with the value of the perspective angle. The current database name and the list of currently displayed objects are added to the end of the rt command line. The rt program is written such that options may be repeated, and the last occurrence of an option will override any earlier occurences. This allows the user to specify other size (-s) options. The rrt command performs a similar function, but may be used to execute other programs as well. The -M option tells rt to read the viewing parameters from standard input. See the man page on rt for details.
Examples:
mged> rt -s1024 -F/dev/Xl
-- run the rt program to produce a color-shaded image of the current view in the mged display. The image will be 1024 pixels square and will be displayed on a lingering X frambuffer.

rtcheck [options]
The ``rtcheck'' command executes the BRL­CAD rtcheck program with the default options of ``-s50 -M''. The -M option tells rtcheck to read the viewing parameters from standard input so that rays are only fired from the current view. The current database name and the list of currently displayed objects are added to the end of the rtcheck command line. The rtcheck program is written such that options may be repeated, and the last occurrence of an option will override any earlier occurences. This allows the user to specify other size (-s) options. The rrt command performs a similar function, but may be used to execute other programs as well. The rtcheck program uses raytracing to check for overlapping regions in the list of objects passed on the command line. When invoked from within mged, any discovered overlaps along a ray are represented as yellow lines that extend only in the areas of overlap. Details and a count of overlaps are also reported. Note that overlaps of less than 0.1 mm are currently ignored by rtcheck. The default option of -s50 indicates that the checking rays should be fired from a uniform square grid with 50 rays on a side. This is very coarse and may miss significant overlaps. It is recommended that the user select appropriate options for the rtcheck program and execute it for a variety viewing aspects to perform a thorough check. The granularity of the grid may be controlled with the -s, -w, -n, -g, and -G options. See the man page on rtcheck for details.
Examples:
mged> rtcheck -g10 -G10
-- run the rtcheck program with rays fired from a uniform grid with the rays spaced every 10 mm.

savekey file [time]
The ``savekey'' command saves the current viewing parameters in the specified file in the format expected by the rmats command. If a time is included, it will also be written to the specified file. If the file already exists, the information will be appended to its end. The parameters saved this way are useful as keypoints in constructing an animation. The BRL­CAD anim_keyread program will read a file constructed by using the savekey command with some number of different views in mged with sequential times specified. The anim_keyread program will produce a table of keyframes suitable for use with other BRL­CAD animation tools.
Examples:
mged> savekey key_file 5
-- append the current viewing parameters to key_file and tag this as the key frame at 5 seconds.

saveview file [args]
The ``saveview'' command saves the current viewing parameters in the specified file in the form of a shell script that will run the BRL­CAD rt program as if it had been executed from within mged using the rt -s512 command. Any args included on the saveview command line will be copied to the file as options to the rt program. If the file already exists, the script will be appended to it. This is useful in setting up images to be raytraced later. The default script produced by ``saveview test.rt'' looks like:
#!/bin/sh
rt -M \
 -o test.rt.pix\
 $*\
 model.g\
 'object1' 'object2' \
 2>> test.rt.log\
 <<EOF
viewsize 2.780320739746094e+02;
orientation 2.480973490458727e-01 4.765905732660483e-01 7.480973490458729e-01 3.894348305183902e-01;
eye_pt 1.234152656421214e+02 7.220202900588745e+01 3.845765464924686e+01;
start 0; clean;
end;

EOF
When this script is executed, the image will be stored in test.rt.pix and all messages and errors generated by the rt program will be stored in test.rt.log. The above script will produce an image of object1 and object2 from the BRL­CAD database named model.g. The viewsize, orientation, and eye_pt parameters reproduce the view displayed by mged when the saveview command was executed. The inclusion of ``$*'' allows the user to include any additional rt options when executing this script. Typically, a ``-s'' option might be used to set the image size (the default is 512 pixels square). See the man page on rt for details on available options.
Examples:
mged> saveview rt_script -s1024
-- create (or append to) a file named rt_script that will contain a script to run the rt program and create a color shaded image of the current mged display. The image produced will be 1024 pixels square.

sca sfactor
The ``sca'' command is used to scale the view or to scale an object. Exactly what is done is determined by MGED's state as well as the state of the display manager.
Examples:
mged> sca 2
-- scale by 2

sed path
The ``sed'' command places mged directly into the solid edit mode. The path must uniquely identify a primitive solid. If the solid is only referenced once in the objects being displayed, then path may simply be the solid name. If the solid is multiply referenced, then the path should be the full path from a top level displayed object to the primitive solid to be edited. The who command will return a list of the top-level objects currently being displayed.
Examples:
mged> sed 0 0 25
-- rotate the currently edited object through 25 degrees about the Z-direction.

setview x-angle y-angle z-angle
The ``setview'' command sets the current view in mged by specifying rotation angles (in degrees) about the X, Y, and Z axes. The rotations are performed about the Z-axis first, then the Y-axis, then the X-axis. The ``setview 0 0 0'' command is a synonym for press top.
Examples:
mged> setview 90 180 90
-- set the current view to that set by ae 0 0

shader combination shader_name ["{shader_args}"]
The ``shader'' command assigns shader parameters to the specified combination. The shader_name indicates which shader should be assigned. If shader_args are supplied, they will be assigned as parameters to the indicated shader. This perfomrs a similar function as the mater command.
Examples:
mged> shader group1 checker "{a 0,255,0 b 0,0,255}"
-- assign the checkerboard shader to group1 using green and blue colors for the squares

shells NMG_solid
The ``shells'' command separates the specified NMG solid into its constituent shells. Each shell is written to the database as a separate NMG object with a name of the form ``shell.'' with a number appended to make the name unique. If the NMG has only one shell, then only one new object will be created. This differs from the decompose command in that decompose will actually break the object into a number of separate shells if possible.
Examples:
mged> shells object.nmg
-- break the NMG solid named object.nmg into its constituent shells

showmats path
The ``showmats'' command lists the transformation matrices encountered along the specified path and also lists the accumulated matrix at the end of the path. If any member occurs more than once in a combination along the path, then a matrix will be listed for each occurrence of that member, and the accumulated matrix will only use the first occurrence. Related commands are putmat, copymat, and listeval.
Examples:
mged> showmats head/skull/jaw
-- list the transformation matrices along the path ``head/skull/jaw'' and the accumulated matrix for the entire path

size view_size
The ``size'' command sets the size of the current viewing cube to the specified view_size (in model units). This size is the length of any side of the square mged display.
Examples:
mged> size 250
-- set the mged display to be 250
units across

sliders [on|off]
The ``sliders'' command with no options will report the status of the sliders (whether or not sliders are displayed). If one of the on or off flags is supplied, then the sliders are turned on or off respectively. The sliders provide a graphical interface to control the mged view parameters. Translation, rotation, and scaling of the current view are adjustable through the sliders. Positioning the mouse over the desired slider bar and clicking the middle mouse button will activate that slider bar. The position of any slider bar may be continuously adjusted by holding down the middle mouse button over the slider bar while moving the mouse horizontally. The sliders may be user in rate or absolute mode (toggled by clicking on the Rate/Abs button). In rate mode, the slider position indicates the rate at which that parameter changes. In absolute mode, the slider position indicates the actual value of that parameter.
Examples:
mged> sliders on
-- display the sliders

solids file <objects>
The ``solids'' command lists a summary of all the primitive solids used in regions referenced by the list of objects. The summary is written to the specified file. The summary is similar to that produced by the regions command, but with the addition of primitive solid parameters. The solid oarameters listed wil have the accumulated transformation matrices along the path from the listed objects to the primitive solid applied (as would be listed by the listeval command). The showmats command may be used to see the actual transformation matrices.
Examples:
mged> solids solids_summary group1 regiona
-- write a summary of all the regions in group1 and include the region named regiona. The summary will include detailed solid parameters for the solids used in the regions

status
The ``status'' command lists the status of the current view in mged. The current state ("VIEWING", "SOL PICK", "SOL EDIT", "OBJ PICK", "OBJ PATH", "OBJ EDIT", or "VERTPICK") is listed along with the view size, the conversion factor from local model units to the base units (mm) stored in the database, and the view matrices.
Examples:
mged> status
-- list the status of the current view

summary [s r g]
The ``summary'' command with no arguments lists the number of primitive solids, regions, and non-region combinations in the current database. If the s argument is supplied, then the name of each primitive solid is also listed. Similarly, the r flag asks for the region names, and g asks for the names of all the combinations (including region). The flags may be concatenated to get combined output.
Examples:
mged> summary sr
-- list a summary of primitive solids and regions for the current database

sv x y [z]
The ``sv'' command moves the view center to (x, y, z). If z is not provided, then z=0 is used. The parameters x, y, z are integer values relative to the screen. For example, the center of the screen is (0, 0, 0) and the upper left corner is (-2048, 2047, 0).
Examples:
mged> sv 0 0 0
-- the view is unchanged
mged> sv 1024 0 0
-- the view center is moved half way between the current view center and the right side of the view screen.

svb
The ``svb'' command sets the view reference base variables. These variables are used internally by the knob command to calculate absolute rotation, translation, and scale.
Examples:
mged> svb
-- set the view reference base variables with respect to the current view

sync
The ``sync'' command causes all information in memory that should be on disk to be written out.
Examples:
mged> sync
-- make sure disk files are up to date

t [<object_names>]
The ``t'' command with no options displays a table of contents for the current database. This will list the name of every object in the database (in alphabetical order). A list of object_names may be supplied, and only those names will be listed. The list of object_names may include regular expressions that will be matched to object names in the database. This is a synonym for the ls command.
Examples:
mged> t r[0-2]*
-- list the names of all objects that start with ``r0'', ``r1'', or ``r2''

ted
The ``ted'' command places the parameters of the currently edited primitive solid into a file, then starts a text editor for the user to modify the parameters. The editor used is whatever the user has set in the environment variable EDITOR. If EDITOR is not set, then /bin/ed is used. Mged must be in the solid edit mode prior to using this command. The red command performs a similar function for combinations.
Examples:
mged> ted
-- use a text editor to modify the currently edited solid

tie [[-u] command_window [display_window]]
The ``tie'' command is used to create (or destroy with the -u option) an association between a command window and a display window. When there exists such an association, all commands entered from the command window will be directed at the display window. The command_window can be specified with mged to refer to the tty MGED was started from, or an id associated with a Tcl/Tk interface window created with openw . The display_window is specified with its Tcl/Tk pathname. If no parameters are given, a listing of the current command_window/display_window associations is returned. If only the command_window is given, the command_window/display_window association is returned. If both parameters are given, the command_window/display_window association is created. This command was designed to be used within a Tcl script.
Examples:
mged> tie my_id .my_window
-- Create the association between my_id and .my_window
mged> tie my_id
my_id ---> .my_window

-- list the command_window/display_window association for my_id
mged> tie
my_id ---> .my_window
mged --->

-- list all of the command_window/display_window associations

title [string]
The ``title'' command, with no arguments, returns the title string for the current database. If any command line arguments are supplied, they will become the new title string for the current database. Quote marks must be doubly escaped.
Examples:
mged> title This is my \\"database\\"
-- set the title of the current database to This is my "database"

tol [abs #] [rel #] [norm #] [dist #] [perp #]
The ``tol'' command, with no arguments, lists the current tolerance settings. If the command line includes any of the keywords followed by a number, then that tolerance setting will be modified. The keywords are:
Examples:
mged> tol rel .05 perp 1e-6
-- set the relative tolerance to 5% and the perpendicularity tolerance to 1e-06 (cosine of 89.9999 degrees).

tops
The ``tops'' command displays a list of all the top level objects in the current database. The top level objects are all those objects that are not referenced by some other combination. The hierarchical structure of BRL­CAD databases usually means that there will be a top level object that includes all (or at least most) of the objects in the database.
Examples:
mged> tops
-- list all the top level objects in the current database

tra dx dy dz
The ``tra'' command translates the view or an object. Exactly what is done is determined by MGED's state as well as the state of the display manager. The parameters dx, dy and dz are in local units.
Examples:
mged> tra 10 0 0
-- translate by 10 units along the X axis

track [parameters]
The ``track'' command builds a simple representation of the linked track of a vehicle such as a tank. With no command line arguments, the track command will prompt for all the required input. The vehicle is assumed to be axis aligned with the front in the +X-direction. A combination name for the track is built by appending a unique number to the string ``track''. The information about the track may be included on the command line, and is order dependent. The parameters are (in order):
Examples:
mged> track 500 0 10 10 -50 50 10 550 50 10 -50 -20 2
-- build a simple track using the provided parameters

translate x y z
The ``translate'' command is used in object edit mode to precisely control the translation of an object. The edited object is translated to the specified coordinates. The p command provides a similar capability for solid editing.
Examples:
mged> translate 10 20 30
-- move the currently edited object to the model coordinates (10 20 30)

tree <objects>
The ``tree'' command will list the contents of the specified objects in a tree-like format that displays the hierarchical structure of the objects, and all objects referenced by them, down to the primitive solid level.
Examples:
mged> tree group1
-- show the structure of the tree rooted at group1 down to the primitive solid level.

t_muves
The ``t_muves'' command lists all the MUVES components that are known as a result of a prior read_muves command.
Examples:
mged> t_muves
-- List all the known MUVES components.

units [units_type]
The ``units'' command, with no arguments, will return the current type of units that mged is using. If a units_type is specified, mged will switch to editing in the indicated units. The actual database is always stored in millimeters, and the display is adjusted to the users choice of units. If the units_type specified on the command line is one of the types allowed, it will be written to the database file as the preferred units and succeeding invocations will use those units. The units_type strings that will be remembered as the preferred editing unit are: Units_type strings that my be used, but will not be remembered as the preferred editing units are:
Examples:
mged> units in
-- switch to editing in ``inches'' and remember this as the preferred editing units for this database

vars [variable=value]
The ``vars'' command, with no arguments, will list all the mged variables and their values. If a variable=value string is included on the command line, then that value is assigned to the specified variable. Note that no spaces are allowed around the ``=''. The available variables are:
Examples:
mged> vars sliders=1
-- turn on the sliders display

vdraw command [args]
The ``vdraw'' command allows the user to draw lines and polygons (optionally with per vertex normals) in the mged graphics display. Vdraw 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:

MGED Drawing Command Vdraw integer MGED Action
RT_VLIST_LINE_MOVE 0 begin a new line at this point
RT_VLIST_LINE_DRAW 1 draw line from previous point to this point
RT_VLIST_POLY_START 2 start polygon (argument is surface normal)
RT_VLIST_POLY_MOVE 3 move to first polygon vertex
RT_VLIST_POLY_DRAW 4 subsequent polygon vertices
RT_VLIST_POLY_END 5 last vertex of polygon (should be same as first)
RT_VLIST_POLY_VERTNORM 6 vertex normal (for shading interpolation)


The vdraw commands are:
All textual arguments may be abbreviated by their first letter.
Examples:
mged> vdraw open square
-- open a list named square
mged> vdraw params color ff00
-- set color to green
mged> vdraw write next 0 0 0 0
-- start a line at the origin
mged> vdraw write next 1 100 0 0
-- draw line to (100 0 0)
mged> vdraw write next 1 100 100 0
-- draw line to (100 100 0)
mged> vdraw write next 1 0 100 0
-- draw line to (0 100 0)
mged> vdraw write next 1 0 0 0
-- draw line to (0 0 0)
mged> vdraw show
-- draw the square in the mged display

view2model x y z
The ``view2model'' command converts the specified point (x y z) in view coordinates to model coordinates (mm). The part of view space displayed by mged is the cube -1.0 <= x,y,z <= +1.0.
Examples:
mged> view2model 1 1 0
-- list the model coordinates of the upper right corner of the mged display (in a plane at the center of the viewing cube).

viewget parameter
The ``viewget'' command displays various mged view parameters. The possible parameters are:
Examples:
mged> viewget center
-- list the model coordinates of the center of the mged viewing cube

viewset <parameter value>
The ``viewset'' command sets various mged view parameters. More than one parameter may be set with one command. The possible parameters are:
Examples:
mged> viewset center 1 2 3 size 100
-- set the model coordinates of the center of the mged viewing cube to the point (1 2 3) and set the size of the viewing cube to 100 mm

vrmgr host {master | slave | overview}
The ``vrmgr'' command establishes a link between the current mged display and a vrmgr process running on the specified host. The vrmgr program is a manager for virtual reality displays using mged. The vrmgr process must be started on host prior to executing the vrmgr command in mged. The second command line argument to the vrmgr command is the role of the current mged display. The master display controls the viewing parameters of itself and all the slave displays. The overview display acts as an observer of the entire virtual reality process.
Examples:
mged> vrmgr host1.arl.mil master
-- set the current mged display as the master for the vrmgr process running on the host named host1.arl.mil

vrot xrot yrot zrot
The ``vrot'' command rotates the view on the current geometry display window. The parameters xrot, yrot and zrot are rotations (specified in degrees) about the viewing coordinate axes.

If the display is in rotate­about­center mode then the rotation will occur about the center of the viewing volume. In rotate­aboute­eye mode The view on the display will be rotated about the eye. The vars command (or a menu button) allows the user to toggle between the two modes.

Examples:
mged> vrot 90 0 0
-- rotate 90 degrees about view X axis. Essentially a "look down".
mged> vrot 0 180 0
-- rotate 180 degrees about view Y axis. This is effectively "Look behind you".

wcodes file <objects>
The ``wcodes'' command writes ident, air code, material code, LOS, and name of all the regions in the list of objects to the specified file. The format used is compatible with the rcodes command.
Examples:
mged> wcodes code_file group1 group2
-- write region data for all the regions in group1 and group2 to code_file

whatid region_name
The ``whatid'' command lists the ident number of the specified region.
Examples:
mged> whatid regiona
-- get the ident number for regiona

which_shader <shaders>
The ``which_shader'' command lists all the regions that use one of the shaders specified.
Examples:
mged> which_shader plastic light
-- list all regions in the current database that use the plastic or light shaders

whichair <air_codes>
The ``whichair'' command lists all the regions that use one of the air_codes specified. The eac command will perform a similar search, but will draw the qualifying regions in the mged display rather than listing them. Regions that have non-zero ident numbers will not be listed by this command.
Examples:
mged> whichair 2 3
-- list all regions in the current database that have air codes of 2 or 3

whichid <idents>
The ``whichid'' command lists all the regions that use one of the idents specified.
Examples:
mged> whichid 1002 1003
-- list all regions in the current database that have idents of 1002 or 1003

who [real | phony | both]
The ``who'' command lists the top-level objects that are currently displayed. The phony flag asks for just phony objects. Phony objects are typically objects that are drawn in the mged display, but are not actual database objects. Some phony objects are drawings from the vdraw command and the edgeuses drawn by the ev -u command. The real flag asks for just real objects, and the both flag asks for both real and phony objects. The default is just real objects. Any of the flags may be abbreviated by its first letter. The x command also lists displayed solids, but in more detail.
Examples:
mged> who p
-- list all top level phony objects currently displayed

winset [pathName]
The ``winset'' command sets the current display manager to pathName. If pathName is not given, the current display manager is returned.
Examples:
mged> winset .my_window
-- .my_window is now the current display manager
mged> winset
-- returns the current display manager (i.e. .my_window)

wmater file <objects>
The ``wmater'' command lists the shader name and parameters, RGB color, RGB_valid flag, and the inheritance flag to the specified file for the listed objects. The format used is compatible with the rmater command. If file already exists, the new data is appended to it.
Examples:
mged> wmater mater_file group1 regiona
-- list the shader parameters of group1 and regiona to mater_file

x [level]
The ``x'' command lists all the primitive solids currently drawn in the mged display. The level determines how much detail should be included in the list. For level zero (the default), only a list of paths to solids in the display list is produced. Each solid is prefixed by ``VIEW'' or ``-no-'' indicating that the solid is actually being drawn or that is is being skipped respectively. If level is greater than zero, the center, size, ident number, RGB color assigned to the region, and the actual color used to draw the solid are also listed. If level is greater than one, the number of vlist structures and the number of points in each vlist structure are also listed for each solid. If level is greater than two, then the actual lines drawn for each solid are also listed. The who command performs a similar function, but lists only the top level objects that are displayed.
Examples:
mged> x
-- list the paths to the displayed solids.

xpush object
The ``xpush'' command ``pushes'' the effects of transformation matrices in the paths, from the specified object to the primitive solids, into the solids and replaces all the transformation matrices with identity matrices. The push command performs a similar function, but will refuse to make any changes if any solid needs to be transformed into more than one location/orientation/scale. The xpush command will recognize such situations and create extra copies of such solids to accept the different transformation effects. New solids created by this command will have a suffix appended to the original name to make the new name unique. Combinations referring to the new solid will also be modified to reflect the name change. The push command performs the same function, but will refuse to make any changes if it cannot accomplish the ``push'' without creating any new solids.
Examples:
mged> xpush group1
-- move all the effects of the transformation matrices in the tree rooted at group1 down to the solid level (creating new solids if needed).

zoom scale_factor
The ``zoom'' command changes the size of the viewing cube for the mged display, resulting in a ``zoom in'' or ``zoom out'' effect. A scale_factor greater than one reduces the size of the viewing cube (``zoom in''). A scale_factor of less than one increases the size of the viewing cube (``zoom out'').
Examples:
mged> zoom 2
-- Halve the size of the current viewing cube (effectively double the size of objects in the display).