import k3d
vertices = [
-10.0, -15.0, 0.0,
-10.0, 5.0, 0.0,
10.0, 5.0, 0.0,
-10.0, -15.0, 0.0,
10.0, -15.0, 0.0,
-10.0, 5.0, 0.0,
0.0, 15.0, 0.0,
10.0, 5.0, 0.0,
10.0, -15.0, 0.0
]
colors = [
0xff,
0xffff,
0xff00ff,
0x00ffff,
0xffff00,
0xff00,
0xff0000,
0xff00ff,
0xffffff
]
line = k3d.line(vertices, colors=colors, width=0.5)
plot = k3d.plot(antialias=True)
plot += line
plot.display()
line.shader = "mesh";
line.radial_segments = 5;
line.visible = False
plot.camera_reset()
line.visible = True
plot.camera_reset()
import k3d
import math
import numpy as np
plot = k3d.plot(antialias=True)
for i in range(10):
vertices = []
s = []
for fi in np.arange(0,2*math.pi, 0.01):
vertices.append([
math.sin(fi*4+i),
math.cos(fi*7+i),
math.cos(fi*3) + fi * 1.5
])
s.append(math.sin(fi*i))
plot += k3d.line(vertices, attribute=s, color_range=[-1,1], color_map=k3d.basic_color_maps.Jet, width=0.03)
plot.display()
for obj in plot.objects:
obj.shader = "mesh"
obj.width = 0.05
for obj in plot.objects:
obj.shader = "thick"
obj.width = 0.1