In [11]:
%pylab inline
In [12]:
import glob
tcs = glob.glob('ik-learning/tc/tc-*.npy')
tc = vstack([load(tc) for tc in tcs])
In [13]:
real_min = tc.min(axis=0)
real_max = tc.max(axis=0)
d = real_max - real_min
s_mins = real_min - 0.1 * d
s_maxs = real_max + 0.1 * d
In [14]:
s_mins, s_maxs
Out[14]:
In [15]:
tc = []
for x in linspace(s_mins[0], s_maxs[0], 5):
for y in linspace(s_mins[1], s_maxs[1], 5):
for z in linspace(s_mins[2], s_maxs[2], 5):
tc.append((x, y, z))
In [16]:
tc = array(tc)
In [17]:
from mpl_toolkits.mplot3d.axes3d import Axes3D
fig = plt.figure(figsize=(14,6))
ax = fig.add_subplot(1, 1, 1, projection='3d')
ax.scatter(*tc.T)
Out[17]:
In [18]:
save('tc-grid.npy', tc)
In [18]: