-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolygons.py
60 lines (43 loc) · 1.09 KB
/
polygons.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
from constants import *
def polygon_gt(x0,y0):
res = [x0,y0]
res.append(x0 + cell_width)
res.append(y0 + cell_height / 2)
res.append(x0)
res.append(y0 + cell_height)
return res
def polygon_gtth(x0,y0):
res = [x0,y0]
res.append(x0 + cell_width)
res.append(y0 + cell_height / 2)
res.append(x0)
res.append(y0 + cell_height / 2)
return res
def polygon_gtbh(x0,y0):
res = [x0,y0]
res.append(x0 + cell_width)
res.append(y0)
res.append(x0)
res.append(y0 + cell_height / 2)
return res
def polygon_lt(x0,y0):
res = [x0,y0]
res.append(x0 + cell_width)
res.append(y0 - cell_height / 2)
res.append(x0 + cell_width)
res.append(y0 + cell_height / 2)
return res
def polygon_ltth(x0,y0):
res = [x0,y0]
res.append(x0 + cell_width)
res.append(y0 - cell_height / 2)
res.append(x0 + cell_width)
res.append(y0)
return res
def polygon_ltbh(x0,y0):
res = [x0,y0]
res.append(x0 + cell_width)
res.append(y0)
res.append(x0 + cell_width)
res.append(y0 + cell_height / 2)
return res