function registerGeometry(name, definition) {
  var NewGeometry;
  var proto = {};

  // Format definition object to prototype object.
  Object.keys(definition).forEach(function expandDefinition(key) {
    proto[key] = {
      value: definition[key],
      writable: true
    };
  });
  if (geometries[name]) {
    throw new Error('The geometry `' + name + '` has been already registered');
  }
  NewGeometry = function () {
    Geometry.call(this);
  };
  NewGeometry.prototype = Object.create(Geometry.prototype, proto);
  NewGeometry.prototype.name = name;
  NewGeometry.prototype.constructor = NewGeometry;
  geometries[name] = {
    Geometry: NewGeometry,
    schema: processSchema(NewGeometry.prototype.schema)
  };
  geometryNames.push(name);
  return NewGeometry;
}
Registers a geometry to A-Frame.

@param {string} name - Geometry name.
@param {object} definition - Geometry property and methods.
@returns {object} Geometry.