flatten3dArrayTo(array, target) {
    let offset = 0;
    for (let z = 0; z < array.length; z++) {
      for (let y = 0; y < array[z].length; y++) {
        target.set(array[z][y], offset);
        offset += array[z][y].length;
      }
    }
  }
Puts a nested 3d array into a one-dimensional target array
@param {Array|*} array
@param {Float32Array|Float64Array} target