EDIT_TRANSLATE(nged)

Translate (move) one or more objects in the database.

πŸ“… published 7.44.0, from nixpkgs unstable

Hey bestie, welcome to EDIT_TRANSLATE(nged) from the BRL-CAD User Commands fam. This is the page for edit translate and its alias edit tra β€” aka the move-it-move-it command. If you've ever wanted to yeet one or more objects to a new spot in the database, this is your girlie. πŸ’…βœ¨

🌸 NAME 🌸

edit translate, edit tra β€” translate (move) one or more objects in the database. Slay.

πŸ¦‹ SYNOPSIS πŸ¦‹

edit [options] geometry translate [-a|-r] [-x|-y|-z] [-k FROM] TO
edit [options] geometry translate [-a|-r] [-x|-y|-z] [-k FROM]
    {x [y [z]]} | {OBJECT}
edit [options] geometry tra X Y Z

where a TO or FROM argument has the form:

{x [y [z]]} | OBJECT_NAME | "."

πŸ’– DESCRIPTION πŸ’–

Bestie, this command is used to move one or more instances of primitive or combination objects to a new position. OBJECTs are translated by a vector from FROM to TO. It’s giving β€œglow-up but make it spatial.” πŸ¦‹

OFFSET_DIST is always a relative distance from the object’s current position. TO_POS may be either an absolute position (-a) or a relative distance (-r) from FROM. When no -k FROM is given, the relative mode operates directly on the object’s current keypoint β€” the bounding-box center by default. No cap.

Any *_OBJECT argument may be set to ., which causes each individual OBJECT to be used in its place β€” a batch operation if there is more than one OBJECT supplied on the command line. That’s the group-chat β€œall of y’all” energy. πŸ’–

The alias tra is a shorthand for translate -r and accepts exactly three coordinate values X Y Z with no flags. Periodt.

Global options (-S, -f, -F, -i) are described in edit(nged). Go check that page for the extra tea. β˜•

✨ OPTIONS ✨

  • -a β€” Interpret TO as an absolute position in model space. Required if TO is an object name rather than a coordinate vector. This is the default when -k FROM_OBJECT is given (i.e., the object is moved so that its FROM keypoint coincides with the TO position). Iconic absolute-position behavior. πŸ‘‘
  • -r β€” Interpret TO as a relative delta from the current keypoint or FROM position. This is the default when no -k is given. That’s the β€œjust nudge it a lil” mode. πŸŽ€
  • -x, -y, -z β€” Restrict the translation to the specified axis only. Only the nominated axis coordinate of TO is applied; the remaining axes stay at their current values. Multiple axis flags may be combined. Coordinate lock-in, iykyk. πŸ”’
  • -k FROM_COORDS | FROM_OBJECT β€” Set the reference keypoint (FROM position). FROM accepts:
    • A numeric coordinate triple x y z (1 or 2 values are broadcast to a 3-vector).
    • An object name β€” its bounding-box center is used.
    • The batch marker . β€” causes each target object to use its own current keypoint as FROM. Useful for per-object relative moves: translate -k . -a target.s aligns each object individually.
When -k is supplied together with a TO reference, the delta FROMβ†’TO is applied to the target object (rather than moving it to an absolute position directly). Big β€œreference point first, move second” behavior. πŸ’«
  • -n β€” Use the natural origin of *_FROM_OBJECT or *_TO_OBJECT rather than the default bounding-box center. Natural origin, not the default center β€” got it. 🌸
  • TO β€” The destination. May be:
    • A coordinate triple x y z (absolute if -a, relative if -r).
    • A single scalar combined with an axis flag (e.g., -a -z 7.8).
    • An object name (moves to that object’s keypoint; use -a for clarity).
    • The batch marker . β€” each target object uses its own current keypoint as TO. Combined with -k FROM_COORDS, this computes a per-object delta of (own_keypoint - FROM_COORDS), enabling an explosion-from-point effect. Literally boom. πŸ’₯

