#!/usr/bin/env python # coding: utf-8 # In[ ]: import k3d import k3d.platonic as platonic import math import numpy as np def test(plot): colors = [0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff] for j in range(5): meshes = [ platonic.Dodecahedron().mesh, platonic.Cube().mesh, platonic.Icosahedron().mesh, platonic.Octahedron().mesh, platonic.Tetrahedron().mesh ] for i, obj in enumerate(meshes): rad = math.radians(i / len(meshes) * 360) radius = 3.5 obj.transform.translation = [math.sin(rad) * radius, math.cos(rad) * radius, 2*j] obj.color = colors[i] plot += obj plot.render() # In[ ]: plot = k3d.plot() plot.display() # In[ ]: plot.auto_rendering = True # In[ ]: test(plot) # In[ ]: while plot.objects: plot -= plot.objects[-1] plot.render() # In[ ]: test(plot) # In[ ]: plot.auto_rendering = False # In[ ]: while len(plot.objects) > 2: plot -= plot.objects[-1] # In[ ]: plot.render() # In[ ]: import numpy as np # In[ ]: for i in range(10): plot += k3d.points(np.random.randn(1,3).astype(np.float32)) plot.camera = [-0.9639876204909027, -23.61169267956684, i, 0, 0.334220290184021, 4, 0.007512009764659415, 0.3054834418666324, 0.9521677564665881] # In[ ]: plot.render() # In[ ]: # In[ ]: