Scanning of contours and holes