OCENTER(nged)
get or set the center point of an object's bounding box
π OCENTER(nged) β the get-or-set bounding-box center queen π
okay so bestie, welcome to ocenter from the BRL-CAD user commands (nged fam), and honestly? it's giving main character energy for a two-line command. let's get into it β¨
β¨ NAME β¨
ocenter β get or set the center point of an object's bounding box π―
π¦ SYNOPSIS π¦
ocenter object
ocenter object x y z
like, either you're just asking a question, or you're rearranging furniture. two vibes, one command π
πΈ DESCRIPTION πΈ
The ocenter command gets or sets the bounding-box center of the specified object. simple as that, no cap π«Ά
With one argument, ocenter computes the axis-aligned bounding box of object and returns the center point as a space-separated x y z triplet in the current working units. just a lil read-only peek, she's not touching anything π
With four arguments (object x y z), ocenter moves the object so that its bounding-box center coincides with the specified point (x, y, z) in model coordinates. and here's the important part, bestie β the move is applied by modifying the object's own geometry, not by adding a transformation to a parent combination. no sneaky wrapper prim, no parent combo doing the heavy lifting. the object is updated directly in the database. it's giving "no middleman" energy π₯
Coordinates are in the current working units. always. don't forget or she'll gaslight you π
β οΈ Note: the bounding-box center is computed from the axis-aligned bounding box of the object, which may not coincide with the geometric centroid for asymmetric shapes. so if your shape is lopsided, the "center" is the box's center, not the vibe's center. just so we're clear π
π EXAMPLES π
Example 1. Get the bounding-box center of an object
mged> ocenter hull.s
Returns the center of hull.s's bounding box in working units, for example: 0 0 250. cute, quick, no drama π
Example 2. Move an object's center to the origin
mged> ocenter wheel.s 0 0 0
Moves wheel.s so its bounding-box center is at the model origin (0, 0, 0). centering era π
Example 3. Center an object on an axis
mged> set c [ocenter part.s] mged> ocenter part.s 0 0 [lindex $c 2]
Retrieves the current center, then moves part.s so its center is on the Z axis (X=0, Y=0) without changing its Z position. look at her go, preserving Z like a queen π
π§ SEE ALSO π§
center(nged)translate(nged)bb(nged)
the whole friend group, honestly π«Ά
π AUTHOR π
BRL-CAD Team β icons, legends, the blueprint π
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β yes, actual email, we love a retro moment π
okay that's the whole page bestie, go center something β¨π
BRL-CAD made this one, and it's the OCENTER(nged) manual page β that's the version + date energy right there, no cap π
π¦ 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