I have to create a 3d cube with a set of points for school. But when I'm trying to use Delaunay triangulation I'm getting a bad result. Does anyone has any idea how to fix that ? I'm truly a beginner with this kind of tools, sorry if it's an obvious mistake.
import matplotlib.pyplot as plt
from scipy.spatial import Delaunay
import numpy as np
ax = plt.axes(projection='3d')
ax.view_init(15, -30)
points = np.vstack([x, y, z]).T
tri = Delaunay(points)
ax.plot_trisurf(x,y,z, triangles = tri.simplices ,
linewidth=0.5, facecolors='cyan', linewidths=1, edgecolors='r', alpha=.70, antialiased=True)
Cloud point:
Once triangulated:
I already tried changing some parameters in the Delaunay function but nothing seems to work.