Asymptote using grid3.asy – fig0300

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 22 h 09 min

Figure 0003
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25, 1, 0.25);
limits((-2,-2,0), (0,2,2));

grid3(new grid3routines [] {XYXgrid(Relative(1)), XZXgrid(0)});

xaxis3(Label("$x$",position=EndPoint,align=S), Bounds(Min,Min), OutTicks());
yaxis3(Label("$y$",position=EndPoint,align=S), Bounds(Min,Min), OutTicks());
zaxis3(Label("$z$",position=EndPoint,align=(0,.5)+W), Bounds(Min,Min), OutTicks(beginlabel=false));

Étiquettes : , ,


Asymptote using grid3.asy – fig0400

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 23 h 09 min

Figure 0004
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25, 1, 0.25);
limits((-2,-2,0),(0,2,2));

grid3(new grid3routines [] {XYXgrid(-0.5), XYXgrid(1.5)},
      pGrid=new pen[] {red, blue},
      pgrid=new pen[] {0.5red, 0.5blue});
xaxis3(Label("$x$",position=EndPoint,align=Z), YZEquals(-2,0), OutTicks());
yaxis3(Label("$y$",position=EndPoint,align=Z), XZEquals(-2,0), OutTicks());
zaxis3(Label("$z$",position=EndPoint,align=X), XYEquals(-2,-2), OutTicks(Label("",align=-X-Y)));

Étiquettes : , ,


Asymptote using grid3.asy – fig0500

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 0 h 09 min

Figure 0005
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25,1,0.25);
limits((-2,-2,0),(0,2,2));

real Step=0.5, step=0.25;
xaxis3(Label("$x$",position=EndPoint,align=Z), YZEquals(-2,0),
       InOutTicks(Label(align=0.5*(Z-Y)),
                  Step=Step, step=step,
                  gridroutine=XYgrid,
                  pGrid=red, pgrid=0.5red));

yaxis3(Label("$y$",position=EndPoint,align=Z), XZEquals(-2,0),
       InOutTicks(Label(align=-0.5*(X-Z)), Step=Step, step=step,
                  gridroutine=YXgrid,
                  pGrid=red, pgrid=0.5red));

zaxis3("$z$", XYEquals(-1,0), OutTicks(Label(align=-0.5*(X+Y))));

Étiquettes : , ,


Asymptote using grid3.asy – fig0600

Category: Asymptote,Examples 3D,grid3.asyPh. Ivaldi @ 1 h 09 min

Figure 0006
(Compiled with Asymptote version 2.14svn-r5318)
    
import grid3;

size(10cm,0,IgnoreAspect);
currentprojection=orthographic(0.25,1,0.25);
limits((-2,-2,0),(0,2,2));

xaxis3(Label("$x$",position=EndPoint,align=Z), YZEquals(-2,0),
       OutTicks(Label(align=0.5*(Z-Y)),Step=0.5, gridroutine=XYgrid));

yaxis3(Label("$y$",position=EndPoint,align=-X), XZEquals(-2,0),
       InOutTicks(Label(align=0.5*(Z-X)),N=8,n=2, gridroutine=YX_YZgrid));

zaxis3("$z$", OutTicks(ZYgrid));

Étiquettes : , ,


Asymptote using three.asy – fig0010

Category: Asymptote,Examples 3D,three.asyPh. Ivaldi @ 14 h 50 min

Figure 0001
(Compiled with Asymptote version 2.14svn-r5318)
    
/* One may view this animated example */
import three;

size(12cm);
currentprojection=orthographic(1,1,1.5);
currentlight=(1,0,1);

triple P00=-X-Y+0.5*Z, P03=-X+Y, P33=X+Y, P30=X-Y;

triple[][] P={
  {P00,P00+(-0.5,0.5,-1),P03+(0,-0.5,1),P03},
  {P00+(0.5,-0.5,-1),(-0.5,-0.5,0.5),(-0.5,0.5,-1.5),P03+(0.5,0,1)},
  {P30+(-0.5,0,1),(0.5,-0.5,-1.5),(0.5,0.5,1),P33+(-0.5,0,1)},
  {P30,P30+(0,0.5,1),P33+(0,-0.5,1),P33}
};

