I have a 3D array where I added the potential values for each coordinate here:
z = y = x = size # size of each side of the cube
potential = np.zeros((z, y, x))
exemple: I set a potential to a point -> potential[3,3,3] = 10
now this coord has a value of 10. And the surrounding points will have a potential based on the mean of the surrounding points.
such as:
for z in range(1,size):
for y in range(1,size):
for x in range(1,size):
if [z,y,x] in polop:
potential[z,y,x] = Positive # If positive polo, keeps potential
elif [z,y,x] in polon:
potential[z,y,x] = Negative # If negative polo, keeps potential
elif z!=size-1 and y!=size-1 and x!=size-1: # Sets the potential to the mean potential of neighbors
potential[z][y][x] = (potential[z][y][x+1] + potential[z][y][x-1] + potential[z][y+1][x] +
potential[z][y-1][x] + potential[z+1][y][x] + potential[z-1][y][x]) / 6
Then I plotted this array and it looks like this:
Now what I want is to have surfaces instead of scattering points. A surface consisting of the points that have more less the same potential (let's say from 2 in 2, as 10->8, 8->6, 6->4, 4->2, 2->0, 0->-2, etc.) Is it possible?
Plus, this was supposed to be an ellipsoid instead of a cube, the poles were supposed to be spheres instead of cubes and this needs to be updating like each second. Please help!