topology.py 文件源码

python
阅读 43 收藏 0 点赞 0 评论 0

项目:Sverchok 作者: Sverchok 项目源码 文件源码
def torus_faces(x, y):
    faces = np.empty((x * y, 4), dtype=np.uint32)
    tmp = np.arange(0, x * y)
    faces[:, 0] = tmp
    faces[:, 1] = np.roll(tmp, -y)
    tmp += 1
    tmp.shape = (x, y)
    tmp[:, y - 1] -= y
    tmp.shape = -1
    faces[:, 3] = tmp
    faces[:, 2] = np.roll(tmp, -y)
    faces.shape = -1
    l_total = np.empty(x * y, dtype=np.uint32)
    l_total[:] = 4
    l_start = np.arange(0, (x * y) * 4, 4, dtype=np.uint32)
    return SvPolygon(l_start, l_total, faces)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号