surface s=surface(patch(P));
draw(s,15,15,yellow,meshpen=grey);
draw(sequence(new path3(int i){
      return s.s[i].external();},s.s.length), bp+red);

dot("P[0][0]",P[0][0], align=N, black);
dot("P[0][3]",P[0][3], black);
dot("P[3][3]",P[3][3], align=S, black);
dot("P[3][0]",P[3][0], align=W, black);

draw(Label("P[0][1]",align=SW,EndPoint),P[0][0]--P[0][1], Arrow3);
draw(Label("P[1][0]",align=SE,EndPoint),P[0][0]--P[1][0], Arrow3);

draw(Label("P[0][2]",align=E,EndPoint),P[0][3]--P[0][2], Arrow3);
draw(Label("P[1][3]",EndPoint),P[0][3]--P[1][3], Arrow3);

draw(Label("P[2][3]",EndPoint),P[3][3]--P[2][3], Arrow3);
draw(Label("P[3][2]",EndPoint),P[3][3]--P[3][2], Arrow3);

draw(Label("P[3][1]",EndPoint),P[3][0]--P[3][1], Arrow3);
draw(Label("P[2][0]", align=W,EndPoint),P[3][0]--P[2][0], Arrow3);


dot("P[1][1]",P[1][1], align=S);
dot("P[1][2]",P[1][2], align=E);
dot("P[2][2]",P[2][2], align=N);
dot("P[2][1]",P[2][1], align=W);

for (int i=0; i < s.s.length; ++i)
  dot(s.s[i].internal(), bp+red);

if(!is3D())
  shipout(bbox(Fill(lightgrey)));

Étiquettes : , , , ,


Asymptote using three.asy – fig0020

Category: Asymptote,Examples 3D,three.asyPh. Ivaldi @ 15 h 50 min

Figure 0002
(Compiled with Asymptote version 2.14svn-r5318)
    
import three;
import palette;

size(12cm);
currentprojection=orthographic(1,1,1.5);
currentlight=(1,0,1);

triple P00=-X-Y+0.5*Z, P03=-X+Y, P33=X+Y, P30=X-Y;

triple[][] P={
  {P00,P00+(-0.5,0.5,-1),P03+(0,-0.5,1),P03},
  {P00+(0.5,-0.5,-1),(-0.5,-0.5,0.5),(-0.5,0.5,-1.5),P03+(0.5,0,1)},
  {P30+(-0.5,0,1),(0.5,-0.5,-1.5),(0.5,0.5,1),P33+(-0.5,0,1)},
  {P30,P30+(0,0.5,1),P33+(0,-0.5,1),P33}
};

surface s=surface(patch(P));
s.colors(palette(s.map(zpart),Gradient(yellow,red)));
// s.colors(palette(s.map(zpart),Rainbow()));

draw(s);
draw(sequence(new path3(int i){
      return s.s[i].external();},s.s.length), bp+orange);


if(!is3D())
  shipout(bbox(Fill(lightgrey)));

Étiquettes : , , , , ,


Asymptote using three.asy – fig0030

Category: Asymptote,Examples 3D,three.asyPh. Ivaldi @ 16 h 50 min

Figure 0003
(Compiled with Asymptote version 2.14svn-r5318)
    
import three;

size(10cm);
currentlight=(0,0,1);

surface sf=surface(patch(P=new triple[][] {
      {(0,0,0),(1,0,0),(1,0,0),(2,0,0)},
      {(0,1,0),(1,0,1),(1,0,1),(2,1,0)},
      {(0,1,0),(1,0,-1),(1,0,-1),(2,1,0)},
      {(0,2,0),(1,2,0),(1,2,0),(2,2,0)}
    }));

