I have some text files that contain the (x, y, z) values of points that make up a curve. How can I import this curve into blender, add some thickness, and, if possible, color the line by a fourth variable (like time)?
As an example, here is a python script that prints x, y, z and t values for a spiral:
import numpy as np
t = np.linspace(0,10,100)
x = np.sin(t)
y = np.cos(t)
z = t
for vec in zip(x, y, z, t):
print '%.2f %.2f %.2f %.2f'%(vec[0],vec[1],vec[2],vec[3])
And the output looks like my data files:
0.00 1.00 0.00 0.00
0.10 0.99 0.10 0.10
0.20 0.98 0.20 0.20
0.30 0.95 0.30 0.30
0.39 0.92 0.40 0.40
0.48 0.88 0.51 0.51
0.57 0.82 0.61 0.61
0.65 0.76 0.71 0.71
0.72 0.69 0.81 0.81
0.79 0.61 0.91 0.91
0.85 0.53 1.01 1.01
0.90 0.44 1.11 1.11
0.94 0.35 1.21 1.21
0.97 0.25 1.31 1.31
0.99 0.16 1.41 1.41
...
How can I import this data into Blender? (Note: I have used the 3D surface plugin to draw lines and surfaces in Blender. This is not what I am asking here. In this case, I don't want to plot an equation, but experimental data from text files.)
v
(v and a space) and import it has a .obj $\endgroup$