gen.py 文件源码

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

项目:tree-gen 作者: friggog 项目源码 文件源码
def calc_stem_radius(self, stem):
        """Calculate radius of this stem as defined in paper"""
        if stem.depth == 0:  # trunk
            result = stem.length * self.param.ratio * self.param.radius_mod[0]
        else:  # other
            result = self.param.radius_mod[stem.depth] * stem.parent.radius * pow((
                stem.length / stem.parent.length), self.param.ratio_power)
            result = max(0.005, result)
            result = min(stem.radius_limit, result)
        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号