code: function polygonSlice(polygon, cutEdges){
      if(cutEdges.length === 0){
  		return [polygon];
      }
      if(cutEdges instanceof Array && cutEdges.length && cutEdges[0] instanceof Array && cutEdges[0].length===2 && cutEdges[0][0] instanceof Array){
  
          var polys = [polygon];
  
          for(var i=0; i<cutEdges.length; i++){
              var cutEdge = cutEdges[i];
              // Cut all polys
              for(var j=0; j<polys.length; j++){
                  var poly = polys[j];
                  var result = polygonSlice(poly, cutEdge);
                  if(result){
                      // Found poly! Cut and quit
                      polys.splice(j,1);
                      polys.push(result[0],result[1]);
                      break;
                  }
              }
          }
  
          return polys;
      } else {
  
          // Was given one edge
          var cutEdge = cutEdges;
          var i = polygon.indexOf(cutEdge[0]);
          var j = polygon.indexOf(cutEdge[1]);
  
          if(i !== -1 && j !== -1){
              return [polygonCopy(polygon, i,j),
                      polygonCopy(polygon, j,i)];
          } else {
              return false;
          }
      }
  }
docs: Slices the polygon given one or more cut edges. If given one, this function will return two polygons (false on failure). If many, an array of polygons.
  @method slice
  @param {Array} cutEdges A list of edges, as returned by .getCutEdges()
  @return {Array}