Hi @Alpheron,
You can illustrate the fourth dimension by color. The working algorithm checked with your posted data is as follows:
- set up the array of coordinates and the array of snow height at each point.
- Theoretically you have to project the points (x,y,z) to (x,y) and triangulate the set of 2d points (x,y). Delaunay triangulation returns the array of 2d points, and the array of triangles (triangulation faces).
- With x, y, z as 3D coordinates and
snowh
defined below you can draw a triagulated surface such that the color (in a given colormap) of each point is assigned according to the corresponding value in snowh:
import plotly.graph_objects as go
import numpy as np
from scipy.spatial import Delaunay
point_coords= np.array([[ 0.05497894, -0.11160859, 0.37084371],
[-0.00817349, -0.14016391, 0.39896593],
[-0.04405962, -0.13445015, 0.41198156],
[-0.02392213, -0.1297217, 0.39447151],
[-0.00622379, -0.12973436, 0.39639086],
[ 0.01604251, -0.12920773, 0.40366026],
[ 0.06505235, -0.13291964, 0.40368367],
[ 0.07263324, -0.13199505, 0.40244909],
[ 0.03655646, -0.13674183, 0.40442567],
[ 0.00245951, -0.13406454, 0.40627548]])
snowh=[992634.25,
22319520.0,
23621576.0,
22518240.0,
19963640.0,
20256056.0,
33873776.0,
19216264.0,
17755528.0,
4434950.0]
x = point_coords[:, 0]
y = point_coords[:, 1]
z = point_coords[:, 2]
points2D = np.vstack([x,y]).T
tri = Delaunay(points2D) #triangulate the 2d points
I, J, K = (tri.simplices).T
print("simplices:", "\n", tri.simplices)
fig=go.Figure(go.Mesh3d(x=x, y=y, z=z,
i=I, j=J, k=K,
intensity=snowh, colorscale="ice" )) #these two last attributes, intensity and colorscale, assign a color according to snow height
fig.show()