| 13 | from time import time |
| 14 | |
| 15 | def parse_args(): |
| 16 | parser = argparse.ArgumentParser(__doc__); |
| 17 | parser.add_argument("--engine", help="Triangulation engine", choices=( |
| 18 | "triangle_conforming_delaunay", |
| 19 | "triangle_constrained_delaunay", |
| 20 | "cgal_constrained_delaunay", |
| 21 | "cgal_conforming_delaunay", |
| 22 | "geogram_delaunay", |
| 23 | "jigsaw_frontal_delaunay", |
| 24 | "mmg_delaunay", "triwild"), |
| 25 | default="triangle_conforming_delaunay"); |
| 26 | parser.add_argument("--resolve-self-intersection", "-r", action="store_true"); |
| 27 | parser.add_argument("--with-frame", '-f', action="store_true"); |
| 28 | parser.add_argument("--with-cell-label", "-l", action="store_true"); |
| 29 | parser.add_argument("--with-cleanup", "-c", action="store_true"); |
| 30 | parser.add_argument("--with-triangulation", "-t", action="store_true"); |
| 31 | parser.add_argument("--stage", type=int, default=1); |
| 32 | parser.add_argument("--epsilon", type=float, default=1e-3); |
| 33 | parser.add_argument("--log", type=str, help="Logging level", |
| 34 | choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], |
| 35 | default="INFO"); |
| 36 | parser.add_argument("--with-features", '-F', action="store_true", |
| 37 | help="TriWild specific option to preserve features"); |
| 38 | parser.add_argument("input_svg"); |
| 39 | parser.add_argument("output_mesh"); |
| 40 | return parser.parse_args(); |
| 41 | |
| 42 | def get_logger(level): |
| 43 | numeric_level = getattr(logging, level, None); |