cut contour at border