In [11]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

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]:
(array([-0.48358665, -0.45587764, -0.5064888 ]),
 array([ 0.47029386,  0.30417428,  0.34206772]))

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]:
<mpl_toolkits.mplot3d.art3d.Path3DCollection at 0x10a3cb990>

In [18]:
save('tc-grid.npy', tc)

In [18]: