EDIT TRANSLATE(nged)
NAME
edit translate - Translates the positions of objects, using coordinates, offsets, and objects as reference points.
DESCRIPTION
Used to move one or more instances of primitive or combination objects. The positions of objects are translated from from to to.
See the edit command’s manual for more information.
EXAMPLES
> edit translate -k 0 0 0 -a . obj1 obj2 obj3 obj4 obj5
Moves every instance of each obj[1-5] in the same direction and by the same distance it is from the origin. The result is a (rather inflexible) "explosion" of the objects from the origin.
> edit translate -a -z obj1 obj2 obj3 obj4 obj5
The from point defaults to the bounding box center of the first target object, which is obj2. Every instance of objects obj2 - obj5 is moved from obj2 to the z-axis of obj1. If the z-coordinate of from was 7, and the z-coordinate of to was 5, then each object would move -2 units in the z-axis.
> edit translate -k . -a -z obj1 obj2 obj3 obj4 obj5
Sets the elevation of obj[2-5] to the elevation of obj1. Each object uses its own bounding box center as the from point in an operation that moves to the bounding box center of obj1.
> edit translate -k . -a obj1 obj2 obj3 obj4 obj5
Each object uses its own bounding box center as the from point in an operation that moves to the bounding box center of obj1. All objects end up centered on obj2.
> edit translate -a -z 7.8 obj
Moves obj from its bounding box center to 7.8 on the z-axis.
> edit translate -n -k . -a . obj1 obj2 obj3
The objects are moved from their own natural origins to their own bounding box centers.
> edit translate -n -a -z obj2/obj3 obj1
Moves obj1 up or down from the elevation of its bounding box center to the apparent elevation of the natural origin of the instance of obj3 in obj2.
> edit translate -n -k obj1 -n -a -z obj2/obj3 obj1
> edit translate -n -k . -n -a -z obj2/obj3 obj1
> edit translate -a -x 8 -z 42 obj1/obj2/obj3
Moves the instance of ob3 in obj2 from the apparent bounding box center of obj3 as offset by obj1/obj2, to x=8, z=42, without moving in the y-axis. Note that this is not the same as -a 8 0 42. Also note that only the matrix of obj2 is modified. No matter the length of the path, only the combination containing the actual object being translated will be modified. If the only component of the path were obj3, then if obj3 were a primitive it would be modified or if obj3 were a combination the matrices of all objects it holds would be modified.
> edit translate -k obj1 -r -z 5 obj2
> edit translate -a -z obj1 0 0 5 obj2
These commands perform the same function. The z-coordinate of the bounding box center of obj2 is moved to the z-coordinate of the bounding box center of obj1 plus 5 units.
> edit translate -k -x c/obj1 1.5 -y c/obj2 0 3 -z c/obj3 0 0 10 -a -x b/c/obj4 2 -y b/c/obj5 0 4 -z b/c/obj6 0 0 20 obj7 obj8
Every use of translate involves a from point and a to point. One of the more flexible features of the edit commands is the capability to use an object and an offset to specify each axis of these points individually. The command in this example can be broken down to three simpler commands, in order to ease comprehension:
> edit translate -k -x c/obj1 1.5 -a -x b/c/obj4 2 obj7 obj8
> edit translate -k -y c/obj2 0 3 -a -y b/c/obj5 0 4 obj7 obj8
> edit translate -k -z c/obj3 0 0 10 -a -z b/c/obj6 0 0 20 obj7 obj8
In the first shortened command, the from point is set to the x-coordinate of the apparent point of the bounding box center of the instance of obj1 in combination c, plus 1.5. The to point is set to the x-coordinate of the apparent point of the bounding box center of the specific instance of obj4 in combination c in combination b, plus 2. Both obj7 and obj8 move from from to to, ending up the same relative distance from each other.The other shortened commands are similar.
By splitting the larger command, an interesting detail was revealed. In the larger command, every point was set explicitly, so none defaulted. In the first shortened command, the y and z from values default to the bounding box center of obj7. Since the y and z to values default to the values set by from, neither obj7 nor obj8 will move in the y or z axes.
COPYRIGHT
This software is Copyright (c) 1989-2021 by the United States Government as represented by U.S. Army Research Laboratory.
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org