Tiling with Asymptote – fig0010

Category: Asymptote,Examples 2D,TilingPh. Ivaldi @ 12 h 06 min

 (Compiled with Asymptote version 1.87svn-r4652)
```
size(10cm,0);

picture pavehexagonal(int depth=1)
{
picture opic;
path hexa=polygon(6);
pair center;
real a,ap,r,rp,r_d=180/pi;

for(int j=0; j<depth; ++j)
{
for (int i=1; i<=6; ++i)
{
a=i*60-30;
r=j*sqrt(3);
center=r*(rotate(a)*(1,0));
filldraw(opic, shift(center)*hexa, j/depth*.8red+(1-j/depth)*.8*blue);
//Uncomment to see centers of hexagons
dot(opic, shift(center)*midpoint(point(hexa,0)--point(hexa,3)));
//Uncomment to see circles passing by centers
//draw(opic, scale(r)*unitcircle, j/depth*red+(1-j/depth)*blue);
rp=r;
ap=0;
for (real k=0; k<j-1; ++k)
{
r=sqrt((1.5*(j-1 - k))^2 + 3/4*(j+1 + k)^2);
ap+=r_d*acos((rp^2 + r^2 - 3)/(2*r*rp));
center=r*(rotate(a + ap)*(1,0));
filldraw(opic, shift(center)*hexa, j/depth*.8*red+(1-j/depth)*.8*blue);
//Uncomment to see the centers of hexagons
//dot(opic, shift(center)*midpoint(point(hexa,0)--point(hexa,3)));
rp=r;
//Uncomment to see circles passing by centers
//draw(opic, scale(r)*unitcircle, j/depth*red+(1-j/depth)*blue);
}
}
}
return opic;
}

```

Étiquettes : , ,

Tiling with Asymptote – fig0020

Category: Asymptote,Examples 2D,TilingPh. Ivaldi @ 13 h 06 min

 (Compiled with Asymptote version 1.87svn-r4652)
```
size(6cm,0);

//Circular paving with the unit hexagonal picture "hexa"
picture pavehexagonal(picture hexa, int depth=1)
{
picture opic;
pair center;
real a,ap,r,rp,r_d=180/pi;

for(int j=0; j<depth; ++j)
{
for (int i=1; i<=6; ++i)
{
a=i*60-30;
r=j*sqrt(3);
center=r*(rotate(a)*(1,0));
rp=r;
ap=0;
for (real k=0; k<j-1; ++k)
{
r=sqrt((1.5*(j-1 - k))^2 + 3/4*(j+1 + k)^2);
ap+=r_d*acos((rp^2 + r^2 - 3)/(2*r*rp));
center=r*(rotate(a + ap)*(1,0));
rp=r;
}
}
}
return opic;
}

picture hexa;
fill(hexa, polygon(6));
path inh=(0,0)--(.6,sqrt(3)/4)--(.5,sqrt(3)/2)--cycle;

for(int i=0; i<6; ++i)
{
fill(hexa, rotate(60*i)*inh,.5red);
}

draw(hexa, inh);
clip(scale(10)*shift(-.5,-.5)*unitsquare);

```

Étiquettes : ,

Tiling with Asymptote – fig0030

Category: Asymptote,Examples 2D,TilingPh. Ivaldi @ 14 h 06 min

 (Compiled with Asymptote version 1.87svn-r4652)
