-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenPointCloud.py
More file actions
63 lines (47 loc) · 1.92 KB
/
genPointCloud.py
File metadata and controls
63 lines (47 loc) · 1.92 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
import random
import math
from config import POINTCLOUD_PATH
radius = 0.0
with open(POINTCLOUD_PATH, "w", encoding="utf-8") as file:
for i in range(10):
for j in range(40):
data = ["", "", ""]
data[0] = str(radius * math.sin(5 * 1.8 * (j + 1)))
data[1] = str(radius * math.cos(5 * 1.8 * (j + 1)))
data[2] = str("0.0")
file.write(", ".join(data) + "\n")
radius += 0.5
radius = 5.0
for i in range(40):
for j in range(40):
data = ["", "", ""]
data[0] = str(radius * math.sin(5 * 1.8 * (j + 1)) + (random.randint(1, 9) / 25))
data[1] = str(radius * math.cos(5 * 1.8 * (j + 1)) + (random.randint(1, 9) / 25))
data[2] = str(0.5 * (i + 1))
file.write(", ".join(data) + "\n")
for i in range(3):
radius -= 0.1
for j in range(40):
data = ["", "", ""]
data[0] = str(radius * math.sin(5 * 1.8 * (j + 1)) + (random.randint(1, 9) / 25))
data[1] = str(radius * math.cos(5 * 1.8 * (j + 1)) + (random.randint(1, 9) / 25))
data[2] = str(0.25 * (i + 1) + 20)
file.write(", ".join(data) + "\n")
radius += 0.1
for i in range(2):
radius += 0.1
for j in range(40):
data = ["", "", ""]
data[0] = str(radius * math.sin(5 * 1.8 * (j + 1)) + (random.randint(1, 9) / 25))
data[1] = str(radius * math.cos(5 * 1.8 * (j + 1)) + (random.randint(1, 9) / 25))
data[2] = str(0.25 * (i + 1) + 20.75)
file.write(", ".join(data) + "\n")
radius = 0.0
for i in range(10):
for j in range(40):
data = ["", "", ""]
data[0] = str(radius * math.sin(5 * 1.8 * (j + 1)))
data[1] = str(radius * math.cos(5 * 1.8 * (j + 1)))
data[2] = str("21.25")
file.write(", ".join(data) + "\n")
radius += 0.5