Outils du site


wiki:asymptote:exemples:three

Module three

Tétraèdre

707d6c82d30e7b2ccbc79e671b515331.png

size(0,5cm);

settings.render = 0;
settings.prc = false;

import three;
currentprojection = perspective(0,2,1);

real r = 4, h = 5;

triple pA = (r,0,0);
triple pB = rotate(120,Z)*pA;
triple pC = rotate(180,Z)*pA;
triple pH = (0,1,0);
triple pS = (0,1,h);

draw(pA--pB--pC^^pS--pB^^pS--pC^^pS--pA);
draw(pA--pC,dashed);
draw(pS--pH^^pA--pH,dotted);

dot(Label("$A$",align=W),pA);
dot(Label("$B$",align=SE),pB);
dot(Label("$C$",align=E),pC);
dot(Label("$H$",align=E),pH);
dot(Label("$S$",align=N),pS);

shipout(bbox(xmargin=1mm,invisible));

Dégradé sur une surface

On utilise ici le module palette.

[asy unknown error.]

import three;
import palette;
size(7cm,0); 
settings.render=0;
settings.prc=false;
currentprojection=perspective(100,100,50); 

real s=2;
transform3 T1=shift(0,s,0), T2=shift(0,0,s);

path[] p1=texpath((scale(.5)*"$2011$"));
surface sp1=T1*rotate(180,O,Y)*surface(p1);
// Dégradé
sp1.colors(palette(sp1.map(ypart),Gradient(black,white)));
draw(sp1);

path[] p2=texpath((scale(.5)*"$2011$"));
surface sp2=T2*rotate(90,O,X)*rotate(180,O,Y)*surface(p2);
draw(sp2,red);
shipout(bbox(1mm,invisible));

wiki/asymptote/exemples/three.txt · Dernière modification: 2017/07/31 17:40 par MB