Function File: [olin, nlin] = clipPolyline_clipper (inlin, clippol)
Function File: [olin, nlin] = clipPolyline_clipper (inlin, clippol, op)

Clip (possibly composite) polylines with polygon(s) using one of boolean methods.

inpol = Nx2 matrix of (X, Y) coordinates constituting the polylines(s) to be clipped. Polyline sections are separated by [NaN NaN] rows. clippol = another Nx2 matrix of (X, Y) coordinates representing the clip polygon(s). clippol may comprise separate and/or concentric polygons (the latter with holes).

Optional argument op, the boolean operation, can be:

  • 0: difference inpol - clippol
  • 1: intersection ("AND") of inpol and clippol (= default)

Output array oline will be an Nx2 array of polyline sections resulting from the requested boolean operation.

Package: geometry