CENTER(nged)

Positions the center of the mged viewing cube at the specified model coordinates. Without arguments, returns the current center.

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’– CENTER(nged) πŸ’–

Okay bestie, gather β€˜round because this one is literally the main character of mged navigation. This is the center command from the BRL-CAD user commands fam, and it’s about to make your viewing cube moves absolutely iconic. No cap.

✨ NAME ✨

center β€” positions the center of the mged viewing cube at the specified model coordinates. And if you give it no arguments? It just returns the current center. Periodt. πŸ’…

🌈 SYNOPSIS 🌈

center [x y z]

πŸŽ€ DESCRIPTION πŸŽ€

So here’s the tea: center moves the center of the mged viewing cube to whatever model coordinates you tell it. It does this by moving the eye position, but β€” and this is key β€” it does not change the viewing direction. (The lookat command is the related function that changes the viewing direction without moving the eye location. They’re like sisters, but different vibes.) The coordinates you give are expected in the current editing units. And if those coordinates are the result of evaluating a formula, they get echoed back to you. If you don’t provide any coordinates, the current center coordinates get printed β€” in current editing units, not mm β€” and you can use them in subsequent calculations. See also the view command.

It is often convenient to use the center of the view when visually selecting key locations in the model for construction or animation. Why? Bestie, I’m so glad you asked:

  • There’s a visible centering dot on the screen.
  • Zoom and rotation are performed with respect to the view center.
  • The default center-mouse behavior is to move the indicated point to the view center.
  • The angle/distance cursors are centered by default.

This command provides the means to set and retrieve those values numerically. It’s giving utility, it’s giving precision, it’s giving β€œI know where I am in 3D space.” πŸ”₯

πŸ¦‹ EXAMPLES πŸ¦‹

The examples show the use of the center command to print coordinates of the center of the mged display, move the center of the mged display to a given point, set a Tcl variable to the display center coordinates, move the center point a given distance in a given direction, and update a vertex in the database to be located at the current center of view. Let’s go, one by one.

πŸ’« Example 1. Printing the coordinates of the center of the mged display.

mged>center

Prints out the coordinates of the center of the mged display. Literally just vibe-checking your current center.

πŸ’« Example 2. Moving the center of the mged display to a specified point.

mged>center 12.5 5.6 8.7

The center of the mged display is moved to the point (12.5, 5.6, 8.7). Slay.

πŸ’« Example 3. Set Tcl variable $oldcent to the display center coordinates.

mged>set oldcent [center]

Sets the Tcl variable $oldcent to the display center coordinates. So you can save it for later, iykyk.

πŸ’« Example 4. Move the center point a given distance in a given direction.

mged> set glob_compat_mode 0, mged> units mm, mged> eval center [vadd2[center] {2 0 0}]

Moves the center point 2 mm in the model + x direction. It’s giving vector math, it’s giving precision.

πŸ’« Example 5. Update the vertex of a shape in the database to be located at the current view center.

mged> units mm, mged> db adjust sphere.s V [center]

Updates the vertex of a shape in the database β€” specifically sphere.s V β€” to be located at the current view center. Chefs kiss. πŸ‘‘

πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team. The icons, the legends. We stan.

πŸ’Œ BUG REPORTS πŸ’Œ

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. Don’t be shy, bestie β€” if something’s not slaying, let them know.


Later bestie! πŸ’– This page is brought to you by the BRL-CAD fam, version CENTER(nged) β€” no cap, that’s the footer vibe. ✨🫢

πŸ“¦ where this page comes from