-
Notifications
You must be signed in to change notification settings - Fork 0
/
epicycles.py
81 lines (76 loc) · 2.01 KB
/
epicycles.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""Draw various intricate shapes by adding rotating circles."""
import argparse
import os
os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "1"
from src import scene_manager
from src import constants
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"file",
help="Path to file containing the desired shape.",
default="",
nargs="?"
)
parser.add_argument(
"-n",
type=int,
metavar="<int>",
help="Limit the maximum number of circles.",
default=0
)
parser.add_argument(
"-s",
"--scale",
type=float,
metavar="<float>",
help="A number > 0 and <= 1 indicating how much of the width and " +
"height of the window the shape should occupy. To disable " +
f"scaling set it to 0. Defaults to {constants.DEFAULT_SCALE_FACTOR}.",
default=constants.DEFAULT_SCALE_FACTOR
)
parser.add_argument(
"-f",
"--fade",
action="store_true",
help="Fade the line color over time so that it vanishes after one cycle."
)
parser.add_argument(
"-r",
"--reverse",
action="store_true",
help="Reverse the rotation direction."
)
parser.add_argument(
"-p",
"--paused",
action="store_true",
help="Start the app paused."
)
parser.add_argument(
"-w",
"--window-size",
metavar=("<width>", "<height>"),
nargs=2,
type=int,
help="Specify a custom window width and height in pixels.",
default=constants.DEFAULT_WINDOW_SIZE
)
parser.add_argument(
"-d",
"--debug",
action="store_true",
help="Start the app in debug mode."
)
args = parser.parse_args()
app = scene_manager.SceneManager(
args.file,
args.n,
args.scale,
args.fade,
args.reverse,
args.paused,
args.window_size,
args.debug
)
app.run()