code: function addShape( shape ) {
  
  		var i, l, shapeHole;
  
  		var indexOffset = vertices.length / 3;
  		var points = shape.extractPoints( curveSegments );
  
  		var shapeVertices = points.shape;
  		var shapeHoles = points.holes;
  
  		// check direction of vertices
  
  		if ( ShapeUtils.isClockWise( shapeVertices ) === false ) {
  
  			shapeVertices = shapeVertices.reverse();
  
  		}
  
  		for ( i = 0, l = shapeHoles.length; i < l; i ++ ) {
  
  			shapeHole = shapeHoles[ i ];
  
  			if ( ShapeUtils.isClockWise( shapeHole ) === true ) {
  
  				shapeHoles[ i ] = shapeHole.reverse();
  
  			}
  
  		}
  
  		var faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles );
  
  		// join vertices of inner and outer paths to a single array
  
  		for ( i = 0, l = shapeHoles.length; i < l; i ++ ) {
  
  			shapeHole = shapeHoles[ i ];
  			shapeVertices = shapeVertices.concat( shapeHole );
  
  		}
  
  		// vertices, normals, uvs
  
  		for ( i = 0, l = shapeVertices.length; i < l; i ++ ) {
  
  			var vertex = shapeVertices[ i ];
  
  			vertices.push( vertex.x, vertex.y, 0 );
  			normals.push( 0, 0, 1 );
  			uvs.push( vertex.x, vertex.y ); // world uvs
  
  		}
  
  		// incides
  
  		for ( i = 0, l = faces.length; i < l; i ++ ) {
  
  			var face = faces[ i ];
  
  			var a = face[ 0 ] + indexOffset;
  			var b = face[ 1 ] + indexOffset;
  			var c = face[ 2 ] + indexOffset;
  
  			indices.push( a, b, c );
  			groupCount += 3;
  
  		}
  
  	}
docs: helper functions