draw(sf,surfacepen=yellow);
draw(sf.s[0].vequals(0.5),squarecap+2bp+blue,currentlight);
draw(sf.s[0].uequals(0.5),squarecap+2bp+red,currentlight);

Étiquettes : , , , , ,


Asymptote using three.asy – fig0040

Category: Asymptote,Examples 3D,three.asyPh. Ivaldi @ 17 h 50 min

Figure 0004
(Compiled with Asymptote version 2.14svn-r5318)
    
import three;
size(8cm,0);
real radius=1, theta=37, phi=60;

currentprojection=perspective(4,1,2);

// Planes
pen bg=gray(0.9)+opacity(0.5);
draw(surface((1.2,0,0)--(1.2,0,1.2)--(0,0,1.2)--(0,0,0)--cycle),bg,bg);
draw(surface((0,1.2,0)--(0,1.2,1.2)--(0,0,1.2)--(0,0,0)--cycle),bg,bg);
draw(surface((1.2,0,0)--(1.2,1.2,0)--(0,1.2,0)--(0,0,0)--cycle),bg,bg);

real r=1.5;
draw(Label("$x$",1), O--r*X, Arrow3(HookHead3));
draw(Label("$y$",1), O--r*Y, Arrow3(HookHead3));
draw(Label("$z$",1), O--r*Z, Arrow3(HookHead3));
label("$\rm O$", (0,0,0), W);

triple pQ=radius*dir(theta,phi); // Point Q
// triple pQ=radius*expi(radians(theta),radians(phi)); // Point Q
draw(O--radius*dir(90,phi)^^O--pQ, dashed);
dot("$R*\mathrm{dir}\left(\theta,\phi\right)$",pQ);

// Arcs
draw("$\theta$", reverse(arc(O,0.5*pQ,0.5*Z)), N+0.3E, Arrow3(HookHead2));
draw("$\phi$", arc(O,0.5*X,0.5*(pQ.x,pQ.y,0)), N+0.3E, Arrow3(HookHead2));

path3 p3=O--arc(O,radius,0,phi,90,phi)--cycle;
draw(surface(p3), blue+opacity(0.5));

Étiquettes : , , , ,


Asymptote using three.asy – fig0050

Category: Asymptote,Examples 3D,three.asyPh. Ivaldi @ 18 h 50 min

Figure 0005
(Compiled with Asymptote version 2.14svn-r5318)
    
import three; import math;
size(8cm,0);
currentprojection=obliqueX;

real h=2;
triple A =(0,0,h), B=(h,0,0), C=(0,h,0), D=(0,0,0);
triple Ip=midpoint(A--C), J=midpoint(A--B);
triple K=shift((0,0,-0.25*h))*A;

triple M=interp(K,J,intersect(K,J,normal(new triple[]{B,C,D}),D));
triple Np=interp(K,Ip,intersect(K,Ip,normal(new triple[]{B,C,D}),D));

dot("$A$", A, align=Z);  dot("$B$", B, align=S);
dot("$C$", C, align=S);  dot("$D$", D, align=W);
dot("$I$", Ip, align=N); dot("$J$", J, align=W);
dot("$K$", K, align=NE); dot("$M$", M, align=SE);
dot("$N$", Np, align=S);

draw(A--B--C--cycle^^B--M^^C--Np^^J--M^^Ip--Np);
draw(A--D--C^^D--B^^J--K^^K--Ip, dashed);

Étiquettes : , , , ,


Asymptote using three.asy – fig0060

Category: Asymptote,Examples 3D,three.asyPh. Ivaldi @ 19 h 50 min

Figure 0006
(Compiled with Asymptote version 2.14svn-r5318)
    
settings.render=0;
import three;
size(4cm,0);

currentprojection=perspective((45,45,30));
path3 YZ=plane((0,4,0),(0,0,4));

draw("$x$",project(O--X),Arrow);
draw("$y$",project(O--Y),Arrow);
draw("$z$",project(O--Z),Arrow);
draw(YZ);

label(scale(5)*project("A",Y,Z,(0,1,1)));

Étiquettes : , ,