-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataType.py
More file actions
74 lines (63 loc) · 1.48 KB
/
DataType.py
File metadata and controls
74 lines (63 loc) · 1.48 KB
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
import heapq
import itertools
class Point:
x = 0.0
y = 0.0
def __init__(self, x, y):
self.x = x
self.y = y
class Node:
p = None
arc = None
def __init__(self,p):
self.node = None
self.p = p
self.arc = None
self.left = None
self.right = None
self.height = 1
class Event:
x = 0.0 # This is the max x coord of circle
p = None # This is the center of the circle
pprev = None # These are the prev and prior points of the circle
pnext = None
a = None # This is the middle arc of the circle
valid = True
def __init__(self, x, p, a):
self.x = x
self.p = p
pprev = None
pnext = None
self.a = a
self.valid = True
class Arc:
number = None
p = None
aprev = None
anext = None
left = None
right = None
height = 1
node = None
e = None
s0 = None
s1 = None
def __init__(self, p, a=None, b=None):
self.p = p
self.aprev = a
self.anext = b
self.e = None
self.s0 = None
self.s1 = None
class Segment:
start = None
end = None
done = False
def __init__(self, p):
self.start = p
self.end = None
self.done = False
def finish(self, p):
if self.done: return
self.end = p
self.done = True