-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayground.py
More file actions
37 lines (24 loc) · 908 Bytes
/
playground.py
File metadata and controls
37 lines (24 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import argparse
import pathlib
import pcbenv
##################################
# Parse command line arguments ###
##################################
# -t Load tracks
# <board> A board file (.kicad_pcb or .json)
args = argparse.ArgumentParser()
args.add_argument("-t", action='store_true', help="Load tracks", default=False)
args.add_argument("board", type=str, nargs='?', help="Path to board file (json or kicad_pcb).", default="data/boards/PCBBenchmarks-master/bm1/bm1.unrouted.kicad_pcb")
args = args.parse_args()
path = str(pathlib.Path(args.board).absolute())
##########################################
# Create and use an environment instance #
##########################################
env = pcbenv.make()
print("Opening board", path)
# Load PCB
env.set_task({ "pdes": path, "load_tracks": args.t })
# Open GUI window (if available)
env.render("human")
# Wait for user actions
input("")