a low-level contour computation for matplotlib