2D L-System 生成器

关于
我用 Python 编写的 L-System 生成器实现。该生成器设计在基于 Unix 的操作系统上运行,如 macOS 和/或 Linux。L-System 图案在普通的 Python 中生成。GUI 使用 Python 包 Tkinter,为用户提供输入 L-System 生成器参数的方式。Python 包 Turtle 用于绘制并显示生成的 L-System 图案。
生成的示例图案








使用方法
-
从 GitHub 克隆项目的 代码。
-
运行 main.py 脚本来执行所有操作,使用以下命令(先运行一次并在了解警告信息后,再使用 -nw 选项运行此命令):
# run with the initial warning message python3 main.py # run without the initial warning message python3 main.py -nw
-
脚本在显示 GUI 后,会生成包含 L-System 图案的 eps 文件。要将 eps 文件转换为 png,可以使用 eps_to_png.py Python 脚本,运行如下命令:
python3 eps_to_png.py example.eps example.png