OTRANSLATE(nged)

translate a database object by a displacement vector

πŸ“… published 7.44.0, from nixpkgs unstable

okay so this is the OTRANSLATE(nged) page from the BRL-CAD User Commands set, and bestie, it’s literally the β€œmove a whole database object” manual. πŸ’…βœ¨

🌸 NAME 🌸

otranslate β€” translate a database object by a displacement vector. πŸ¦‹

⭐ SYNOPSIS ⭐

otranslate obj dx dy dz

πŸ’– DESCRIPTION πŸ’–

Okay so otranslate translates the database object obj by the displacement vector (dx, dy, dz) in local units. The object’s geometry is modified and written back to the database. Main character direct-edit energy, no cap. πŸ’…

The displacement vector is converted from local units to base units (millimeters) internally via dbi_local2base before the translation matrix is constructed. That means the values supplied must always be in the current database local unit (e.g. inches, millimeters). No sneaky unit mixing, okay? 🫢

The translation matrix (dmat) is built using MAT_DELTAS_VEC and then composed with the object’s path transform so that the displacement is applied correctly in model space regardless of any parent combination transformations. The transform pipeline used is:

emat = invXform Γ— dmat Γ— xform

The resulting effective matrix is applied to the object’s internal representation via GED_DB_GET_INTERN, and the modified object is written back with GED_DB_PUT_INTERN.

🌟 Plot twist: unlike translate, otranslate applies the displacement to the object directly, not to the path matrix. That’s the whole difference, and it ate. πŸ’…

🧚 EXAMPLES 🧚

Example 1. Translate an object along the X axis

mged> otranslate box.s 50 0 0

Moves box.s 50 local units in the positive X direction. Slay. ✨

Example 2. Translate diagonally

mged> otranslate part.s 10 -5 20

Displaces part.s by the vector (10, -5, 20) in local units, moving it simultaneously along all three axes. Diagonal icon behavior. 🌈

Example 3. Move an object back to the origin neighborhood

mged> otranslate widget.s 0 0 -100

Moves widget.s 100 local units in the negative Z direction. Bye-bye, Z. 🌸

πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” iconic. πŸ’–

πŸ› BUG REPORTS πŸ›

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. Do it, bestie β€” the maintainers want the tea. β˜•


Source/version + date sign-off: BRL-CAD, page OTRANSLATE(nged). There’s no date on the footer, so that’s the whole story β€” no date shown, periodt. πŸ«ΆπŸ’–

πŸ“¦ where this page comes from