#!/usr/bin/env python # coding: utf-8 # In[ ]: 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() # In[ ]: line.shader = "mesh"; # In[ ]: line.radial_segments = 5; # In[ ]: line.visible = False plot.camera_reset() # In[ ]: line.visible = True plot.camera_reset() # In[ ]: 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() # In[ ]: for obj in plot.objects: obj.shader = "mesh" obj.width = 0.05 # In[ ]: for obj in plot.objects: obj.shader = "thick" obj.width = 0.1 # In[ ]: