【发布时间】:2021-08-11 13:04:59
【问题描述】:
我需要对一组 3D 点进行 Delaunay 三角剖分。我为它写了一个脚本(如下),但似乎输出中没有四面体。请给我一些意见/想法。我正在使用 Python3。非常感谢。
from scipy.spatial import Delaunay
import matplotlib.pyplot as plt
import numpy as np
points= np.array([[1,2,2],[1,3,6],[4,3,4],[5,3,2]])
tri= Delaunay(points)
fig= plt.figure()
ax= fig.gca(projection= '3d')
ax.plot_trisurf(points[:,0],points[:,1],points[:,2],triangles= tri.simplices)
plt.plot(points[:,0],points[:,1],points[:,2],'+')
plt.show()
【问题讨论】:
标签: python-3.x plot 3d delaunay