src/mesh.js
/**
   * Calculate the bounding box of the mesh
   * @param  {Number} coordAttribute Index of the attribute representing vertex position
   * @return {Object}                An object consisting of two arrays of the same length
   *                                 as the coordinate attribute, representing min and max
   *                                 coordinates.
   */
Calculate the bounding box of the mesh
@param  {Number} coordAttribute Index of the attribute representing vertex position
@return {Object}                An object consisting of two arrays of the same length
as the coordinate attribute, representing min and max
coordinates.
Calculate the bounding box of the mesh @param { Number } coordAttribute Index of the attribute representing vertex position @return { Object } An object consisting of two arrays of the same length as the coordinate attribute representing min and max coordinates .
boundingBox(coordAttribute) {
    if(!this.bounds) {
      coordAttribute = coordAttribute === undefined ? 0 : coordAttribute;
      var bounds = {
        max: null,
        min: null
      };
      this.attributes.eachAttribute(coordAttribute, function(arr) {
        if(bounds.max) {
          bounds.max = bounds.max.map(function(e, i) {
            return Math.max(e, arr[i]);
          });
        } else {
          bounds.max = Array.prototype.slice.call(arr);
        }
        if(bounds.min) {
          bounds.min = bounds.min.map(function(e, i) {
            return Math.min(e, arr[i]);
          });
        } else {
          bounds.min = Array.prototype.slice.call(arr);
        }
      });
      this.bounds = bounds;
    }
    return this.bounds;
  }
boundingBox ( coordAttribute ) { if ( ! this . bounds ) { coordAttribute = coordAttribute === undefined ? 0 : coordAttribute ; var bounds = { max : null , min : null } ; this . attributes . eachAttribute ( coordAttribute , function ( arr ) { if ( bounds . max ) { bounds . max = bounds . max . map ( function ( e , i ) { return Math . max ( e , arr [ i ] ) ; } ) ; } else { bounds . max = Array . prototype . slice . call ( arr ) ; } if ( bounds . min ) { bounds . min = bounds . min . map ( function ( e , i ) { return Math . min ( e , arr [ i ] ) ; } ) ; } else { bounds . min = Array . prototype . slice . call ( arr ) ; } } ) ; this . bounds = bounds ; } return this . bounds ; }
Calculate the bounding box of the mesh
 @param  {Number} coordAttribute Index of the attribute representing vertex position
 @return {Object}                An object consisting of two arrays of the same length
                                 as the coordinate attribute, representing min and max
                                 coordinates.
Calculate the bounding box of the mesh @param { Number } coordAttribute Index of the attribute representing vertex position @return { Object } An object consisting of two arrays of the same length as the coordinate attribute representing min and max coordinates .