mbostock/d3 — pull request #916 by jasondavies (2012-11-20 22:24:50+00:00)
Title: Improve Polygon clipping.

1. We no longer perform an equality check on GeoJSON polygon endpoints, since we know that the first and last points should be equal.
2. However, there are special cases where a polygon just touches the clip edge, generating two coincident intersection points. Here we avoid generating a coincident point, and continue as normal.
3. Another special case is where we have coincident intersection points e.g. due to a self-intersecting polygon. Here we continue calculating the winding number as if this is a closed polygon (so we know whether to insert a polygon around the whole clip edge).