```
size(10cm,0);

transform r60=rotate(60);

pair A=(sqrt(3)/2,-.5);
pair B=r60*A, C=r60*B, D=r60*C, E=r60*D, F=r60*E;

path AB=A{dir(90)}..(.6,.5)..B{dir(0)};
path DE=shift(E-A)*reverse(AB);
path BC=B{dir(45)}..(.75,.7){dir(150)}..{dir(135)}(.65,.75){dir(70)}..(.5,1.25)..C{dir(255)};
path EF=shift(F-B)*reverse(BC);
path CD=C{dir(255)}..(-.4,.5){dir(200)}..D{dir(160)};
path FA=shift(A-C)*reverse(CD);

draw(A--B--C--D--E--F--cycle,linewidth(2pt));
draw(AB,2pt+.8red);
draw(DE,2pt+.8red);
draw(BC,2pt+.8blue);
draw(EF,2pt+.8blue);
draw(CD,2pt+.8green);
draw(FA,2pt+.8green);

picture hexa;
picture eye;

filldraw(hexa,AB--BC--CD--DE--EF--FA--cycle,black,white);
filldraw(eye,rotate(5)*xscale(.4)*unitcircle,white);
filldraw(hexa,subpath(AB,1,2)--subpath(BC,0,2){dir(225)}..{dir(245)}cycle,.1red+yellow,white);
draw(hexa,point(BC,0.1){dir(115)}.. (.8,.55) ..(.6,.65){dir(180)},yellow+grey);
filldraw(eye,rotate(5)*xscale(.4)*unitcircle,white);
fill(eye,rotate(5)*shift(0,-.1)*xscale(.25)*scale(.5)*unitcircle);

```

Étiquettes : , ,

Tiling with Asymptote – fig0040

Category: Asymptote,Examples 2D,TilingPh. Ivaldi @ 15 h 06 min

 (Compiled with Asymptote version 1.87svn-r4652)
```
size(15cm,0);

transform r60=rotate(60);
picture hexa;
picture eye;

pair A=(sqrt(3)/2,-.5);
pair B=r60*A, C=r60*B, D=r60*C, E=r60*D, F=r60*E;

//Body - corps
path AB=A{dir(90)}..(.6,.5)..B{dir(0)};
path DE=shift(E-A)*reverse(AB);
path BC=B{dir(45)}..(.75,.7){dir(150)}..{dir(135)}(.65,.75){dir(70)}..(.5,1.25)..C{dir(255)};
path EF=shift(F-B)*reverse(BC);
path CD=C{dir(255)}..(-.4,.5){dir(200)}..D{dir(160)};
path FA=shift(A-C)*reverse(CD);

filldraw(hexa,AB--BC--CD--DE--EF--FA--cycle,black,white);

//Nozzle - bec
filldraw(hexa,subpath(AB,1,2)--subpath(BC,0,2){dir(225)}..{dir(245)}cycle,.1red+yellow,white);
draw(hexa,point(BC,0.1){dir(115)}.. (.8,.55) ..(.6,.65){dir(180)},yellow+grey);

//Eye - oeil
filldraw(eye,rotate(5)*xscale(.4)*unitcircle,white);
filldraw(eye,rotate(5)*xscale(.4)*unitcircle,white);
fill(eye,rotate(5)*shift(0,-.1)*xscale(.25)*scale(.5)*unitcircle);

//Circular paving with the unit hexagonal picture "hexa"
picture pavehexagonal(picture hexa, int depth=1)
{
picture opic;
pair center;
real a,ap,r,rp,r_d=180/pi;

for(int j=0; j<depth; ++j)
{
for (int i=1; i<=6; ++i)
{
a=i*60-30;
r=j*sqrt(3);
center=r*(rotate(a)*(1,0));
rp=r;
ap=0;
for (real k=0; k<j-1; ++k)
{
r=sqrt((1.5*(j-1 - k))^2 + 3/4*(j+1 + k)^2);
ap+=r_d*acos((rp^2 + r^2 - 3)/(2*r*rp));
center=r*(rotate(a + ap)*(1,0));
rp=r;
}
}
}
return opic;
}

```

Étiquettes :

Tiling with Asymptote – fig0050

Category: Asymptote,Examples 2D,TilingPh. Ivaldi @ 16 h 06 min

 (Compiled with Asymptote version 1.87svn-r4652)
