我想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