🔗Asymptote Gallery Tagged by “L-System” #191
đź”—animations-fig013
Inspiration.
Show animations/fig0140.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Animation
Tags : #L-System | #Animation
import Lsystem; import animate; animation A = animation(global=false); size(16cm, 12cm); string[][] rules={{"A", "[+BFA][-BFA][^BFA][&BFA]"}, {"B", "'(0.7071)"}}; Lsystem3 plant=Lsystem3("A", rules, La=45); plant.iterate(5); tree3 g=plant.tree3(); for (int angle=0; angle < 360; angle += 5) { currentprojection=orthographic(rotate(angle, Z)*(10, 10, 6)); save(); for (int i : g.keys) draw((path3)g[i], linewidth(bp)+(g[i].depth > 3 ? brown : 0.8*green)); A.add(); restore(); } A.movie(BBox(3mm, Fill(yellow+blue)));
đź”—animations-fig014
Show animations/fig0150.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Animation
Tags : #Animation | #L-System | #Path3
import Lsystem; import animate; settings.tex="pdflatex"; settings.outformat="pdf"; animation A; size(10cm,0); string[][] rules={{"X","^<XF^<XFX-F^>>XFX&F+>>XFX-F>X->"}}; Lsystem3 HilbertCurve3D=Lsystem3("X", rules, La=90, Lai=0); HilbertCurve3D.iterate(3); path3[] g=HilbertCurve3D.paths3(); triple M=(max(g)+min(g))/2; currentprojection=currentprojection=orthographic((10,10,6)); for (int angle=0; angle < 360; angle += 2) { save(); draw(rotate(angle,M,M+Z)*g[0], linewidth(bp)+0.9*yellow); A.add(); restore(); } A.movie(BBox(3mm, Fill(black)));
đź”—lsystem-fig001

Show lsystem/fig0010.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm); string[][] rules={{"F","FF"}, {"X","--FXF++FXF++FXF--"}}; Lsystem Sierpinski=Lsystem("FXF--FF--FF", rules, La=60, Lai=0); Sierpinski.iterate(5); draw(Sierpinski.paths(), bp+0.2*green); shipout(bbox(Fill(paleyellow)));
đź”—lsystem-fig002

Show lsystem/fig0020.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(15cm,0); Lsystem SierpinskiCurve= Lsystem("YF", new string[][]{{"X","YF+XF+Y"},{"Y","XF-YF-X"}}, La=60, Lai=0); SierpinskiCurve.iterate(7); draw(SierpinskiCurve.paths(), bp+0.2*green); shipout(bbox(Fill(paleyellow)));
đź”—lsystem-fig003

Show lsystem/fig0030.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(15cm,0); Lsystem SierpinskiCarpet= Lsystem("F+F+F+F", new string[][]{{"F","FF+F+F+F+FF"}}, La=90, Lai=0); SierpinskiCarpet.iterate(4); draw(SierpinskiCarpet.paths(), bp+0.2*green); shipout(bbox(Fill(paleyellow)));
đź”—lsystem-fig004

Source
Show lsystem/fig0040.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(15cm,0); Lsystem Koch=Lsystem("+F--F--F", new string[][]{{"F","F+F--F+F"}}, La=60, Lai=0); Koch.iterate(4); filldraw(Koch.paths()[0]&cycle, paleyellow, 1bp+black); shipout(bbox(2mm, Fill(lightyellow)));
đź”—lsystem-fig005

Show lsystem/fig0050.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(15cm,0); Lsystem Koch=Lsystem("+F+F+F+F+F", new string[][]{{"F","F-F++F-F"}}, La=72); Koch.iterate(4); filldraw(Koch.paths()[0]&cycle, paleyellow, 1bp+black); shipout(bbox(2mm, Fill(lightyellow)));
đź”—lsystem-fig006

Show lsystem/fig0060.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm,0); Lsystem Koch=Lsystem("-F--F--F", new string[][]{{"F","F-F++F-F"}}, La=60); Koch.iterate(4); filldraw(Koch.paths()[0]&cycle, paleyellow, 1bp+black); shipout(bbox(2mm, Fill(lightyellow)));
đź”—lsystem-fig007

Show lsystem/fig0070.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
// Quadratic Koch Island import Lsystem; size(10cm,0); string[][] rules={{"F","F-F+F+FFF-F-F+F"}}; Lsystem QuadraticKochIsland=Lsystem("F+F+F+F", rules, La=90, Lai=0); QuadraticKochIsland.iterate(3); draw(QuadraticKochIsland.paths(), bp+0.9*yellow); shipout(bbox(3mm, Fill(black)));
đź”—lsystem-fig008

