docs: function(seg, options) {
          var edge = !(options && options.edge === false);
          var tolerance = options && options.tolerance;
          var lines = [];
          var verts = this.getVertices();
          var points = [];
          var intersections = [];
          var split = false;
          var vert1, vert2, point;
          var node, vertex, target;
          var interOptions = {point: true, tolerance: tolerance};
          var result = null;
          for(var i=0, stop=verts.length-2; i<=stop; ++i) {
              vert1 = verts[i];
              points.push(vert1.clone());
              vert2 = verts[i+1];
              target = {x1: vert1.x, y1: vert1.y, x2: vert2.x, y2: vert2.y};
              point = OpenLayers.Geometry.segmentsIntersect(
                  seg, target, interOptions
              );
              if(point instanceof OpenLayers.Geometry.Point) {
                  if((point.x === seg.x1 && point.y === seg.y1) ||
                     (point.x === seg.x2 && point.y === seg.y2) ||
                     point.equals(vert1) || point.equals(vert2)) {
                      vertex = true;
                  } else {
                      vertex = false;
                  }
                  if(vertex || edge) {
                      // push intersections different than the previous
                      if(!point.equals(intersections[intersections.length-1])) {
                          intersections.push(point.clone());
                      }
                      if(i === 0) {
                          if(point.equals(vert1)) {
                              continue;
                          }
                      }
                      if(point.equals(vert2)) {
                          continue;
                      }
                      split = true;
                      if(!point.equals(vert1)) {
                          points.push(point);
                      }
                      lines.push(new OpenLayers.Geometry.LineString(points));
                      points = [point.clone()];
                  }
              }
          }
          if(split) {
              points.push(vert2.clone());
              lines.push(new OpenLayers.Geometry.LineString(points));
          }
          if(intersections.length > 0) {
              // sort intersections along segment
              var xDir = seg.x1 < seg.x2 ? 1 : -1;
              var yDir = seg.y1 < seg.y2 ? 1 : -1;
              result = {
                  lines: lines,
                  points: intersections.sort(function(p1, p2) {
                      return (xDir * p1.x - xDir * p2.x) || (yDir * p1.y - yDir * p2.y);
                  })
              };
          }
          return result;
      }