Current Issue Cover
基于L系统的植物建模方法改进

张树兵1, 王建中1(华北工学院计算机系,太原 030051)

摘 要
为了克服将L系统代码用于编程指导时繁琐的缺点,在简要介绍了L系统代码生成的各阶段图形的性质进行了分析,利用分析结果,给出了一种改进方法,该方法首先把系统代码转换成简单递归表达式,然后,根据这个表达式编写具有递归结构的程序,从而不仅避免了传统方法中庞大的链表结构和复杂的遍历过程,而且使植物建模和实现更加简洁而高效。最后给出该方法的一个具体应用实例。
关键词
Improvement of Plant Structure Modeling Based on L-System

()

Abstract
In 1968, Aristid Lindenmayer introduced a formalism for simulating the development of plant, subsequently named L systems. This formalism was closely related to abstract automata and formal languages. But there is a shortage in programming by the L system codes to construct plants graphic .The shortage is it's complicate and the low productive in its code because the program has to reuse the same code and traverse or modify the same linked list's each node to draw the plant graphic in every status. To make up this defect, this paper analyses and testifys a quality that those L system creating graphics in different status are of fractal character. Furthermore, the paper advances an improvement method based on this quality, which means that generation of the plant graphic in the later status can directly make use of the plant graphic in the former status. In other words, the later status graphic only is the former status graphic's enlargement?translation and revolving. Concretely, the new method is let the L system code into a simple recursion expression which can make the program code cut down and bring up the speed of draw a plant's graphic. A example of the new method is given at the end of the paper. So we can acquire a very useful conclusion in simulating plant with the L system theory which turn the L system code into a recursion expression.
Keywords

订阅号|日报