kcl_file.py 文件源码

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

项目:io_scene_kcl 作者: Syroot 项目源码 文件源码
def __init__(self, base, width, bm, indices, max_triangles, min_width):
            self.half_width = width / 2.0
            self.c = base + Vector((self.half_width, self.half_width, self.half_width))
            self.is_leaf = True
            self.indices = []
            for i in indices:
                # TODO: Maybe solving it with a Wiimm KCL_BLOW approach is faster.
                if self.tricube_overlap(bm.faces[i], self):
                    self.indices.append(i)
            # Split this node's cube when it contains too many triangles and the minimum size is not underrun yet.
            if len(self.indices) > max_triangles and self.half_width >= min_width:
                self.is_leaf = False
                self.branches = [KclModel.OctreeNode(base + (Vector((x, y, z)) * self.half_width), self.half_width,
                     bm, self.indices,
                     max_triangles, min_width)
                     for z in range(0, 2) for y in range(0, 2) for x in range(0, 2)]
                self.indices = []
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号