forked from volsn/roof-calculation-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
41 lines (27 loc) · 1.1 KB
/
test.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
import extras
import side
def parse_lines(shapes):
lines = extras.exact_lines(shapes) # a dict containing information about all the lines
lines_to_check = [] # list of lines that are about to be solved
checked_lines = [] # list of lines that are already solved
lines_to_check = side.check_lines(lines, checked_lines)
while lines_to_check is not []:
for id in lines_to_check:
i = extras.find_element_by_id(lines, id)
checked_line = side.solve_line(lines[i])
checked_lines.append(id)
lines[i] = checked_line
# Set values of points of the checked lines to lines that cross with it
for point in checked_line['points']:
for line_ in lines:
if line_['id'] not in checked_lines:
for point_ in line_['points']:
if point_['id'] == point['id']:
point_ = point
del(id)
lines_to_check = side.check_lines(lines, checked_lines)
"""
For test purpose
"""
if __name__ == '__main__':
pass