登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
脚本:
 - n = 6
- w = 0.85
- u = array([[0,0], [0,0], [w,w], [w,w]])
- v = array([[0,w], [0,w], [0,w], [0,w]])
- z = array([[w,w], [0,0], [0,0], [w,w]])
- s = array([nan, nan])
- x = np.vstack([u, s, v])
- y = np.vstack([v, s, u])
- z = np.vstack([z, s, w-z])
- m = n - 1
- axes3d(axis=False, clip_plane=False, aspect='equal')
- for i in range(m, -1, -1):
- for j in range(m, -1, -1):
- for k in range(0, m+1):
- r = k / float(m)
- g = 1 - j / float(m)
- b = 1 - i / float(m)
- surf(i+x, j+y, k+z, facecolor=[r,g,b], edgecolor='k')
|