from fractal import Pen p = Pen([400, 470]) p.setAngle(90) p.setPoint([170, 470]) p.doD0L(omega="f", P={ "f": "h+[[f]-f]-h[-hf]+f", "h": "hh" }, delta=22.5, times=6, length=400, rate=2.3) p.wait()
# 窗花 from fractal import Pen p = Pen([500, 500], title="Window") p.setPoint([495, 495]) p.setAngle(90) p.doD0L(omega="f+f+f+f", P={"f": "ff+f--f+f"}, delta=90, times=5, length=490, rate=3) p.wait()
# 科赫雪花 from fractal import Pen p = Pen([500,500],title = "Koch Snow") p.setPoint([30,130]) p.doD0L(omega = "f--f--f", P = {"f": "f+f--f+f"}, delta = 60, times = 5, length = 400, rate = 3) p.wait()
from fractal import Pen p = Pen([400, 450]) p.setAngle(90) p.setPoint([200, 450]) p.doD0L(omega="f", P={ "f": "h[-f]h[+f]-f", "h": "hh" }, delta=22.5, times=7, length=400, rate=2.17) p.wait()
# 其他曲线 from fractal import Pen p = Pen([500, 500], title="Else") p.setPoint([250, 250]) p.doD0L(omega="f+f+f+f", P={"f": "ff-f-f-f-f+f-f"}, delta=90, times=5, length=100, rate=3) p.wait()
# 皮亚洛曲线 from fractal import Pen p = Pen([500, 500]) p.setPoint([85, 85]) p.setWidth(1) p.doD0L(omega="R", P={ "L": "L-R--R+L++LL+R-", "R": "+L-RR--R-L++L+R" }, delta=60, times=4, length=139, rate=2) p.wait()
# Tree from fractal import Pen p = Pen([400, 510]) p.setPoint([250, 510]) p.setAngle(90) p.doD0L(omega="f", P={"f": "ff+[+f-f-f]-[-f+f+f]"}, delta=22.5, times=4, length=400, rate=2.6) p.wait()
# 二次Koch岛 from fractal import Pen p = Pen([500, 500], title="Koch island") p.setPoint([100, 100]) p.doD0L(omega="f-f-f-f", P={"f": "f+f-f-ff+f+f-f"}, delta=90, times=4, length=300, rate=4) p.wait()
from fractal import Pen p = Pen([500,500]) p.setPoint([10, 490]) p.doD0L(omega = "R", P = {"L":"R+L+R", "R": "L-R-L"}, delta = 60, times = 8, length = 450, rate = 2) p.wait()
# 谢尔宾斯基方毯 from fractal import Pen p = Pen([500, 500], title="Sierpinski") p.setPoint([50, 240]) p.doD0L(omega="f", P={ "h": "hhh", "f": "f-f+f+f+h-f-f-f+f" }, delta=90, times=4, length=400, rate=3) p.wait()
# 科赫曲线 from fractal import Pen p = Pen([500, 300], title="Koch") p.setPoint([5, 190]) p.doD0L(omega="f", P={"f": "f+f--f+f"}, delta=60, times=4, length=490, rate=3) p.wait()
# 谢尔宾斯基三角 from fractal import Pen p = Pen([500, 460], title="Sierpinski") p.setPoint([5, 5]) p.doD0L(omega="f--f--f", P={"g": "gg", "f": "f--f--f--gg"}, delta=60, times=5, length=490, rate=2) p.wait()
# 龙曲线 from fractal import Pen from math import sqrt p = Pen([350, 270]) p.setPoint([140, 60]) p.setWidth(1) p.doD0L(omega="L", P={ "L": "L+R", "R": "L-R" }, delta=90, times=15, length=200, rate=sqrt(2)) p.wait()
# 树形 from fractal import Pen p = Pen([260, 500]) p.setPoint([130, 500]) p.setAngle(90) p.doD0L(omega="f", P={"f": "f[-f]f[+f]f"}, delta=30, times=5, length=480, rate=3) p.wait()
# FASS曲线 from fractal import Pen p = Pen([420, 420]) p.setPoint([10, 10]) p.doD0L(omega="L", P={ "L": "LFRFL-FF-RFLFR+FF+LFRFL", "R": "RFLFR+FF+LFRFL-FF-RFLFR" }, delta=90, times=4, length=200, rate=3) p.wait()
# FASS曲线 from fractal import Pen p = Pen([420, 420]) p.setPoint([10, 400]) p.doD0L(omega="L", P={ "L": "LF+RFR+FL-F-LFLFL-FRFR+", "R": "-LFLF+RFRFR+F+RF-LFL-FR" }, delta=90, times=4, length=200, rate=3) p.wait()