There is an alpha Groovy API for ipyvolume. For this to work, the widget JS needs to be installed:
conda install -c conda-forge ipyvolume
Pythreejs and ipyleaflet will be forthcoming, see #6903. We hope these APIs will be included upstream in the original widget repositories.
%classpath config resolver jitpack.io https://jitpack.io
%classpath add mvn com.github.twosigma:ipyvolume:master-SNAPSHOT
import ipyvolume.PyLab;
int size = 32;
int radius = 12;
float[][][] data = new float[size][size][size];
for (int x = 0; x<size; x++){
for (int y = 0; y<size; y++){
for (int z = 0; z<size; z++){
if (Math.pow(x - size/2, 2) + Math.pow(y - size/2, 2) + Math.pow(z - size/2, 2) <= Math.pow(radius, 2)){
data[x][y][z] = 1.0f;
}
}
}
}
figure = PyLab.volShow(data)