def _make_grid(dim=(11,4)):
"""
this function generates the structure for an asymmetrical circle grid
domain (0-1)
"""
x,y = range(dim[0]),range(dim[1])
p = np.array([[[s,i] for s in x] for i in y], dtype=np.float32)
p[:,1::2,1] += 0.5
p = np.reshape(p, (-1,2), 'F')
# scale height = 1
x_scale = 1./(np.amax(p[:,0])-np.amin(p[:,0]))
y_scale = 1./(np.amax(p[:,1])-np.amin(p[:,1]))
p *=x_scale,x_scale/.5
return p
评论列表
文章目录