translate = (offset, ...objects) => {
  if (!Array.isArray(offset)) throw new Error('offset must be an array')

  objects = flatten(objects)
  if (objects.length === 0) throw new Error('wrong number of arguments')

  // adjust the offset if necessary
  offset = offset.slice() // don't modify the original
  while (offset.length < 3) offset.push(0)

  const matrix = mat4.fromTranslation(mat4.create(), offset)

  const results = objects.map((object) => {
    if (path2.isA(object)) return path2.transform(matrix, object)
    if (geom2.isA(object)) return geom2.transform(matrix, object)
    if (geom3.isA(object)) return geom3.transform(matrix, object)
    return object
  })
  return results.length === 1 ? results[0] : results
}
Translate the given objects using the given options.
@param {Array} offset - offset (vector) of which to translate the objects
@param {...Object} objects - the objects to translate
@return {Object|Array} the translated object, or a list of translated objects
@alias module:modeling/transforms.translate

@example
const newsphere = translate([5, 0, 10], sphere())