MGED(1)
๐ mged(1) โ BRL-CAD's multi-display interactive combinatorial solid geometry editor ๐
okay so we're in manual section 1, the BRL-CAD zone, and this is the big one. buckle up bestie. ๐
๐ฆ NAME ๐ฆ
mged โ multi-display interactive combinatorial solid geometry editor. yes that's the whole name and yes she earned every word of it. ๐
โจ SYNOPSIS โจ
mged [options] [_database.g_ [_command_]]
๐ธ DESCRIPTION ๐ธ
MGED โ also known as the "Multi-Device Geometry Editor" โ is the central interaction environment for the whole BRL-CAD package. she gives you command line interactions and menu driven interactions, wireframe displays and integrated raytracing capabilities. she is the primary tool for BRL-CAD geometry creation and interactive manipulation. main character energy, no notes. ๐
MGED's history traces all the way back to the earlier "GED" (a.k.a. "Geometry Editor"), and a whole lot of GED's functionality is preserved in MGED to this day. a full description of MGED's abilities is genuinely beyond the scope of this document โ so the reader is being referred to Volumes II and III of the BRL-CAD Tutorial Series, available at http://brlcad.org, for a more comprehensive introduction. this document? it deals with the various options available when it comes to starting MGED. that's the assignment. ๐ซถ
The primary mode for modern MGED usage is the Tcl/Tk based environment, which offers menu support and a number of Tcl based tools. it is also possible to run more minimalist environments of terminal + framebuffer, and a terminal without any display window at all. and MGED also lets users execute single commands from the command line without starting any environment whatsoever, which is what makes things like scripting possible. some examples of that usage are chilling in the Examples section of this document. ๐
Technically, MGED can be opened without a database file being supplied โ but until one is supplied it will not be terribly useful, bestie. lowkey useless actually. ๐ญ this can be done either by supplying a file name on the command line, or by opening a database from within MGED using the File->Open... menu or the opendb command.
Options that affect per-session appearance (variables, grid, colour) are applied after any .mgedrc file is processed โ so command-line flags always take precedence over saved settings. the vibes on the command line win. periodt. โญ
๐ OPTIONS ๐
๐ฅ๏ธ Display and Mode ๐ฅ๏ธ
-a type,--attach typeโ specifies a display manager to automatically attach to when starting MGED.
Without specifying this option, MGED will prompt which display manager to attach during startup, like this:
attach (nu|X|ogl)[nu]?
The list of available display managers varies from platform to platform and across releases. commonly available options include the nu (NULL) display manager (starts without any graphical display at all), the X display manager (X11 wireframe display), and the ogl display manager (OpenGL wireframe display). pick your fighter. ๐ฅ
-d display,--display displayโ specifies which X server to connect to on platforms that have a running X11 server available. this option is an alternative to setting theDISPLAYenvironment variable. you can specify a local or remote display in X11HOST:PORTformat (e.g.,-d :0or-d host:0).--dm-type typeโ sets the display manager type to use (e.g.,ogl,X,swrast). this corresponds to themged_default(dm_type)Tcl variable used during GUI initialisation.--geom WxH+X+Yโ sets the command window geometry (position and size) in standard X geometry format (e.g.,--geom 800x600+0+0).--ggeom WxH+X+Yโ sets the graphics/geometry window geometry in standard X geometry format. same energy, different window. ๐ช
๐ Run Mode ๐
-b,--backgroundโ runs MGED as a background process, freeing the terminal from which it was started. off you go, live your life. ๐ฆ-c,--classicโ instructs MGED to start using classic mode instead of the default Tcl/Tk-based GUI. the-coption is often used when specifying an _mged_command_ to indicate that MGED is being run in a command-mode without a default GUI.-C,--guiโ instructs MGED to start in GUI (non-classic) mode. this is the default on platforms that support graphics.-p,--pipeโ enables pipe mode. in this mode MGED emits aMGED_CMD_DONE <status>sentinel to stdout after every command completes on stdin, making it suitable for use as a subprocess driven by an automated tool. robotic bestie behaviour, honestly iconic. ๐ค-r,--read-onlyโ opens thedatabase.gfile in read-only mode. look, don't touch. ๐
๐ rc File Control ๐
--rcfile fileโ loads _file_ instead of the default.mgedrcduring startup. this overrides theMGED_RCFILEenvironment variable.--no-rcโ skips loading any.mgedrcfile entirely, providing a clean-slate session unaffected by personal settings. useful for automated testing and scripted invocations. fresh start, no baggage. โจ
๐๏ธ Variable Override Escape Hatches ๐๏ธ
--set VAR=VALUEโ sets an MGED variable by name after.mgedrcis processed (e.g.,--set use_air=1). this provides access to anymged_vparse[]variable, including those not exposed as individual long options. may be repeated. โป๏ธ--rset ARGSโ passes arguments directly to the MGEDrsetcommand after.mgedrcis processed (e.g.,--rset "ax draw 1"). provides access to axes, full colour scheme, rubber-band, and any otherrsetresource. may be repeated.
๐จ Wireframe Appearance ๐จ
--linewidth #โ sets the wireframe line width in pixels (must be>= 1).--linestyle s|dโ sets the line style:sfor solid,dfor dashed. solid is the safe choice, dashed is for when you're feeling spicy. ๐ถ๏ธ--faceplate,--no-faceplateโ shows or hides the faceplate overlay.--dlist,--no-dlistโ enables or disables display lists for wireframe rendering.
๐ View and Interaction ๐
--perspective #โ sets the perspective angle in degrees. use-1to disable perspective (orthographic view).--eye-sep-dist #โ sets the stereo eye separation distance in millimeters. use0for monoscopic (non-stereo) rendering.--coords m|vโ sets the constraint coordinate system:mfor model space,vfor view space.--rotate-about m|v|eโ sets the center of rotation:mfor model origin,vfor view center,efor eye point.--transform v|a|eโ sets the mouse transform mode:vfor view,afor adc (angle/distance cursor),efor edit.--mouse-behavior v|a|eโ sets the mouse behavior mode.--perspective-mode 0|1โ enables (1) or disables (0) perspective mode.--sliders 0|1โ shows (1) or hides (0) the slider bars.--context 0|1โ enables (1) or disables (0) context-sensitive editing mode.--hot-key #โ sets the character code of the hot key used to switch the active display manager. ๐ฅ
๐ฌ๏ธ Air and Geometry Settings ๐ฌ๏ธ
--use-air,--no-use-airโ enables or disables theuse_airflag (controls whether air regions are included in ray-trace intersection lists).--nmg-eu-dist #โ sets the NMG edge-use distance tolerance.
๐ผ๏ธ Framebuffer ๐ผ๏ธ
--fb,--no-fb(via--set) โ use--set fb=1or--set fb=0to enable or disable framebuffer overlay.--fb-overlay 0|1|2โ sets the framebuffer overlay mode:0(framebuffer under geometry),1(interleaved),2(framebuffer over geometry).--port #โ sets the port number for the framebuffer server (0-65535).
๐ฎ View Predictor ๐ฎ
--predictor,--no-predictorโ enables or disables the view predictor (ghost image of predicted view during rotation). spooky but useful. ๐ป--predictor-advance #โ sets the predictor advance time in seconds.--predictor-length #โ sets the predictor trail length in seconds.
๐ Grid ๐
--grid-draw 0|1โ shows (1) or hides (0) the grid overlay.--grid-snap 0|1โ enables (1) or disables (0) snap-to-grid.--grid-rh #โ sets the horizontal grid resolution (model units).--grid-rv #โ sets the vertical grid resolution (model units).--grid-mrh #โ sets the number of minor grid intervals per major horizontal grid line.--grid-mrv #โ sets the number of minor grid intervals per major vertical grid line.
๐ Colour ๐
Colour values may be specified as three space-separated integers 0โ255 (R G B), as a slash-separated triplet (R/G/B), or as an HTML hex colour (#RRGGBB). three ways to say the same beautiful thing. ๐
--bg R G Bโ sets the background colour.--geo-color R G Bโ sets the default geometry wireframe colour.
๐ Debugging ๐
-x #,--rt-debug #โ sets the debug level for librt (hexadecimal integer).-X #,--bu-debug #โ sets the debug level for libbu (hexadecimal integer).
โน๏ธ Information โน๏ธ
-v,--versionโ displays version information and exits.-h,-?,--helpโ prints a brief help statement showing available options and exits.
๐๏ธ RC FILE ๐๏ธ
MGED searches for a startup configuration file (.mgedrc) in three locations, in order:
- If the environment variable
MGED_RCFILEis set, that path is used. - If the environment variable
HOMEis set,$HOME/.mgedrcis used. - If
.mgedrcexists in the current working directory, it is used.
The first file found is used and the others are ignored. use --rcfile to specify an explicit path, or --no-rc to skip rc file processing entirely.
Command-line options that affect MGED variables (all the long options listed above) are applied after the rc file is processed, so they always take precedence. your flags are the final boss. ๐
๐๏ธ SCRIPTING (BATCHING) MGED ๐๏ธ
Often it is convenient to generate a series of MGED commands outside MGED and then submit the command list to MGED, which will react as if each command were being manually entered within it. simply create a file (say, "cmds.txt") with each line being a desired command, and then have MGED execute the list. at the normal shell prompt, execute:
$ mged -c tgm.g < cmds.txt
Note that the procedure described above is very useful in rapid prototyping or automated TGM processing without resorting to low-level library programming in C or C++. look at you, scripting like a legend. ๐ง
For fully non-interactive scripted use, the --no-rc flag avoids loading any personal .mgedrc that could affect the session:
$ mged --no-rc -c --use-air --linewidth 2 model.g 'some_command arg'
๐ก HINTS ๐ก
- MGED database names conventionally end with
.g. that trailing.gis not optional vibes, it's the convention. ๐ SIGINTaborts the current command. Ctrl+C says "nvm, stop". ๐"q"or EOF exits the program.
๐ธ EXAMPLES ๐
okay bestie, these are all run from the operating system command prompt โ like, the actual shell, not inside MGED. watch and learn โจ
Example 1. Running the MGED l from the operating system command line.
this one is the classic "open the file and immediately list a thing" move ๐
user:~mged /usr/brlcad/share/brlcad/7.12.2/db/m35.g l component
Opened in READ ONLY mode
component: --
u bed
u frame
u cab
u suspension
u misc
u power.train
see how it says Opened in READ ONLY mode? that's your vibe check right there โ it opened the db but it is not letting you write anything ๐ and then it just dumps the members of component and dips.
Example 2. Running MGED without a display manager.
user:~mged -c
BRL-CAD Release 7.13.0 Geometry Editor (MGED)
Thu, 09 Oct 2008 22:31:41 -0400, Compilation 1
user@localhost:/usr/brlcad/
attach (nu|X|ogl)[nu]? nu
mged>
so -c = classic mode, and because you didn't tell it which display manager, it hits you with the attach (nu|X|ogl)[nu]? prompt. we typed nu, it accepted nu, and boom โ you're at the mged> prompt ๐
Example 3. Running MGED and bypassing the attach prompt by specifying the X11 display manager.
no prompt, no waiting, no thoughts โ just attach ๐ญ
user:~mged -a X -c
BRL-CAD Release 7.15.0 Geometry Editor (MGED)
Tue, 22 Sep 2009 12:40:01 -0400, Compilation 1
user@localhost:/usr/brlcad/
ATTACHING X (X Window System (X11))
mged>
notice the ATTACHING X (X Window System (X11)) line โ that's it confirming what you already told it with -a X. iconic, honestly ๐
Example 4. Running MGED with a custom background colour and no personal rc file (scripted use).
user:~mged โno-rc โbg 0 0 64 โuse-air -c model.g
three slays in one line: skip the personal rc file, set the background to 0 0 64, turn on air, and run classic with model.g loaded. scripted use = nobody's typing this repeatedly by hand, bestie ๐ซถ
Example 5. Setting an MGED variable not exposed as a dedicated option.
user:~mged โset eye_sep_dist=65 model.g
when there's no fancy flag for the thing you want, โset is your ride-or-die. here it's setting eye_sep_dist to 65 ๐
Example 6. Setting a grid resource via the rset escape hatch.
user:~mged โrset "g snap 1" โrset "g rh 10" model.g
two rset calls, two quoted resource strings โ "g snap 1" and "g rh 10" โ then model.g. that's the escape hatch doing exactly what an escape hatch does ๐ฅ
๐ SEE ALSO โจ
the reading list, the lore, the required texts ๐
- Computer Graphics for Target Descriptions, BRL Technical Report ARBRL-TR-02480
- GED: An Interactive Solid Modeling System for Vulnerability Assessments
and the actual man pages / library you might wanna go touch grass with:
๐ฉบ DIAGNOSTICS ๐
Error messages are intended to be self-explanatory.
that's literally the whole section. if it yells at you, the yell is supposed to make sense. no cap ๐
โ๏ธ AUTHOR ๐
BRL-CAD Team
ยฉ๏ธ COPYRIGHT ๐
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.
yes bestie, the whole range, 1989-2026, US Government, as represented by U.S. Army Research Laboratory. put some respect on it ๐ซก
๐ BUG REPORTS ๐
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org
found something cursed? don't suffer in silence, don't subtweet it โ email devs@brlcad.org ๐
and that's the whole page, bestie, you made it to the end ๐ง๐ this was BRL-CAD's MGED(1) โ the MGED manual, section 1 โ and yeah, the release numbers floating around in those examples were 7.12.2, 7.13.0 and 7.15.0, with dates like Thu, 09 Oct 2008 22:31:41 -0400 and Tue, 22 Sep 2009 12:40:01 -0400 just sitting there being historical ๐
now go model something gorgeous, mwah ๐
๐ฆ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms