def system():
"""initialize and iterate the system as appropriate"""
axiom = []
con = int(__base_length__ / 0.1)
s = random() * 0.2 + 0.9
for ind in range(con):
axiom.append(LSymbol("!", {"w": s * (__base_width__ + ((con - ind) / con) ** 6 * 0.2)}))
axiom.append(LSymbol("F", {"l": s * 0.1}))
axiom.append(LSymbol("Q", {"w": s * __base_width__, "l": s * 0.1}))
l_sys = LSystem(axiom=axiom,
rules={"Q": q_prod, "A": a_prod},
tropism=Vector([0, 0, 0.2]),
thickness=0.5,
bendiness=0,
leaf_shape=3,
leaf_scale=0.17,
leaf_bend=0.2)
l_sys.iterate_n(12)
return l_sys
评论列表
文章目录