MGED Quick Reference Card: N L N L N L ' ' '
MGED Quick Reference Card: N L N L N L ' ' '
(for version 7.x) With non-classic MGED, right-clicking most labels and input fields will provide a description.
Additionally, documentation is provided via the Help menu and on-line at http://brlcad.org/
delete object(s) and all references killall obj ... is file generally contains defaults set by the GUI but may also include your own customizations
’ ’ ’ delete object(s), all sub-objects, all references killtree obj ... including new commands, shortcuts, loadable plugin modules, and custom key bindings.
Editing Geometry Text File & Table Editing Groups
(aka Assemblies)
MGED is a modal editor (akin to “vi”) meaning that you have to enter and exit various editing Several commands in MGED utilize an external text editor, determined from your environment
modes. e primary mode states related to editing are VIEWING (default), SOLEDIT, and EDITOR setting, to edit object values. Depending on your shell, you may need to set your EDI- Groups are simply unions, i.e. collections, of other groups
OBJEDIT. Some commands are only valid in certain modes or change behavior based on mode. TOR environment variable before invoking MGED. Bash example: export EDITOR=pico or regions.
visually illuminate & select combination ill comb edit a combination using a text editor red comb ... Regions
visually illuminate & select solid primitive sill prim edit the region identifier codes for object(s) edcodes comb ... (aka Parts)
enter object-illuminate mode press oill edit the combination/region materials edmater comb ... Regions are CSG operations (i.e. union,
intersection, and difference) on non-region
get the current editing state status state print the color table prcolor combinations and primitives.
edit a primitive (enter solid edit mode) sed prim edit the color table codes edcolor
Primitive Shapes
edit a matrix (enter object edit mode) oed lpath rpath read/import region identifier codes from file rcodes file
(aka Solids)
add object reference to existing combination i obj comb write region identifier codes to file wcodes file obj ...
remove object reference(s) from combination rm comb obj ... read combination materials from file rmater file
Attributes
set/get the center of editing transformation keypoint x y z write combination materials to file wmater file obj ...
manipulate an object’s matrix or material arced path cmd write report of primitive solids to file solids file obj ... In BRL-CAD geometry database files, “attributes” may be used to store arbitrary information, i.e.
metadata, on an object. Attributes may be applied to any object in the database.
copy the matrix on one object to another copymat path1 path2
select matrix path when in pick mode matpick path1 path2 Manipulating the View display current attributes for object(s) attr show obj ...
set a matrix on a given path putmat path m0 ... m16
get/set the various view parameters view set the specified attribute on an object attr set obj atr val
apply all matrix transformations down to the primitives push obj ...
automatically resize/recenter the view autoview append the specified attribute value attr append obj a v
same as push but creates new primitives as needed xpush obj ...
redraw the current view refresh modify an object attribute(s) adjust obj atr nval
e geometry editing commands below including the commands related to translation, scaling, set the azimuth, elevation, and twist ae az el tw delete an object attribute attr rm obj atr
and rotation require that MGED be in an edit mode before they can be utilized. e commands
set/get the view center center x y z interactively set visual material properties mater comb
implicitly apply to the objects currently selected (e.g. with ‘sed’ or ‘oed’) for editing.
set/get the eye point eye_pt x y z set object color (red, green, and blue values) comb_color obj R G B
set parameter(s) for current edit operation p val ... set/get the viewing direction lookat x y z get region identifier code for specified region whatid region
return to viewing mode, accept any edits accept set/get the view size size size list all regions using particular shader(s) which_shader shdr ...
return to viewing mode, rejecting any edits reject zoom the view by specified scale factor zoom scale identify regions with specified air code(s) whichair code ...
edit selected primitive using a text editor ted set the perspective viewing angle set perspective angle identify regions with specified region id(s) whichid id ...
edit the face of selected arb interactively facedef face translate/move the view relative to current tra dx dy dz incrementally set region id on all regions referenced by object reid obj #
mirror selected arb face across x, y, or z axis mirface face axis scale the view size by given factor sca factor set material id on all regions referenced by object remat obj #
permute the vertices of selected arb permute 8vertices rotate the view by x, y, z degrees rot x y z
rotate view about a specified model vector mrot x y z Scripting New Commands in MGED with Tcl
T M G rotate viewpoint by specified degrees vrot xdeg ydeg zdeg
echo, i.e. display or print, the provided text echo text
move object being edited to relative position tra dx dy dz set view using direction and twist angle qvrot dx dy dz angle
pause for the specified amount of time delay sec usec
move object being edited to absolute position translate x y z set view using x, y, z angles in degrees setview xdg ydg zdg
get combination CSG structure as a Tcl list lt object
pan the view sv x y
use shell-style name globbing set glob_compat_mode 1
S R G set the view orientation from quaternion orientation quat
use Tcl shell syntax evaluation set glob_compat_mode 0
scale primitive being edited sca factor emulate a knob twist knob params
scale combination object being edited oscale factor control the angle/distance cursor adc Here is an example of writing a custom command called ‘get_primitives’ that traverses over
all objects in a given combination, printing a list of all primitives encountered. For this example,
extrude arb face by some absolute distance extrude face dist save the current view orientation to a file saveview file.rt
glob_compat_mode is disabled (i.e. set to 0, not the default value of 1) so that there is no need to
load a saved view orientation from a file loadview file.rt escape various characters with a preceding “\” slash.
R G save current wireframe to a Postscript file ps file.ps
set glob_compat_mode 0
rotate primitive being edited rot x y z save current wireframe to a UNIX plot file plot file.pl proc get_primitives {object} {
rotate combination object being edited orot x y z overlay a UNIX plot file onto the display overlay file.pl set children [lt $object]
set prims ““
rotate angle degrees about an arbitrary axis arot x y z angle if { $children != ““ } {
incrementally rotate combination object rotobj -i dx dy dz Analyzing Geometry foreach node $children {
set name [lindex $node 1]
rotate combination about vector qorot x y z dx dy dz angle set data [db get $name]
use provided planar coefficients when rotating arb face eqn A B C analyze the faces of an ARB analyze arbname if { [lindex $data 0] != “comb“ } {
set prims [concat $prims $name]
rough estimate of presented area area } else {
set prims [concat $prims [get_primitives $name]]
BRL-CAD Coordinate Systems trace single ray from current view or x, y, z nirt x y z
scanlines (image height)
}
trace single ray from x, y position vnirt x y }
}
BRL-CAD uses a right-hand 3D Cartesian coordinate system get/set query_ray behavior settings qray return “$prims“
with real number addressing where “up” is in the positive z-axis
(+Z) direction, “left” and “right” are perpendicular to the y-axis,
check for overlaps (aka interferences) rtcheck }
Copyright (c) 2006 United States Government
and “front” is towards the positive x-axis (+X) direction. compute view-dependent surface areas rtarea MGED Quick Reference Card version 4 for BRL-CAD version 7, June 2006
get/set MGED calculation tolerances tol designed by Christopher Sean Morrison
BRL-CAD uses a first-quadrant 2D Cartesian coordinate system
with integer addressing where (0,0) is the lower-left corner pixel Permission is granted to make and distribute copies of this card provided the copyright notice, the
and (width-1,height-1) is the top-right pixel in an image. (0,0) pixels per scanline (image width) designed by notice, and this permission statement are preserved on all copies.