Source.
Show lsystem/fig0080.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm,0); Lsystem HilbertCurve=Lsystem("X", new string[][]{{"X","-YF+XFX+FY-"},{"Y","+XF-YFY-FX+"}}, La=90, Lai=0); HilbertCurve.iterate(6); draw(HilbertCurve.paths(), linewidth(1bp)); shipout(bbox(Fill(lightgrey)));
đź”—lsystem-fig009

Show lsystem/fig0090.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm,0); Lsystem Fass=Lsystem("-L", new string[][]{{"L","LFLF+RFR+FLFL-FRF-LFL-FR+F+RF-LFL-FRFRFR+"}, {"R","-LFLFLF+RFR+FL-F-LF+RFR+FLF+RFRF-LFL-FRFR"}}, La=90); Fass.iterate(3); draw(Fass.paths(), linewidth(1bp)); shipout(bbox(Fill(lightgrey)));
đź”—lsystem-fig010

Show lsystem/fig0100.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm,0); currentprojection=currentprojection=orthographic((10,5,6)); string[][] rules={{"X","^<XF^<XFX-F^>>XFX&F+>>XFX-F>X->"}}; Lsystem3 HilbertCurve3D=Lsystem3("X", rules, La=90); HilbertCurve3D.iterate(3); // !! Use a lot of memory !! /* path3[] g=HilbertCurve3D.paths3(); draw(g[0], linewidth(bp)+0.9*yellow); */ HilbertCurve3D.drawpaths3(linewidth(bp)+0.9*yellow); shipout(bbox(3mm, Fill(black)));
đź”—lsystem-fig011

Show lsystem/fig0110.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(15cm,0); string[][] rules={{"F","FF"}, {"H","+F+FH++FFH++F+FF+FH++FFH++F+F-"}}; Lsystem H=Lsystem("+H",rules, La=90); H.iterate(5); draw(H.paths(), white); shipout(bbox(3mm, Fill(black)));
đź”—lsystem-fig012

Source.
Show lsystem/fig0120.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm,0); string[][] rules=new string[][]{{"F",""},{"X","-FX++FY-"},{"Y","+FX--FY+"}}; Lsystem dragon=Lsystem("X",rules, La=45, Lai=0); dragon.iterate(12); draw(dragon.paths(), white); shipout(bbox(3mm, Fill(black)));
đź”—lsystem-fig013

Show lsystem/fig0130.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(12cm,0); string[][] rules={{"F","-F+F-F-F+F+FF-F+F+FF+F-F-FF+FF-FF+F+F-FF-F-F+FF-F-F+F+F-F+"}}; Lsystem segment32Curve= Lsystem("F+F+F+F", rules, La=90, Lai=45); segment32Curve.iterate(2); filldraw(segment32Curve.paths()[0]&cycle, 0.8*yellow, blue); shipout(bbox(3mm, Fill(black)));
đź”—lsystem-fig014

Show lsystem/fig0140.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
// Peano Gosper curve import Lsystem; size(12cm,0); Lsystem PeanoGosperCurve= Lsystem("FX", new string[][]{{"X","X+YF++YF-FX--FXFX-YF+"},{"Y","-FX+YFYF++YF+FX--FX-Y"}}, La=60, Lai=0); PeanoGosperCurve.iterate(4); draw(PeanoGosperCurve.paths(), bp+0.9*yellow); shipout(bbox(3mm, Fill(black)));
đź”—lsystem-fig015

Show lsystem/fig0150.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(12cm,0); string[][] rules={{"X","XF-F+F-XF+F+XF-F+F-X"}}; Lsystem squareCurve= Lsystem("F+XF+F+XF", rules, La=90, Lai=45); squareCurve.iterate(5); filldraw(squareCurve.paths()[0]&cycle, grey, 1bp+0.9*yellow); shipout(bbox(3mm, Fill(black)));
đź”—lsystem-fig016

Show lsystem/fig0160.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(12cm,0); string[][] rules={{"L","+R-F-R+"}, {"R","-L+F+L-"}}; Lsystem squareCurve= Lsystem("L--F--L--F", rules, La=45, Lai=45); squareCurve.iterate(9); filldraw(squareCurve.paths()[0]&cycle, grey, 1bp+0.9*yellow); shipout(bbox(3mm, Fill(black)));
đź”—lsystem-fig017

Show lsystem/fig0170.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm,0); string[][] rules={ {"F", "F+f-FF+F+FF+Ff+FF-f+FF-F-FF-Ff-FFF"}, {"f", "ffffff"} }; Lsystem oer=Lsystem("F+F+F+F",rules,La=91); oer.iterate(2); draw(oer.paths(), bp+0.8*yellow); shipout(bbox(2mm, Fill(black)));
đź”—lsystem-fig018

