MGED(1)

๐Ÿ“ฆ
version 7.44.0 ยท 2 versions
, in nixpkgs unstable

๐Ÿ’… 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 the DISPLAY environment variable. you can specify a local or remote display in X11 HOST:PORT format (e.g., -d :0 or -d host:0).
  • --dm-type type โ€” sets the display manager type to use (e.g., ogl, X, swrast). this corresponds to the mged_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 -c option 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 a MGED_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 the database.g file in read-only mode. look, don't touch. ๐Ÿ™ˆ

๐Ÿ“„ rc File Control ๐Ÿ“„

  • --rcfile file โ€” loads _file_ instead of the default .mgedrc during startup. this overrides the MGED_RCFILE environment variable.
  • --no-rc โ€” skips loading any .mgedrc file 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 .mgedrc is processed (e.g., --set use_air=1). this provides access to any mged_vparse[] variable, including those not exposed as individual long options. may be repeated. โ™ป๏ธ
  • --rset ARGS โ€” passes arguments directly to the MGED rset command after .mgedrc is processed (e.g., --rset "ax draw 1"). provides access to axes, full colour scheme, rubber-band, and any other rset resource. may be repeated.

๐ŸŽจ Wireframe Appearance ๐ŸŽจ

  • --linewidth # โ€” sets the wireframe line width in pixels (must be >= 1).
  • --linestyle s|d โ€” sets the line style: s for solid, d for 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 -1 to disable perspective (orthographic view).
  • --eye-sep-dist # โ€” sets the stereo eye separation distance in millimeters. use 0 for monoscopic (non-stereo) rendering.
  • --coords m|v โ€” sets the constraint coordinate system: m for model space, v for view space.
  • --rotate-about m|v|e โ€” sets the center of rotation: m for model origin, v for view center, e for eye point.
  • --transform v|a|e โ€” sets the mouse transform mode: v for view, a for adc (angle/distance cursor), e for 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 the use_air flag (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=1 or --set fb=0 to 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:

  1. If the environment variable MGED_RCFILE is set, that path is used.
  2. If the environment variable HOME is set, $HOME/.mgedrc is used.
  3. If .mgedrc exists 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 .g is not optional vibes, it's the convention. ๐Ÿ“
  • SIGINT aborts 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


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