GDS pattern extraction for inverse designed devices using contours method