-
Notifications
You must be signed in to change notification settings - Fork 185
/
definitions.py
63 lines (51 loc) · 1.46 KB
/
definitions.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
import os
from enum import IntEnum, IntFlag, auto
from typing import Generator, Iterable, List
from pyrr import Vector3
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
DATA_PATH = BASE_PATH + '/storage/data/'
SCREENSHOT_PATH = BASE_PATH + '/storage/screenshots/'
ADDITIONAL_NODE_BUFFER_DATA: int = 6
ADDITIONAL_EDGE_BUFFER_DATA: int = 8
class ProcessRenderMode(IntFlag):
FINAL = auto()
NODE_ITERATIONS = auto()
EDGE_ITERATIONS = auto()
SMOOTHING = auto()
class CameraPose(IntEnum):
FRONT = 0
RIGHT = 1
LEFT = 2
LOWER_BACK_RIGHT = 3
BACK_RIGHT = 4
UPPER_BACK_LEFT = 5
UPPER_BACK_RIGHT = 6
BACK = 7
DEFAULT = 8
CAMERA_POSE_POSITION: List[Vector3] = [
Vector3([3.5, 0.0, 0.0]),
Vector3([0.0, 0.0, 2.5]),
Vector3([0.0, 0.0, -2.5]),
Vector3([-2.75, -1.0, 1.25]),
Vector3([-2.5, 0.0, 2.5]),
Vector3([-2.0, 2.0, -2.0]),
Vector3([-2.0, 2.0, 2.0]),
Vector3([-4.0, 0.0, 0.0]),
Vector3([-3.5, 0.0, 0.0])
]
def pairwise(it: Iterable, size: int) -> Generator:
it = iter(it)
while True:
try:
yield next(it)
for _ in range(size - 1):
next(it)
except StopIteration:
return
def vec4wise(it: Iterable) -> Generator:
it = iter(it)
while True:
try:
yield next(it), next(it), next(it), next(it),
except StopIteration:
return