103
社区成员
发帖
与我相关
我的任务
分享
def main():
# 创建梧桐树模型
tree = PlatanusTree()
tree trunk_length = 120
tree branch_angle = 22
tree leaf_density = 0 4
# 生成L-system字符串
depth = 4
axiom = tree generate_rules(depth)
# 可视化
visualizer = TreeVisualizer(tree)
visualizer pen left(90) # 朝上生长
visualizer pen penup()
visualizer pen goto(0, -200)
visualizer pen pendown()
visualizer draw_tree(axiom, depth)
turtle done()
if __name__ == "__main__":
main()