Function S2Polygon.intersectWithPolyline

Intersect this polygon with the polyline "in" and return the resulting zero or more polylines. The polylines are returned in the order they would be encountered by traversing "in" from beginning to end. Note that the output may include polylines with only one vertex, but there will not be any zero-vertex polylines.

s2.s2polyline.S2Polyline[] intersectWithPolyline (
  in const(s2.s2polyline.S2Polyline) a
);

This is equivalent to calling ApproxIntersectWithPolyline() with the "snap_radius" set to S2::kIntersectionMergeRadius.