In [12]:
import k3d
import numpy as np
import time 
In [19]:
phi = np.linspace(0,4*2*np.pi,1000,dtype=np.float32)
x = np.cos(phi)
y = np.sin(phi)
z = 0.01*phi**2
xyz = np.vstack([x,y,z]).T
In [20]:
plot = k3d.plot()
plt_line = k3d.line(xyz,shader='mesh')
plot += plt_line
plot
In [21]:
xyz
Out[21]:
(1000, 3)
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [5]:
time.sleep(1)
plot.camera_auto_fit = False
plot.grid_auto_fit = False
In [6]:
spiral = lambda a: np.vstack([np.cos(phi),np.sin(phi),a*phi]).T
In [7]:
plt_line.vertices = spiral(0.1)
In [22]:
plt_line.vertices = {str(t/10):spiral(0.05+0.05*np.sin(alfa)) 
                     for t,alfa in enumerate(np.linspace(0.0,2*np.pi,20))}
In [23]:
plot.time=.3
In [24]:
plot.start_auto_play()
In [25]:
plot.stop_auto_play()
In [ ]: