我想matplotlib
绘制一个四面体网格,下面是一个简单的四面体网格:如何通过matplotlib绘制四面体网格?
xyz = np.array([
[-1,-1,-1],
[ 1,-1,-1],
[ 1, 1,-1],
[-1, 1,-1],
[-1,-1, 1],
[ 1,-1, 1],
[ 1, 1, 1],
[-1, 1, 1]], dtype=np.float)
tets = np.array([
[0,1,2,6],
[0,5,1,6],
[0,4,5,6],
[0,7,4,6],
[0,3,7,6],
[0,2,3,6]], dtype=np.int)
当然,在实际应用中,四面体网格中的数量可能很大。我无法在Google中找到任何有用的帮助信息。那么通过matplotlib
绘制四面体网格的更好方法是什么?
此外,我可以得到网格的所有三角形面。
tri = np.array([
[0 2 1]
[0 1 5]
[0 6 1]
[0 3 2]
[0 2 6]
[0 6 3]
[0 7 3]
[0 5 4]
[0 6 4]
[0 4 7]
[0 6 5]
[0 6 7]
[1 2 6]
[5 1 6]
[2 3 6]
[3 7 6]
[4 5 6]
[7 4 6]],dtype=np.int)
阅读:https://mathema.tician.de/software/meshpy/ – eyllanesc
和这个:https://github.com/inducer/meshpy/blob/master/examples/test_tri_quadratic.py – eyllanesc