Show lsystem/fig0180.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(15cm,0); string[][] rules={ {"F", ""}, {"P", "--FR++++FS--FU"}, {"Q", "FT++FR----FS++"}, {"R", "++FP----FQ++FT"}, {"S", "FU--FP++++FQ--"}, {"T", "+FU--FP+"}, {"U", "-FQ++FT-"} }; Lsystem pentive=Lsystem("Q", rules, La=36, Lai=180); pentive.iterate(8); draw(pentive.paths(), 0.8*yellow); shipout(bbox(2mm, Fill(black)));
đź”—lsystem-fig019

Show lsystem/fig0190.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(12cm,0); string[][] rules={ {"A", "X+X+X+X+X+X+"}, {"X", "[F+F+F+F[---X-Y]+++++F++++++++F-F-F-F]"}, {"Y", "[F+F+F+F[---Y]+++++F++++++++F-F-F-F]"} }; Lsystem spiral=Lsystem("AAAA",rules,La=15); spiral.iterate(6); draw(spiral.paths(), 0.9*green); shipout(bbox(2mm, Fill(black)));
đź”—lsystem-fig020

Rhombus tiling (P3)).
Show lsystem/fig0200.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Tiling
import Lsystem; size(12cm,0); string[][] rules={ {"6","8F++9F----7F[-8F----6F]++"}, {"7","+8F--9F[---6F--7F]+"}, {"8","-6F++7F[+++8F++9F]-"}, {"9","--8F++++6F[+9F++++7F]--7F"}, {"F",""} }; Lsystem Penrose=Lsystem("[7]++[7]++[7]++[7]++[7]", rules, La=36); Penrose.iterate(4); draw(Penrose.paths(), linewidth(bp)); shipout(bbox(2mm, FillDraw(lightyellow,linewidth(1mm))));
đź”—lsystem-fig021

Penrose tiling
Show lsystem/fig0210.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Tiling
import Lsystem; size(12cm,0); string[][] rules={ {"W", "YF++ZF----XF[-YF----WF]++"}, {"X", "+YF--ZF[---WF--XF]+"}, {"Y", "-WF++XF[+++YF++ZF]-"}, {"Z", "--YF++++WF[+ZF++++XF]--XF"}, {"F", ""} }; Lsystem Penrose=Lsystem("++ZF----XF-YF----WF",rules,La=36); Penrose.iterate(4); draw(Penrose.paths(), linewidth(bp)); shipout(bbox(2mm, FillDraw(lightyellow,linewidth(1mm))));
đź”—lsystem-fig022

Show lsystem/fig0220.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Tiling
import Lsystem; size(12cm,0); string[][] rules={ {"W", "YF++ZF----XF[-YF----WF]++"}, {"X", "+YF--ZF[---WF--XF]+"}, {"Y", "-WF++XF[+++YF++ZF]-"}, {"Z", "--YF++++WF[+ZF++++XF]--XF"}, {"F", ""} }; Lsystem Penrose=Lsystem("[X][Y]++[X][Y]++[X][Y]++[X][Y]++[X][Y]",rules,La=36); Penrose.iterate(3); draw(Penrose.paths(), linewidth(bp)); shipout(bbox(2mm, FillDraw(lightyellow,linewidth(1mm))));
đź”—lsystem-fig023

Inspiration.
Show lsystem/fig0230.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm, 10cm); settings.outformat="pdf"; // for opacity string[][] rules=new string[][]{{"F", "FF-[-F+F+F]+[+F-F-F]"}}; Lsystem plant=Lsystem("F", rules, La=22.5, Lai=90); plant.iterate(5); path[] g=plant.paths(); tree g=plant.tree(); for (int i:g.keys) { if((g[i].depth == 0)) draw(g[i].g, yellow); } for (int i:g.keys) { if((g[i].depth > 0 )) draw(g[i].g, green+opacity(0.5)); } for (int i:g.keys) { if((g[i].depth > 15)) draw(g[i].g, brown+opacity(0.3)); } shipout(bbox(Fill(paleyellow)));
đź”—lsystem-fig024

Inspirtaion.
Show lsystem/fig0240.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Surveys | L-System
Tags : #L-System | #Fractals
import Lsystem; size(10cm,10cm); settings.outformat="pdf"; // for opacity string[][] rules=new string[][]{{"F", "FF"},{"X", "F-[[X]+X]+F[+FX]-X"}}; Lsystem plant=Lsystem("X", rules, La=22.5, Lai=90); plant.iterate(8); path[] g=plant.paths(); tree g=plant.tree(); for (int i:g.keys) { if((g[i].depth <= 2 )) draw(g[i].g, yellow); } for (int i:g.keys) { if((g[i].depth > 2 ) && (g[i].depth <= 10 )) draw(g[i].g, green+opacity(0.5)); } for (int i:g.keys) { if((g[i].depth > 11)) draw(g[i].g, brown+opacity(0.3)); } shipout(bbox(Fill(paleyellow)));