|
|
| Figure 0001: fig0010.asy |
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)));
|
|
| Figure 0002: fig0020.asy |
import Lsystem; size(10cm,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)));
|
|
| Figure 0003: fig0025.asy |
|
|
| Figure 0004: fig0030.asy |
|
|
| Figure 0005: fig0040.asy |
|
|
| Figure 0006: fig0050.asy |
|
|
| Figure 0007: fig0060.asy |
// 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)));
|
|
| Figure 0008: fig0070.asy |
|
|
| Figure 0009: fig0075.asy |
|
|
| Figure 0010: fig0077.asy |
/*An animation of the 3D Hilbert curve may be found HERE*/ 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)));
|
|
| Figure 0011: fig0078.asy |
|
|
| Figure 0012: fig0080.asy |
|
|
| Figure 0013: fig0090.asy |
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)));
|
|
| Figure 0014: fig0100.asy |
// Peano Gosper curve import Lsystem; size(8cm,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)));
|
|
| Figure 0015: fig0110.asy |
import Lsystem; size(8cm,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)));
|
|
| Figure 0016: fig0115.asy |
import Lsystem; size(8cm,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)));
|
|
| Figure 0017: fig0120.asy |
|
|
| Figure 0018: fig0130.asy |
import Lsystem; size(10cm,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)));
|
|
| Figure 0019: fig0140.asy |
/* Source */ import Lsystem; size(8cm,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)));
|
|
| Figure 0020: fig0150.asy |
/* Pavage P3 de Penrose Drawing the Penrose tiling P3 */ import Lsystem; size(8cm,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))));
|
|
| Figure 0021: fig0160.asy |
/* Pavage de Penrose Source */ import Lsystem; size(8cm,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))));
|
|
| Figure 0022: fig0170.asy |
/* Double pavage de Penrose Source */ import Lsystem; size(8cm,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))));
|
|
| Figure 0023: fig0500.asy |
/*Inspirtaion*/ 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)));
|
|
| Figure 0024: fig0510.asy |
/*Inspirtaion*/ 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)));
Dernière modification/Last modified: Thu Apr 17 23:42:42 CEST 2008
Philippe Ivaldi