code: function (geometry, shallow) {
          if (!geometry) {
              return null;
          }
          var data = {
              metadata : util$1.extend({}, META)
          };
          //transferable buffers
          var buffers = [];
  
          //dynamic
          data.dynamic = geometry.dynamic;
  
          //bounding box
          if (geometry.boundingBox) {
              data.boundingBox = {
                  min : geometry.boundingBox.min.toArray(),
                  max : geometry.boundingBox.max.toArray()
              };
          }
  
          //indices
          if (geometry.indices && geometry.indices.length > 0) {
              data.indices = copyIfNecessary(geometry.indices, shallow);
              buffers.push(data.indices.buffer);
          }
  
          //attributes
          data.attributes = {};
          for (var p in geometry.attributes) {
              if (geometry.attributes.hasOwnProperty(p)) {
                  var attr = geometry.attributes[p];
                  //ignore empty attributes
                  if (attr && attr.value && attr.value.length > 0) {
                      attr = data.attributes[p] = copyAttribute(attr, shallow);
                      buffers.push(attr.value.buffer);
                  }
              }
          }
  
          return {
              data : data,
              buffers : buffers
          };
      }
docs: Convert geometry to a object containing transferable data
  @param {Geometry} geometry geometry
  @param {Boolean} shallow whether shallow copy
  @returns {Object} { data : data, buffers : buffers }, buffers is the transferable list