src/primitives.js
function expandRLEData(rleData, padding) {
  padding = padding || [];
  const data = [];
  for (let ii = 0; ii < rleData.length; ii += 4) {
    const runLength = rleData[ii];
    const element = rleData.slice(ii + 1, ii + 4);
    element.push.apply(element, padding);
    for (let jj = 0; jj < runLength; ++jj) {
      data.push.apply(data, element);
    }
  }
  return data;
}
function expandRLEData(rleData, padding) {
  padding = padding || [];
  const data = [];
  for (let ii = 0; ii < rleData.length; ii += 4) {
    const runLength = rleData[ii];
    const element = rleData.slice(ii + 1, ii + 4);
    element.push.apply(element, padding);
    for (let jj = 0; jj < runLength; ++jj) {
      data.push.apply(data, element);
    }
  }
  return data;
}
function expandRLEData ( rleData , padding ) { padding = padding || [ ] ; const data = [ ] ; for ( let ii = 0 ; ii < rleData . length ; ii += 4 ) { const runLength = rleData [ ii ] ; const element = rleData . slice ( ii + 1 , ii + 4 ) ; element . push . apply ( element , padding ) ; for ( let jj = 0 ; jj < runLength ; ++ jj ) { data . push . apply ( data , element ) ; } } return data ; }
Expands RLE data
@param {number[]} rleData data in format of run-length, x, y, z, run-length, x, y, z
@param {number[]} [padding] value to add each entry with.
@return {number[]} the expanded rleData
@private
Expands RLE data