У меня есть координаты точек пустого куба, как показано ниже:
![enter image description here](https://i.stack.imgur.com/1x34m.png)
What I would like to do is transform that cube to something like this:
![enter image description here](https://i.stack.imgur.com/Lzzv0.jpg)
There are two options:
1- Edit the initial cube's coordinates to make it spherical
2- Generate spherical cube from scratch
I couldn't think of a solution so far. How can I generate a spherical cube?
Edit - My code that generates the cube is below. It basically creates a filled cube and then subtracts the nodes on the inside. NL_sph is the final array of the coordinates of the cube surface.
s = 0.1
m = 4
v = 3
b = np.linspace(s*(m+1),s*(m+v-1),v-1)
xi, yi, zi = np.meshgrid(b, b, b)
xi = np.array([xi.flatten('F')]).T
yi = np.array([yi.flatten('F')]).T
zi = np.array([zi.flatten('F')]).T
NL_inc = np.around(np.hstack([xi,yi,zi]), decimals = 5)
c = np.linspace(s*(m),s*(m+v),v+1)
xc, yc, zc = np.meshgrid(c, c, c)
xc = np.array([xc.flatten('F')]).T
yc = np.array([yc.flatten('F')]).T
zc = np.array([zc.flatten('F')]).T
NL_sph = np.around(np.hstack([xc,yc,zc]), decimals = 5)
for i in range(np.size(NL_inc,0)):
idx = np.where((NL_sph == NL_inc[i,:]).all(axis=1))[0]
if len(idx) != 0:
NL_sph = np.delete(NL_sph, idx, axis = 0)