MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / parse_args

Function parse_args

scripts/box_gen.py:14–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12from pymesh import save_mesh
13
14def parse_args():
15 parser = argparse.ArgumentParser(description=__doc__);
16 parser.add_argument("-s", "--symmetric", help="symmetric tet connectivity",
17 action="store_true");
18 parser.add_argument("--dim", help="mesh dimention", choices=[2, 3],
19 default=3, type=int);
20 parser.add_argument("--size", help="box size", type=float, default=10);
21 parser.add_argument("-X", help="X size", type=float, default=None);
22 parser.add_argument("-Y", help="Y size", type=float, default=None);
23 parser.add_argument("-Z", help="Z size", type=float, default=None);
24 parser.add_argument("--num-samples",
25 help="number of samples along each dimention", type=int, default=2);
26 parser.add_argument("--num-samples-X", help="X samples", type=int, default=None);
27 parser.add_argument("--num-samples-Y", help="Y samples", type=int, default=None);
28 parser.add_argument("--num-samples-Z", help="Z samples", type=int, default=None);
29 parser.add_argument("--subdiv", help="subdivision order", type=int,
30 default=0);
31 parser.add_argument("--with-hex", action="store_true",
32 help="Use hex to build the 3D box, by default tet is used.");
33 parser.add_argument("--with-quad", action="store_true",
34 help="Use quad to build the 2D box, by default triangle is used.");
35 parser.add_argument("output", help="output_mesh");
36 args = parser.parse_args();
37 return args;
38
39def main():
40 args = parse_args();

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected