In [ ]:
from k3d import K3D

width = height = length = 3

color_map = (0xFF0000,) * width * height * length
voxels = (1,) * width * height * length
obj = K3D.voxels(voxels, color_map, width=width, height=height, length=length)

plot = K3D()
plot += obj
plot.display()

In [ ]:
obj.voxels.flatten()  # initial data

Edit object (add/remove some voxels)


In [ ]:
obj.fetch_data()  # this is an async operation

In [ ]:
obj.voxels.flatten()  # updated data