def cell_rect(self, x, y, areaf=1):
padx = self.cellw * areaf
pady = self.cellh * areaf
fromx = round(x * self.cellw + padx)
fromy = round(y * self.cellh + pady)
tox = round(fromx + self.cellw - 2*padx)
toy = round(fromy + self.cellh - 2*pady)
r = np.array([fromy, fromy, toy, toy])
c = np.array([fromx, tox, tox, fromx])
return polygon(r, c)
评论列表
文章目录