def polygon_load(filename):
 ret = []
 f = open(filename)
 for line in f:
  if line.startswith('#'):
   continue
  line = line.strip()
  if (not line):
   continue
  a = line.split()
  if (len(a) != 2):
   raise RuntimeError(('invalid polygon line: %s' % line))
  ret.append((float(a[0]), float(a[1])))
 f.close()
 return ret

def polygon_load ( filename ) : ret = [ ] f = open ( filename ) for line in f : if line . startswith ( '#' ) : continue line = line . strip ( ) if ( not line ) : continue a = line . split ( ) if ( len ( a ) != 2 ) : raise RuntimeError ( ( 'invalid polygon line: %s' % line ) ) ret . append ( ( float ( a [ 0 ] ) , float ( a [ 1 ] ) ) ) f . close ( ) return ret
load a polygon from a file .