help=
    "change elevation of points with z=0, thus avoiding errors when interesecting with sea surface",
    type=float)
args = parser.parse_args()

if not args.objectname:
    base = os.path.basename(args.input_file)
    args.objectname = os.path.splitext(base)[0]
else:
    args.objectname = args.objectname[0]

structured_grid = Grid(args.input_file, args.subsample[0])
structured_grid.crop(args.crop)

if args.change_zero_elevation:
    structured_grid.change_zero_elevation(args.change_zero_elevation[0])
if args.smooth:
    structured_grid.smooth(args.smooth[0])

structured_grid.generate_vertex()

structured_grid.generate_connect()
structured_grid.isolate_hole(args.hole)
if args.proj:
    structured_grid.proj_vertex(args.proj[0])

if args.translate:
    structured_grid.translate(args.translate)

basename, ext = os.path.splitext(args.output_file)
nsolid = max(structured_grid.solid_id) + 1