0% found this document useful (0 votes)
47 views2 pages

MGED Quick Reference Card: N L N L N L ' ' '

This document provides a quick reference for commands and functions in the MGED geometry editor. It covers starting and stopping MGED, opening and saving files, getting help, viewing and modifying geometry, and rendering objects.

Uploaded by

catalin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views2 pages

MGED Quick Reference Card: N L N L N L ' ' '

This document provides a quick reference for commands and functions in the MGED geometry editor. It covers starting and stopping MGED, opening and saving files, getting help, viewing and modifying geometry, and rendering objects.

Uploaded by

catalin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MGED Quick Reference Card Getting Help

(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/

Starting & Stopping MGED obtaining help on all commands help


start MGED with default graphical user interface (GUI) mged obtaining help on a particular command help command
run MGED in classic console mode mged -c search for commands that relate to keyword apropos keyword
open geometry database file creating new if necessary mged file.g display command history for current session history
run a single MGED command on database mged -c file.g cmd record transcript of commands used to file journal file
quit MGED exit or quit or q list subset of various simulatable GUI actions press help

Files Geometry Information


Geometry database files in MGED are always automatically saved to disk after an edit is made. As list the top-level objects tops
such, performing a file “Save” operation manually is not necessary and is not provided by MGED. list the objects in currently open database ls
get a table of contents for current database t
open a new or existing geometry database opendb file.g
display the information details for object(s) l obj ...
close any open geometry database closedb cat obj ...
save a copy of the currently open database dump newfile.g get/set title of currently open database title
export objects from currently open database keep newfile.g obj ... get/set units of currently open database units
check if file contains duplicate object names dup file.g print out CSG hierarchy for object(s) tree obj ...
combine a geometry database into existing dbconcat file.g display combinations that reference object(s) dbfind obj ...
eliminate unused space from open database garbage_collect display full paths that reference object(s) dbfindtree obj ...
display version of currently open database dbversion list all CSG paths under given object(s) paths obj ...
upgrade currently open database to the latest dbupgrade show transformation matrices along a path showmats path
import data file as a binary object wdb_binary -i u c obj file list all regions referenced by object(s) get_regions obj ...
export binary object to a data file wdb_binary -o u c file obj display all regions with given air code(s) eac code ...
display counts of primitives, regions, groups summary p r g
BRL-CAD File Name Conventions save region identifier summary to file idents file obj ...
binary BRL-CAD geometry database files .g
ascii BRL-CAD geometry database files (deprecated) .asc
Creating Geometry
raw binary headerless 3-channel color image data files .pix interactively type in new object parameters in
raw binary headerless 1-channel grayscale image files .bw create a prototypical primitive object make type name
Displaying Geometry
extended UNIX 2D/3D color plot format files .pl create a CSG combination object comb name op obj ... display object(s) for editing e obj ...
raytrace command saveview shell script (text) files .rt c name obj op obj ... draw obj ...
create CSG region (aka “part”) combination r name op obj ... erase object(s) from the display d obj ...
Geometry Naming Conventions create group (aka “assembly”) combination g name obj1 obj2 ... erase obj ...
MGED imposes minimal restrictions on how geometric objects are named. It is up to the indi- create a region from a range of solids build_region prefix # erase any objects that reference object(s) dall obj ...
viduals and organizations to utilize consistent naming conventions when creating geometry. e create a shallow copy of an object cp obj objcopy erase_all obj ...
below object naming suffix convention is frequently utilized and recommended.
create deep patterned copies of objects clone “zap”: clear all objects from the display Z
rename an object mv old new “blast”: clear all objects & display object(s) B obj ...
groups / assemblies no suffix or .g
rename an object and all references mvall old new mark object(s) as “hidden” to hide from ‘ls’ hide obj ...
regions / parts .r
add a prefix to all references to an object prefix prefix obj unmark object(s) as “hidden” unhide obj ...
non-region combinations .c
create an arb8 with rotation and fallback arb rot fallback hierarchical geometry browser GUI tool geometree
primitive solid shapes .s
duplicate a cylinder, positioned at end or orig cpi cyl cylcopy
Constructive Solid Geometry Operations make a bounding box around object(s) make_bb name obj ... Rendering Geometry
mirror an object about the x, y, or z axis mirror obj new axis
Constructive Solid Geometry (aka Combinatorial Solid Geometry) is based on three mathematical create arb given 3 points, 2 coords of 4th, and thickness 3ptarb raytrace current view to a lingering window rt -F/dev/Xl
boolean operations: union, intersection, and difference (aka subtraction). ese operators are raytrace current view to 2048x2048 file rt -s2048 -o file.pix
applied to primitives to form compound objects in MGED using the “u”, “+” and “-” notation.
Consider the example of combining two primitive object shapes, n and l. e example below Deleting Geometry raytrace white background hidden-line image rtedge -W -o file.pix
shows the resulting CSG combination object when the two shapes are overlapping. abort any raytraces started within mged rtabort
MGED provides no direct means to recover deleted geometry, so delete objects with caution.
Union Intersection Difference Regularly performing geometry database backups (e.g. see the ‘dump’ command) is recommended.
Customization
n ul n +l n -l delete object(s) from database

kill obj ...


MGED will process a “.mgedrc” initialization file in your home directory as a sourced Tcl script.

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.

You might also like