πŸ”₯ EXAMPLES πŸ”₯

The page marks this bit with == EXAMPLES, and honestly, the examples are the main characters. πŸ‘‘

Example 1. Translate sph.s to absolute position (15, 0, 0)

mged> edit sph.s translate -a 15 0 0

Example 2. Move sph.s by a relative delta of (+5, 0, 0)

mged> edit sph.s translate -r 5 0 0

Using the tra alias (always relative):

mged> edit sph.s tra 5 0 0

Example 3. Move sph.s from its center to other.s’s center (object-name form)

The -k sph.s -a other.s form computes the delta between the two keypoints and applies it:

mged> edit sph.s translate -k sph.s -a other.s

The same delta can also be specified with coordinate positions for -k:

mged> edit sph.s translate -k 10 0 0 -a other.s

Or with an explicit coordinate destination:

mged> edit sph.s translate -k 10 0 0 -a 20 0 0

Example 4. Align only the Z coordinate of obj to a target elevation of 7.8

mged> edit obj translate -a -z 7.8

Example 5. Align several objects to the same Z elevation β€” using a reference object

Set the Z coordinate of obj1 and obj2 to ref.s’s Z elevation while leaving X and Y unchanged:

mged> edit obj1 translate -a -z ref.s
mged> edit obj2 translate -a -z ref.s

The -a -z OBJ form extracts the Z component of ref.s’s keypoint (its bounding-box center) and applies it absolutely, keeping the target’s own X and Y. Multiple axis flags can be combined:

mged> edit obj1 translate -a -x -z ref.s

This copies both the X and Z of ref.s into obj1, leaving Y unchanged. Selective copy-paste but spatial. πŸŽ€

Example 6. Move a pair of objects away from the origin (explosion effect)

Each object is moved by a delta equal to its own current position vector, doubling its distance from the origin. Use the . batch marker as TO and 0 0 0 as FROM:

mged> edit sph.s translate -k 0 0 0 .
mged> edit other.s translate -k 0 0 0 .

For sph.s at (10,0,0): FROM=(0,0,0), TO=own_keypoint=(10,0,0), delta=(10,0,0), result=(20,0,0) β€” doubled distance from origin. Math ate. πŸ”₯

Equivalently with explicit deltas (when positions are known):

mged> edit sph.s translate -r 10 0 0
mged> edit other.s translate -r 20 0 0

Example 7. Move a set of objects so that the assembly origin aligns with target.s

mged> edit assembly translate -k assembly -a target.s

Example 8. Translate along a path (move a subpart without disturbing the parent)

Using a slash-separated path to name the instance:

mged> edit assembly/subpart/sph.s translate -r 0 0 10

Example 9. Use the intermediate buffer: translate tentatively, then revert if unsatisfied

Create a checkpoint (snapshot to revert to):

mged> edit tor.s checkpoint

Apply a tentative translation (stays in buffer only):

mged> edit -i tor.s translate -r 5 0 0

If satisfied, write to disk:

mged> edit tor.s translate -r 0 0 0

If not satisfied, roll back to the checkpoint:

mged> edit tor.s revert

Tentative vibes only until you commit. πŸ’…

Example 10. Operate on the active selection instead of naming objects explicitly

With objects already selected in the viewer:

mged> edit translate -a 10 0 0

Force the command-line specifier to override the selection:

mged> edit -f sph.s translate -a 10 0 0

πŸ‘‘ SEE ALSO πŸ‘‘

edit(nged), edit rotate(nged), edit scale(nged), translate(nged), ptranslate(nged)

πŸŽ€ AUTHOR πŸŽ€

BRL-CAD Team

πŸ’Œ BUG REPORTS πŸ’Œ

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org


Okurrr, footer sign-off time, bestie: source/version is BRL-CAD, manual name is EDIT TRANSLATE(nged), and there’s no date printed on this one β€” so that’s literally all the footer gives. Byeee πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from