Slice a rectangle into subrectangles, like a cookie-cutter