GRID(nged)
control the display grid and snap-to-grid behavior
π GRID(nged) β the grid command, explained π
okay bestie so this is grid from the BRL-CAD User Commands era, and it's lowkey the main character of view alignment β¨
β¨ NAME β¨
grid β controls the display grid and the snap-to-grid behavior, together, slay π
π¦ SYNOPSIS π¦
grid vname parameter [value]
π DESCRIPTION π
ngl bestie, grid is the one running the view grid: that regular overlay of horizontal and vertical lines drawn on the display to help you with alignment and measurement. Iconic. It also controls snap-to-grid behavior, which constrains view center movement to the nearest grid intersection β so your view center literally cannot drift, it's giving obsessive, it's giving perfectionist π
The first argument vname is the name of the view to configure. The second argument parameter specifies which grid attribute to get or set. If a value is provided it sets the attribute; if omitted the current value is returned. Get or set, your choice, we contain multitudes π«Ά
πΈ Parameters πΈ
the original gives you a whole table here β I'm giving you the same info as a list because tables are not the vibe rn
colorβ value:r g b. Get or set the grid line color as three integers (0β255). With no value, returns current color. π¨drawβ value:0or1. Enable (1) or disable (0) grid display. With no value, returns current draw state.snapβ value:0or1. Enable (1) or disable (0) snap-to-grid. With no value, returns current snap state.rhβ value: float. Get or set the horizontal grid resolution (spacing) in the current working units.rvβ value: float. Get or set the vertical grid resolution (spacing) in the current working units.mrhβ value: integer. Get or set the major grid line interval (horizontal): a major line is drawn every N minor lines.mrvβ value: integer. Get or set the major grid line interval (vertical).vsnapβ value: (none). Snap the current view center to the nearest grid intersection. Takes no value argument.
π₯ EXAMPLES π₯
Example 1. Enable the grid
mged> grid default draw 1
Turns on grid display for the view named default. periodt β¨
Example 2. Set grid spacing to 10 mm
mged> grid default rh 10 mged> grid default rv 10
Sets horizontal and vertical grid spacing to 10 units in the current working units.
Example 3. Enable snap-to-grid
mged> grid default snap 1
Enables snap-to-grid for the default view. The view center will snap to the nearest grid point during interactive navigation. no cap, it really does π§
Example 4. Set grid color to green
mged> grid default color 0 200 0
Sets the grid line color to green (R=0, G=200, B=0). π
Example 5. Get the current horizontal resolution
mged> grid default rh
Returns the current horizontal grid resolution in working units, for example: 10.
Example 6. Snap view center to nearest grid point
mged> grid default vsnap
Moves the view center to the nearest grid intersection. so satisfying honestly π―
π SEE ALSO π
view(nged), center(nged) β go read those next, they're literally the friend group of this command π«Ά
π AUTHOR π
BRL-CAD Team β kings, honestly π
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. be a good citizen and tell them, they're not gonna know otherwise π
okay that's the whole page bestie!! mwah π β brought to you by BRL-CAD, and remember: GRID(nged) is the name, alignment is the game π
β¨
π¦ 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