```
size(10cm,0);

transform r60=rotate(60);
picture hexa;

pair A=(1,0);
pair B=r60*A, C=r60*B, D=r60*C, E=r60*D, F=r60*E;

real tensio=.15;
path BC=reverse(rotate(240,B)*AB);
path CD=reverse(rotate(240,C)*BC);
path DE=reverse(rotate(240,D)*CD);
path EF=reverse(rotate(240,E)*DE);
path FA=reverse(rotate(240,F)*EF);

real lux=-.3, sq=sqrt(3)/2;
lightgrey,(lux*sq,lux/2),0,
grey,(lux*sq,lux/2),1+abs(lux));

//Circular paving with the unit hexagonal picture "hexa"
picture pavehexagonal(picture hexa, int depth=1)
{
picture opic;
pair center;
real a,ap,r,rp,r_d=180/pi;

for(int j=0; j<depth; ++j)
{
for (int i=1; i<=6; ++i)
{
a=i*60-30;
r=j*sqrt(3);
center=r*(rotate(a)*(1,0));
rp=r;
ap=0;
for (real k=0; k<j-1; ++k)
{
r=sqrt((1.5*(j-1 - k))^2 + 3/4*(j+1 + k)^2);
ap+=r_d*acos((rp^2 + r^2 - 3)/(2*r*rp));
center=r*(rotate(a + ap)*(1,0));
rp=r;
}
}
}
return opic;
}

```

Étiquettes :

Tiling with Asymptote – fig0060

Category: Asymptote,Examples 2D,TilingPh. Ivaldi @ 17 h 06 min

 (Compiled with Asymptote version 1.87svn-r4652)
```
size(10cm,0);

transform r60=rotate(60);

pair A=(1,0);
pair B=r60*A, C=r60*B, D=r60*C, E=r60*D, F=r60*E;

real tensio=.25;
path BC=reverse(rotate(240,B)*AB);
path CD=reverse(rotate(240,C)*BC);
path DE=reverse(rotate(240,D)*CD);
path EF=reverse(rotate(240,E)*DE);
path FA=reverse(rotate(240,F)*EF);
path pth1=AB--BC--CD--DE--EF--FA;

real tensio=.5;
path BC=reverse(rotate(240,B)*AB);
path CD=reverse(rotate(240,C)*BC);
path DE=reverse(rotate(240,D)*CD);
path EF=reverse(rotate(240,E)*DE);
path FA=reverse(rotate(240,F)*EF);
path pth2=AB--BC--CD--DE--EF--FA;

//Circular paving with the unit hexagonal picture "hexa"
picture pavehexagonal(picture hexa, int depth=1)
{
picture opic;
pair center;
real a,ap,r,rp,r_d=180/pi;

for(int j=0; j<depth; ++j)
{
for (int i=1; i<=6; ++i)
{
a=i*60-30;
r=j*sqrt(3);
center=r*(rotate(a)*(1,0));
rp=r;
ap=0;
for (real k=0; k<j-1; ++k)
{
r=sqrt((1.5*(j-1 - k))^2 + 3/4*(j+1 + k)^2);
ap+=r_d*acos((rp^2 + r^2 - 3)/(2*r*rp));
center=r*(rotate(a + ap)*(1,0));
rp=r;
}
}
}
return opic;
}

picture hexa, hexat;

real lux=-.3, sq=sqrt(3);
lightgrey,(lux*sq/2,lux/2),0,
grey,(lux*sq/2,lux/2),1+abs(lux));

clip(hexat,pth2--cycle);
draw(hexat,pth2);

```

Étiquettes : ,

Tiling with Asymptote – fig0070

Category: Asymptote,Examples 2D,TilingPh. Ivaldi @ 18 h 06 min

 (Compiled with Asymptote version 1.87svn-r4652)
```
/*Author: Guillaume Connan */
size(10cm,0);

void zigzag(int k)
{
real t=180/k;
pair o=(0,0), m=dir(t),
n=rotate(180-2*t,m)*o,
b=rotate(4*t-180,n)*m,
c=rotate(180-6*t,b)*n,
nn=reflect(o,b)*n;

path lo=m--n--b--nn--cycle,
p=o--m--n--b--c--cycle,
pp=reflect(o,b)*p;

for (int i=0; i <= k; ++i){
filldraw(rotate(2*t*i,o)*p,.5*(red+blue));
filldraw(rotate(2*t*i,o)*pp,0.25(red+blue));
filldraw(rotate(2*t*i,o)*lo,(red+blue));
}
}

zigzag(25);
shipout(bbox(3mm,2mm+miterjoin+black,FillDraw(0.5*blue)));

```

Étiquettes : , , ,