I have problems with the visualization of an 3D surface. The underlaying data represents a sphere (at least partial) and comes already in 2D grids for X, Y, Z and an additional value V, which should be plotted as surface color.
As you can see, the surface is not calculated on the โoutsideโ but filling up the inside. I already tried plotting the data as 3D mesh like this (x,y,z are 2d numpy arrays):
Hi @VincentD21,
Coukd you please give more details on your data? What is the shape for the x, y, respectively z, as arrays?
If you provide your data ( uploading them somewhere to be accessed) I could help to detect whatโ s going on now, and what you should modify to get the right surface.
All of them are 121x81 2d arrays and are somehow grid based ( I assumed a meshgrid). As an additional comment, the visualization via Tecplot or Paraview works without any problems.
I read your data and reshaped them as arrays of shape (121, 81).
From each array I took the subarrays of shape (25, 25) , flattened each one, and plotted as Scatter3d to check whether data are on a patch of surface or not:
with open('xdat.csv') as f:
x = [float(s) for line in f.readlines() for s in line[:-1].split(';')]
x=np.array(x).reshape((121, 81))
with open('ydat.csv') as f:
y = [float(s) for line in f.readlines() for s in line[:-1].split(';')]
y=np.array(y).reshape((121, 81))
with open('zdat.csv') as f:
z = [float(s) for line in f.readlines() for s in line[:-1].split(';')]
z=np.array(z).reshape((121, 81))
fig=go.Figure(go.Scatter3d(x=x[:25, :25].flatten(), y=y[:25,:25].flatten(), z=z[:25, :25].flatten(),mode='markers', marker_size=2))
Obviously these points do not lie on a continuous patch of surface as they should be
The surface was discretized in a special way. It seems that these points lie on some curves on the surface, but close points as position in the arrays x, y, z, should be close to each other on the surface too, to be ploted as Plotly surface, but as we can see in this image, they arenโt.
thank you very much for your help. This gave me the right hint to dig a little bit deeper into the data. Turns out that the converter from which I received the data was buggy. After fixing this everthings works as it should and the data can be simply plotted as a surface.