L-System with Asymptote – fig0010

Category: Asymptote,L-SystemPh. Ivaldi @ 19 h 40 min

Figure 0001
(Compiled with Asymptote version 1.86svn-r4626)
    
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)));

Étiquettes : ,


L-System with Asymptote – fig0020

Category: Asymptote,L-SystemPh. Ivaldi @ 20 h 40 min

Figure 0002
(Compiled with Asymptote version 1.84svn-r4619)
    
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)));


Étiquettes : ,


L-System with Asymptote – fig0030

Category: Asymptote,L-SystemPh. Ivaldi @ 21 h 40 min

Figure 0003
(Compiled with Asymptote version 1.84svn-r4619)
    
/* Source */
import Lsystem;
size(10cm,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)));

Étiquettes : ,


L-System with Asymptote – fig0040

Category: Asymptote,L-SystemPh. Ivaldi @ 22 h 40 min

Figure 0004
(Compiled with Asymptote version 1.84svn-r4619)
    
/*Source*/
import Lsystem;

size(8cm,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)));

Étiquettes : ,


L-System with Asymptote – fig0050

Category: Asymptote,L-SystemPh. Ivaldi @ 23 h 40 min

Figure 0005
(Compiled with Asymptote version 1.84svn-r4619)
    
/*Source*/
import Lsystem;

size(8cm,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)));

Étiquettes : ,


L-System with Asymptote – fig0060

Category: Asymptote,L-SystemPh. Ivaldi @ 0 h 40 min

Figure 0006
(Compiled with Asymptote version 1.84svn-r4619)
    
/*Source*/
import Lsystem;

size(8cm,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)));

Étiquettes : ,


L-System with Asymptote – fig0070

Category: Asymptote,L-SystemPh. Ivaldi @ 1 h 40 min

Figure 0007
(Compiled with Asymptote version 1.84svn-r4619)
    
// 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)));

Étiquettes : ,


L-System with Asymptote – fig0080

Category: Asymptote,L-SystemPh. Ivaldi @ 2 h 40 min

Figure 0008
(Compiled with Asymptote version 1.84svn-r4619)
    
/*Source*/
import Lsystem;
size(8cm,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)));

Étiquettes : ,


L-System with Asymptote – fig0090

Category: Asymptote,L-SystemPh. Ivaldi @ 3 h 40 min

Figure 0009
(Compiled with Asymptote version 1.84svn-r4619)
    
/*Source*/
import Lsystem;
size(8cm,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)));

Étiquettes : ,


L-System with Asymptote – fig0100

Category: Asymptote,L-SystemPh. Ivaldi @ 4 h 40 min

Figure 0010
(Compiled with Asymptote version 1.84svn-r4619)
    
/*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)));

Étiquettes : ,