# get the contour path, which is made up of segments # paths = contour.collections[0].get_paths() paths = contour.get_paths() # extract all the vertices pts = [path.vertices for path in paths] # ...