-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetw.py
150 lines (130 loc) · 4.02 KB
/
getw.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
c = 1
s = [0, 0, 0, 0, 0 ]
j = [0, 0, 0, 0 ]
x = [0, 0 ]
y = [0, 0 ]
v = int(input(f"_define view:"))
print(f"_define template.top.x:0")
s[0] = int(input(f"_define template.top.y:"))
s[1] = int(input(f"_define template.left.x:"))
s[2] = int(input(f"_define template.right.x:"))
s[3] = int(input(f"_define template.left.y:"))
s[4] = int(input(f"_define template.right.y:"))
class D(object):
def __init__(self, x, y, z ):
self.x = x
self.y = y
self.z = z
class E(object):
def __init__(self, x, yl, yh ):
self.x = x
self.yl = yl
self.yh = yh
P = D(0, 0, 0 )
Q = D(0, 0, 0 )
w1 = E(0, 0, 0 )
w2 = E(0, 0, 0 )
w3 = E(0, 0, 0 )
w4 = E(0, 0, 0 )
def d(d1, d2, d3, d4 ):
d = d1 * d2 + d3 * d4
return d
print(f"_rake on")
print(f"_version: indev PE 0.6")
print(f"_mode[1]:move point")
print(f"_mode[2]:expand point")
while c>0 :
t = str(input(f"_select mode:"))
if t == "1":
print(f"_locate block %d:"%(c))
P.x = int(input(f"point0.x:"))
P.y = int(input(f"point0.y:"))
P.z = int(input(f"point0.z:"))
print(f"_locate block %d:"%(c))
Q.x = int(input(f"move.x:"))
Q.y = int(input(f"move.y:"))
Q.z = int(input(f"move.z:"))
x[0] = P.x
x[1] = P.x + Q.x
y[0] = P.y
y[1] = P.y + Q.y
j[0] = d(x[0],s[1],y[0],s[2])
j[1] = d(x[0],s[3],y[0],s[4])
j[2] = d(j[1],1,P.z,s[0])
j[3] = d(j[2],1,Q.z,s[0])
w1.x = v * j[0]
w1.yl = v * j[2]
w1.yh = v * j[3]
print(f"[%d]: %d~%d"%(w1.x,w1.yl,w1.yh))
j[0] = d(x[1],s[1],y[0],s[2])
j[1] = d(x[1],s[3],y[0],s[4])
j[2] = d(j[1],1,P.z,s[0])
j[3] = d(j[2],1,Q.z,s[0])
w2.x = v * j[0]
w2.yl = v * j[2]
w2.yh = v * j[3]
print(f"[%d]: %d~%d"%(w2.x,w2.yl,w2.yh))
j[0] = d(x[0],s[1],y[1],s[2])
j[1] = d(x[0],s[3],y[1],s[4])
j[2] = d(j[1],1,P.z,s[0])
j[3] = d(j[2],1,Q.z,s[0])
w3.x = v * j[0]
w3.yl = v * j[2]
w3.yh = v * j[3]
print(f"[%d]: %d~%d"%(w3.x,w3.yl,w3.yh))
j[0] = d(x[1],s[1],y[1],s[2])
j[1] = d(x[1],s[3],y[1],s[4])
j[2] = d(j[1],1,P.z,s[0])
j[3] = d(j[2],1,Q.z,s[0])
w4.x = v * j[0]
w4.yl = v * j[2]
w4.yh = v * j[3]
print(f"[%d]: %d~%d"%(w4.x,w4.yl,w4.yh))
if t == "2":
print(f"_locate block %d:"%(c))
P.x = int(input(f"point1.x:"))
P.y = int(input(f"point1.y:"))
P.z = int(input(f"point1.z:"))
print(f"_locate block %d:"%(c))
Q.x = int(input(f"point2.x:"))
Q.y = int(input(f"point2.y:"))
Q.z = int(input(f"point2.z:"))
x[0] = P.x
x[1] = Q.x
y[0] = P.y
y[1] = Q.y
j[0] = d(x[0],s[1],y[0],s[2])
j[1] = d(x[0],s[3],y[0],s[4])
j[2] = d(j[1],1,P.z,s[0])
j[3] = d(j[2],1,Q.z,s[0])
w1.x = v * j[0]
w1.yl = v * j[2]
w1.yh = v * j[3]
print(f"[%d]: %d~%d"%(w1.x,w1.yl,w1.yh))
j[0] = d(x[1],s[1],y[0],s[2])
j[1] = d(x[1],s[3],y[0],s[4])
j[2] = d(j[1],1,P.z,s[0])
j[3] = d(j[2],1,Q.z,s[0])
w2.x = v * j[0]
w2.yl = v * j[2]
w2.yh = v * j[3]
print(f"[%d]: %d~%d"%(w2.x,w2.yl,w2.yh))
j[0] = d(x[0],s[1],y[1],s[2])
j[1] = d(x[0],s[3],y[1],s[4])
j[2] = d(j[1],1,P.z,s[0])
j[3] = d(j[2],1,Q.z,s[0])
w3.x = v * j[0]
w3.yl = v * j[2]
w3.yh = v * j[3]
print(f"[%d]: %d~%d"%(w3.x,w3.yl,w3.yh))
j[0] = d(x[1],s[1],y[1],s[2])
j[1] = d(x[1],s[3],y[1],s[4])
j[2] = d(j[1],1,P.z,s[0])
j[3] = d(j[2],1,Q.z,s[0])
w4.x = v * j[0]
w4.yl = v * j[2]
w4.yh = v * j[3]
print(f"[%d]: %d~%d"%(w4.x,w4.yl,w4.yh))
else:
print(f"_start with '1' or '2'")
continue