vec.py 文件源码

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

项目:srctools 作者: TeamSpen210 项目源码 文件源码
def iter_grid(
        cls,
        min_pos: 'Vec',
        max_pos: 'Vec',
        stride: int=1,
    ) -> Iterator['Vec']:
        """Loop over points in a bounding box. All coordinates should be integers.

        Both borders will be included.
        """
        min_x, min_y, min_z = map(int, min_pos)
        max_x, max_y, max_z = map(int, max_pos)
        for x in range(min_x, max_x + 1, stride):
            for y in range(min_y, max_y + 1, stride):
                for z in range(min_z, max_z + 1, stride):
                    yield cls(x, y, z)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号