69 |
elif x < 0 and y == 0: return math.pi |
elif x < 0 and y == 0: return math.pi |
70 |
elif x < 0 and y > 0: return math.pi/2 + math.atan(y/-x) |
elif x < 0 and y > 0: return math.pi/2 + math.atan(y/-x) |
71 |
|
|
72 |
|
def getZ(vs, cs): |
73 |
|
tmp = jarray.zeros(3, 'f') |
74 |
|
vs.coords.transformPoints3(cs, [0.0, 0.0, 0.0], tmp) |
75 |
|
return (tmp[2]) |
76 |
|
|
77 |
def testWheel(): |
def testWheel(): |
78 |
r.addProperty(p, s) |
r.addProperty(p, s) |
79 |
r.addProperty(p, t) |
r.addProperty(p, t) |
94 |
[vs.coords.transformPoint(cs, 0, 0, None) |
[vs.coords.transformPoint(cs, 0, 0, None) |
95 |
for cs in [cs_r, cs_s, cs_t, cs_u, cs_v, cs_w]] |
for cs in [cs_r, cs_s, cs_t, cs_u, cs_v, cs_w]] |
96 |
|
|
97 |
|
prz, psz, ptz, puz, pvz, pwz = \ |
98 |
|
[getZ(vs, cs) for cs in [cs_r, cs_s, cs_t, cs_u, cs_v, cs_w]] |
99 |
|
|
100 |
# Check that selected nodes are drawn on same level |
# Check that selected nodes are drawn on same level |
101 |
|
|
102 |
assert pw.y == pr.y == ps.y |
assert pw.y == pr.y == ps.y |
103 |
# XXX assert pw.z == pr.z == ps.z |
assert pwz == prz == psz |
104 |
|
|
105 |
# Check that the positive side of the wheel seem to turn right |
# Check that the positive side of the wheel seem to turn right |
|
|
|
106 |
assert pt.y < ps.y < pv.y |
assert pt.y < ps.y < pv.y |
107 |
assert pt.x < ps.x > pv.x |
assert pt.x < ps.x > pv.x |
108 |
# XXX assert pt.z > ps.z < pv.z < pu.z |
assert ptz > psz < pvz < puz |
109 |
|
|
110 |
|
|
111 |
# Check that all nodes have approximately the same distance |
# Check that all nodes have approximately the same distance |