#!/usr/bin/env python
from proteus.EGeometry import *
from proteus.InputTranslators import GF
import optparse
"""
Convert a gf vessel description to a piecewise linear complex (poly file)
"""

usage = "usage: %prog [option] iparseinput_file"
parser = optparse.OptionParser(usage=usage)
parser.add_option("-s", "--section",
                  help="Look at a single section",
                  action="store",
                  type="int",
                  dest="sN_restrict",
                  default=-1)
parser.add_option("-b", "--boundingBox",
                  help="Put in a box",
                  action="store_true",
                  dest="boundingBox",
                  default=False)
parser.add_option("-t","--thin_rtol",
                  help="Eliminate sections that are thin along the longitudinal axis",
                  action="store",
                  type="float",
                  dest="thin_rtol",
                  default=0.01)
(opt,args) = parser.parse_args()
if len(args) != 1:
   print args
   raise RuntimeError("Must specify single input file")
gf = GF(args[0],
        opt.boundingBox,
        opt.thin_rtol,
        opt.sN_restrict)

