-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
63 lines (56 loc) · 1.7 KB
/
constants.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
"""Constants for Tangram."""
import numpy as np
DEFAULT_SCALE = 0.25
DEFAULT_COLOR = [55, 126, 184, 255] # (0.21568627450980393, 0.49411764705882355, 0.7215686274509804, 1.0)
FIG_SIZE = (4, 4)
DPI = 56
HOUSE = lambda scale=DEFAULT_SCALE: np.array([
[0.505, 0.49333333],
[0.63, 0.36833333],
[0.38, 0.36833333],
[0.4625, 0.62083333],
[0.5875, 0.49583333],
[0.3375, 0.49583333],
[0.63166667, 0.49416667],
[0.63166667, 0.36916667],
[0.50666667, 0.49416667],
[0.441, 0.43133333],
[0.3785, 0.49383333],
[0.5035, 0.49383333],
[0.44016667, 0.4305],
[0.37766667, 0.368],
[0.37766667, 0.493],
[0.50030583, 0.58530583],
[0.50030583, 0.67369417],
[0.58869417, 0.67369417],
[0.58869417, 0.58530583],
[0.5885, 0.58469417],
[0.50011165, 0.58469417],
[0.5885, 0.49630583],
[0.67688835, 0.49630583],
]) * scale / DEFAULT_SCALE + [0.5 * (1 - scale / DEFAULT_SCALE)] * 2
TREE = lambda scale=DEFAULT_SCALE: np.array([
[0.50392557, 0.50607443],
[0.32714887, 0.50607443],
[0.50392557, 0.68285113],
[0.50607443, 0.50607443],
[0.50607443, 0.68285113],
[0.68285113, 0.50607443],
[0.416, 0.50602557],
[0.50438835, 0.41763722],
[0.32761165, 0.41763722],
[0.50453722, 0.41853722],
[0.50453722, 0.50692557],
[0.59292557, 0.41853722],
[0.50446278, 0.50606278],
[0.50446278, 0.41767443],
[0.41607443, 0.50606278],
[0.45580582, 0.32910583],
[0.45580582, 0.41749417],
[0.54419417, 0.41749417],
[0.54419417, 0.32910583],
[0.595, 0.50599417],
[0.50661165, 0.50599417],
[0.595, 0.41760583],
[0.68338835, 0.41760583],
]) * scale / DEFAULT_SCALE + [0.5 * (1 - scale / DEFAULT_SCALE)] * 2