GRID(nged)

control the display grid and snap-to-grid behavior

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ‘‘ 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: 0 or 1. Enable (1) or disable (0) grid display. With no value, returns current draw state.
  • snap β€” value: 0 or 1. 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