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
评论列表
文章目录