-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrunk_utils.py
More file actions
47 lines (35 loc) · 980 Bytes
/
Copy pathtrunk_utils.py
File metadata and controls
47 lines (35 loc) · 980 Bytes
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
import numpy as np
class Point:
index = None
position = None
paths = []
network = None
vec = None
linked_to = None
treeID = None
def __init__(self, index, position):
self.index = index
self.position = position
def add_path(self, path):
self.paths = np.append(self.paths, path)
class Path:
index = None
points = []
network = None
def __init__(self, index):
self.index = index
def add_point(self, this_point):
self.points = np.append(self.points, this_point)
class Network:
index = None
paths = []
points = []
top = None
def __init__(self, index):
self.index = index
def add_path(self, path):
self.paths = np.append(self.paths, path)
path.network = self
for point in path.points:
point.network = self
self.points = np.append(self.points, path.points)