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()
obj.voxels.flatten() # initial data
Edit object (add/remove some voxels)
obj.fetch_data() # this is an async operation
obj.voxels.flatten() # updated data