Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Code Block
objarray translate <obj> <dx dy dz>

For arrays with x y z coordinates, sum a displacement dx dy dz to all array items (the object length must be multiple of 3)

Warning: the values of <obj> itself are modified, without creating another copy of the object

The array doesn't change its type, e.g. an array of integers increased by a real value will truncate the result again as integer.

e.g.

Code Block
set obj [objarray new doublearray -values {3.5 2.1 0.3 3.5 2.6 0.3}]
-> 3.5 2.1 0.3 3.5 2.6 0.3
objarray translate $obj {0.5 0.4 0.0}
-> 4.0 2.5 0.3 4.0 3.0 0.3