SOLIDES (51)
Liste des figures
Figure fig_aa01_271008_sphere
figure 0001
Figure fig_aa02_270615_sphere
figure 0002
Figure fig_aa03_270615_sphere
figure 0003
Figure fig_ab01_271008_sphere
figure 0004
Figure fig_ab02_271008_sphere
figure 0005
Figure fig_ab03_270615_sphere
figure 0006
Figure fig_ab03_271008_sphere
figure 0007
Figure fig_ab04_271008_sphere
figure 0008
Figure fig_ab05_271008_sphere
figure 0009
Figure fig_ab06_271008_sphere
figure 0010
Figure fig_ab07_271008_sphere
figure 0011
Figure fig_ab08_271008_sphere
figure 0012
Figure fig_ab09_271008_sphere
figure 0013
Figure fig_ac01_271008_sphere
figure 0014
Figure fig_ac99_090109_sphere
figure 0015
Figure fig_ad02_090109_sphere
figure 0016
Figure fig_ad03_090109_sphere
figure 0017
Figure fig_ad04_090109_sphere
figure 0018
Figure fig_ad05_090109_sphere
figure 0019
Figure fig_ad06_090109_sphere
figure 0020
Figure fig_ad07_140509_sphere
figure 0021
Figure fig_ba01_271008_cone
figure 0022
Figure fig_ba02_271008_cone
figure 0023
Figure fig_ba03_271008_cone
figure 0024
Figure fig_bb01_271008_cone
figure 0025
Figure fig_bc01_200309_unitcone
figure 0026
Figure fig_bs01_150509_section_cone
figure 0027
Figure fig_ca01_200309_unitcylinder
figure 0028
Figure fig_ca02_280909_cylindre
figure 0029
Figure fig_cb01_170211_cylindres_concentriques
figure 0030
Figure fig_cb02_041211_cylindres_concentriques
figure 0031
Figure fig_pa01_191108_cube
figure 0032
Figure fig_pa02_191108_cube
figure 0033
Figure fig_pa03_141208_cube
figure 0034
Figure fig_pa04_060309_cube
figure 0035
Figure fig_pa05_281009_cube
figure 0036
Figure fig_pb01_191108_cube
figure 0037
Figure fig_pc01_200309_cube
figure 0038
Figure fig_pc02_200309_cube
figure 0039
Figure fig_pd01_191108_pave_droit
figure 0040
Figure fig_pd02_200309_pave_droit
figure 0041
Figure fig_pd03_200309_pave_droit
figure 0042
Figure fig_py01_251011_pyramide
figure 0043
Figure fig_py02_251011_pyramide
figure 0044
Figure fig_py03_251011_pyramide
figure 0045
Figure fig_py04_251011_pyramide
figure 0046
Figure fig_py05_261011_pyramide
figure 0047
Figure fig_ta01_300509_tore
figure 0048
Figure fig_ua01_281009_unit_solides
figure 0049
Figure fig_ua02_281009_unit_solides
figure 0050
Figure fig_ua03_281009_unitfrustum
figure 0051
Asymptote - Figure 0001: fig_aa01_271008_sphere.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_aa01_271008_sphere
import three;

size(6cm);
currentprojection=orthographic(5,4,3);

draw(unitsphere,green);
Asymptote - Figure 0002: fig_aa02_270615_sphere.asy
(Code compilé avec Asymptote version 2.36svn-r5722)
largeur320 Figure fig_aa02_270615_sphere
import three;

defaultrender.merge=true;
size(6cm,0);

currentprojection=orthographic(-Z);

draw(unitsphere, 
     surfacepen=material(diffusepen=gray(0.5),
                         emissivepen=gray(0.6),
                         specularpen=black)
    );
Asymptote - Figure 0003: fig_aa03_270615_sphere.asy
(Code compilé avec Asymptote version 2.36svn-r5722)
largeur320 Figure fig_aa03_270615_sphere
import three;
size(8cm,0);
currentlight.background=black;

material White(real x, real y){
   return material(diffusepen=gray(.05+.1x+.3y),
                   emissivepen=gray(.05+.1x+.3y));
}

for(int y=0; y<=2; ++y)
    for(int x=0; x<3; ++x)
        draw(shift(2x,2y,0)*unitsphere,White(x,y));
Asymptote - Figure 0004: fig_ab01_271008_sphere.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ab01_271008_sphere
import solids;

currentprojection=orthographic(0,10,5);
currentlight=light(paleyellow, (5,-5,10),(0,0,-10));

size(6cm,0);

// void draw(picture pic=currentpicture, revolution r, int m=0, int n=nslice,
//        pen frontpen=currentpen, pen backpen=frontpen,
//        pen longitudinalpen=frontpen, pen longitudinalbackpen=backpen,
//        light light=currentlight, projection P=currentprojection)

draw(sphere(1,n=8*nslice),m=10,frontpen=.8bp+blue,
                               backpen=linetype("8 0")+.8bp+blue,
                               longitudinalpen=nullpen);

// void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
//          material surfacepen=currentpen, pen meshpen=nullpen,
//        light light=currentlight, light meshlight=light)
//
// syntaxe possible : material[] au lieu de material

draw(surface(sphere(1,n=8*nslice)),palegreen+opacity(.9));
Asymptote - Figure 0005: fig_ab02_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ab02_271008_sphere
import solids;

size(6cm,0);

currentprojection=orthographic(0,8,2);
viewportmargin=(10,10);
currentlight=White;

revolution b=sphere(O,1);

draw(surface(b),yellow+opacity(0.3));

skeleton s;
b.transverse(s,reltime(b.g,0.5),P=currentprojection);
draw(s.transverse.back,linetype("8 8",8)+1bp+black);
draw(s.transverse.front,1bp+black);
Asymptote - Figure 0006: fig_ab03_270615_sphere.asy
(Code compilé avec Asymptote version 2.36svn-r5722)
largeur320 Figure fig_ab03_270615_sphere
import solids;

size(7.5cm,0);

currentprojection=orthographic(3,9,2);
currentlight=light(diffuse=white,
                   background=rgb(0,0,0),
                   (5,5,5),(5,-5,-5),(0,-5,-5));

revolution sph=sphere(O,1);

real a=.7; //compris entre 0 et 1
real b=2.4;
draw(surface(shift(-b/2,-b/2,sin(pi*(a-.5)))*scale3(b)*unitsquare3),white+opacity(.7));
draw(surface(sph),orange);

skeleton s;
sph.transverse(s,reltime(sph.g,a),P=currentprojection);
draw(s.transverse.back,linetype("8 8",8));
draw(s.transverse.front);
Asymptote - Figure 0007: fig_ab03_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ab03_271008_sphere
import solids;

size(7.5cm,0);

currentprojection=orthographic(3,9,2);
currentlight=White;

revolution sph=sphere(O,1);

real a=.7; //compris entre 0 et 1
real b=2.4;
draw(surface(shift(-b/2,-b/2,sin(pi*(a-.5)))*scale3(b)*unitsquare3),white+opacity(.7));
draw(surface(sph),orange);

skeleton s;
sph.transverse(s,reltime(sph.g,a),P=currentprojection);
draw(s.transverse.back,linetype("8 8",8));
draw(s.transverse.front);
Asymptote - Figure 0008: fig_ab04_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ab04_271008_sphere
import solids;

size(6cm,0);

currentprojection=orthographic(3,2,2);
currentlight=nolight;

nslice=4*nslice;
revolution b=sphere(O,1);
draw(surface(b), paleblue+opacity(0.5));

skeleton s;

b.transverse(s,reltime(b.g,0.6),P=currentprojection);
b.transverse(s,reltime(b.g,0.5),P=currentprojection);
draw(s.transverse.back,linetype("8 8",8));
draw(s.transverse.front);

b.longitudinal(s,P=currentprojection);
draw(s.longitudinal.front);
draw(s.longitudinal.back,linetype("8 8",8));
Asymptote - Figure 0009: fig_ab05_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ab05_271008_sphere
import solids;

size(5cm);

currentprojection=orthographic(10,5,2);
currentlight=Headlamp;

nslice=4*nslice;
revolution b=sphere(O,1);
draw(surface(b),palegreen+opacity(.5));

skeleton s;

b.transverse(s,reltime(b.g,0.2),P=currentprojection);
b.transverse(s,reltime(b.g,0.5),P=currentprojection);
draw(s.transverse.back,linetype("8 4",8));
draw(s.transverse.front,red);
Asymptote - Figure 0010: fig_ab06_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ab06_271008_sphere
size(6cm,0);
import solids;

currentlight=Headlamp; // inutile car Headlamp est la valeur par défaut

nslice=4*nslice;
revolution boule=sphere(O,1);
draw(surface(boule),lightgrey+white+opacity(.5));

skeleton s;

for(real i=.5; i<1; i+=.1){
boule.transverse(s,reltime(boule.g,i),P=currentprojection);
draw(s.transverse.back,linetype("10 10",10));
draw(s.transverse.front);
}
Asymptote - Figure 0011: fig_ab07_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ab07_271008_sphere
size(6cm,0);
import solids;

currentprojection=orthographic(5,10,0);
currentlight=White; // Headlamp est la valeur par défaut

nslice=4*nslice;
revolution boule=sphere(O,1);
draw(surface(boule),lightgrey+white+opacity(.5));

skeleton s;

for(real i=.5; i<1; i+=.1){
boule.transverse(s,reltime(boule.g,i),P=currentprojection);
draw(s.transverse.back,linetype("10 10",10));
draw(s.transverse.front);
}
Asymptote - Figure 0012: fig_ab08_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ab08_271008_sphere
size(6cm,0);
import solids;

currentlight=White; // Headlamp est la valeur par défaut

nslice=4*nslice;
revolution boule=sphere(O,1);
draw(surface(boule),lightgrey+yellow+opacity(.5));

skeleton s;

for(real i=0; i>-1; i-=.2){
boule.transverse(s,reltime(boule.g,acos(i)/pi),P=currentprojection);
draw(s.transverse.back,linetype("10 10",10));
draw(s.transverse.front);
}
Asymptote - Figure 0013: fig_ab09_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ab09_271008_sphere
size(6cm,0);
import solids;

currentprojection=orthographic(10,5,0);
currentlight=Headlamp; // Headlamp est la valeur par défaut

nslice=4*nslice;
revolution boule=sphere(O,1);
draw(surface(boule),lightgrey+yellow+opacity(.5));

skeleton s;

for(real i=0; i>-1; i-=.2){
boule.transverse(s,reltime(boule.g,acos(i)/pi),P=currentprojection);
draw(s.transverse.back,linetype("10 10",10));
draw(s.transverse.front);
}
Asymptote - Figure 0014: fig_ac01_271008_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ac01_271008_sphere
import solids;

size(6cm,0);

currentprojection=orthographic(3,2,2);
viewportmargin=(5,5);

revolution b=sphere(O,1);

draw(b,.5bp+blue);

skeleton s;

b.transverse(s,reltime(b.g,0.6),P=currentprojection);
b.transverse(s,reltime(b.g,0.5),P=currentprojection);
draw(s.transverse.back,1bp+linetype("8 8",8));
draw(s.transverse.front,1bp+black);
Asymptote - Figure 0015: fig_ac99_090109_sphere.asy
(Code compilé avec Asymptote version 2.36svn-r5722)
largeur320 Figure fig_ac99_090109_sphere
import solids;
settings.render=0;
settings.prc=false; // on se restreint à une vue 2d

size(6cm,0); 

currentprojection=orthographic(10,5,2);
dotfactor=3.5; 

real a=3;
triple pO=(0,0,0);
revolution b=sphere(pO,a);
draw(b,1,longitudinalpen=nullpen);
draw(b.silhouette(),black);
dot(pO);
Asymptote - Figure 0016: fig_ad02_090109_sphere.asy
(Code compilé avec Asymptote version 2.36svn-r5722)
largeur320 Figure fig_ad02_090109_sphere
import solids;
settings.render=0; 
settings.prc=false; // on se restreint à une vue 2d

size(6cm,0); 

currentprojection=orthographic(10,5,2);
dotfactor=3.5;

real a=3;
triple pO=(0,0,0);
revolution b=sphere(pO,a);

skeleton s;
b.transverse(s,reltime(b.g,0.5),P=currentprojection);
draw(s.transverse.back,red+linetype("8 8",8));
draw(s.transverse.front,1bp+blue);
draw(b.silhouette(),black);
dot(pO);
Asymptote - Figure 0017: fig_ad03_090109_sphere.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ad03_090109_sphere
import solids;
settings.render=0; 
settings.prc=false; // on se restreint à une vue 2d

size(6cm,0);

currentprojection=orthographic(10,5,2);
dotfactor=3.5;

real a=3;
triple pO=(0,0,0);
revolution b=sphere(pO,a);

draw(b,1,longitudinalpen=nullpen);
draw(surface(b),.9white+opacity(.1));
draw(b.silhouette(),black);
dot(pO);
Asymptote - Figure 0018: fig_ad04_090109_sphere.asy
(Code compilé avec Asymptote version 2.22svn-r5538)
largeur320 Figure fig_ad04_090109_sphere
import solids;
settings.render=0; 
settings.prc=false; // on se restreint à une vue 2d

size(7.5cm,0);

currentprojection=orthographic(10,5,2);

dotfactor=3.5;

real a=3;
triple pO=(0,0,0);
revolution b=sphere(pO,a);

draw(surface(b),.9white+opacity(.15));

skeleton s;
b.transverse(s,reltime(b.g,0.5),P=currentprojection);
draw(s.transverse.back,green+linetype("8 8",8));
draw(s.transverse.front,blue);
dot(pO);

dot(new triple[] {a*X,a*Y,a*Z,O}); 
draw(Label("$x$",align=N),O--a*X,red); 
draw(Label("$y$",align=N),O--a*Y,red); 
draw(Label("$z$",align=E),O--a*Z,red); 

draw(b.silhouette(),blue);
Asymptote - Figure 0019: fig_ad05_090109_sphere.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ad05_090109_sphere
import solids;
settings.render=0; 
settings.prc=false; // on se restreint à une vue 2d

size(7.5cm,0);

currentprojection=orthographic(10,3,8);

dotfactor=3.5;

real a=3;
triple pO=(0,0,0);
revolution b=sphere(pO,a);

dot(pO);
dot(new triple[] {a*X,a*Y,a*Z,O}); 
draw(Label("$x$",align=W),O--a*X,dashed+red); 
draw(Label("$y$",align=N),O--a*Y,dashed+red); 
draw(Label("$z$",align=E),O--a*Z,dashed+red); 

draw(b,1,longitudinalpen=nullpen);
draw(b.silhouette(),1bp+blue);
Asymptote - Figure 0020: fig_ad06_090109_sphere.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ad06_090109_sphere
import solids;
settings.render=0; 
settings.prc=false; // on se restreint à une vue 2d

size(7.5cm,0);

currentprojection=orthographic(10,5,0);

dotfactor=3.5;

real a=3;
triple pO=(0,0,0);
revolution b=sphere(pO,a);

dot(pO);
draw(b,m=5,longitudinalpen=nullpen);
draw(b.silhouette(),1bp+blue);
Asymptote - Figure 0021: fig_ad07_140509_sphere.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ad07_140509_sphere
import solids;
settings.render=0; 
settings.prc=false; // on se restreint à une vue 2d

size(7.5cm,0);

currentprojection=orthographic(10,5,4);
dotfactor=3.5;

revolution b=sphere((0,0,0),3);

draw(b,1,longitudinalpen=nullpen);

for(int k=-2; k<5;++k) 
draw(rotate(k*30,(0,0,1))*rotate(-90,(1,0,0))*b,1,
     longitudinalpen=nullpen);

draw(b.silhouette(),black);
dot((0,0,0));

shipout(bbox(5mm,white));
Asymptote - Figure 0022: fig_ba01_271008_cone.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ba01_271008_cone
size(7cm,0);
import solids;

currentprojection = orthographic(50,50,25);

real r=4, h=7;
triple pO=(0,0,0), pS=(0,0,h), pA=(r,0,0);
revolution CoRev=cone(pO,r,h,axis=Z,n=1);

draw(CoRev,1bp+blue);

draw(pS--pA);
draw(pS--pO^^pO--pA,dashed);

label("$S$",pS,N);
dot(Label("$O$",align=SE),pO);
dot(Label("$A$",align=SW),pA);
Asymptote - Figure 0023: fig_ba02_271008_cone.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ba02_271008_cone
size(7cm,0);
import solids;

currentprojection = orthographic(50,50,25);

real r=4, h=7;
triple pO=(0,0,0), pS=(0,0,h), pA=(r,0,0);
revolution CoRev=cone(pO,r,h,axis=Z,n=1);

draw(surface(CoRev),lightred+opacity(.5));

draw(pS--pA);
draw(pS--pO^^pO--pA,dashed);

label("$S$",pS,N);
dot(Label("$O$",align=SE),pO);
dot(Label("$A$",align=SW),pA);
Asymptote - Figure 0024: fig_ba03_271008_cone.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ba03_271008_cone
size(7cm,0);
import solids;

currentprojection = orthographic(50,20,25);

real r=4, h=7;
triple pO=(0,0,0), pS=(0,0,h), pA=(r,0,0);
revolution CoRev=cone(pO,r,h,axis=Z,n=2);

draw(surface(CoRev),lightblue+opacity(.5));
draw(CoRev,1bp+blue);

draw(pS--pA);
draw(pS--pO^^pO--pA,dashed);

label("$S$",pS,N);
dot(Label("$O$",align=SE),pO);
dot(Label("$A$",align=SW),pA);
dot(Label("$O'$",align=SE),pS/2);
Asymptote - Figure 0025: fig_bb01_271008_cone.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_bb01_271008_cone
////////////////////////////////////////////
// Exemple de la documentation officielle //
////////////////////////////////////////////
// sur le site officiel : cf. galerie, en page 6
// sur le site de Philippe Ivaldi : ici (lien direct)

import solids;
size(7.5cm,0);
currentprojection=orthographic(0,-30,5);

real r=4;
real h=10;
real s=8;
real x=r*s/h;

real sr=5;
real xr=r*sr/h;

real s1=sr-0.1;
real x1=r*s1/h;

real s2=sr+0.2;
real x2=r*s2/h;

path3 p=(0,0,0)--(x,0,s);
revolution a=revolution(p,Z);
draw(surface(a,4),lightblue+opacity(0.5));

path3 q=(x,0,s)--(r,0,h);
revolution b=revolution(q,Z);
draw(surface(b),white+opacity(0.5));

draw((-r-1,0,0)--(r+1,0,0));
draw((0,0,0)--(0,0,h+1),dashed);

path3 w=(x1,0,s1)--(x2,0,s2)--(0,0,s2);
revolution b=revolution(w,Z);
draw(surface(b),blue+opacity(0.5));
draw(circle((0,0,s2),x2));
draw(circle((0,0,s1),x1));

draw("$x$",(xr,0,0)--(xr,0,sr),red,Arrow3);
draw("$r$",(0,0,sr)--(xr,0,sr),N,red);
draw((string) r,(0,0,h)--(r,0,h),N,red);
draw((string) h,(r,0,0)--(r,0,h),red,Arrow3);
draw((string) s,(-x,0,0)--(-x,0,s),W,red,Arrow3);
Asymptote - Figure 0026: fig_bc01_200309_unitcone.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_bc01_200309_unitcone
import solids;

size(6cm);

currentprojection=orthographic(5,5,2);

limits(O,X+Y+Z);
xaxis3(Label("$(1,0,0)$",1),Arrow3);
yaxis3(Label("$(0,1,0)$",1),Arrow3);
zaxis3(Label("$(0,0,1)$",1),Arrow3);

draw(unitcone(n=1),palegreen+opacity(.5),1bp+blue);
Asymptote - Figure 0027: fig_bs01_150509_section_cone.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_bs01_150509_section_cone
size(7.5cm,0);
import solids;
import graph3;

currentprojection=orthographic(40,10,10);

real a=2, r=4, h=7, l=(r/h)^2, m=sqrt(l*h^2-a^2);
limits((-r,-r,-h),(2r,r,1.2*h));
triple pA1=(0,0,-h), pA2=-pA1, pB1=(r,0,-h), pB2=-pB1,
       pO=(0,0,0), pI=(a,0,-sqrt(a^2/l));
triple F1(real y){return (a,y,sqrt((a^2+y^2)/l));}
triple F2(real y){return (a,y,-sqrt((a^2+y^2)/l));}
path3 b1=graph(F1,-r,r,operator ..),
      b2=graph(F2,-r,r,operator ..);
triple v1=(0,2m,0),v2=(0,0,2h),p0=(a,-m,-h);
path3 pl1=plane(v1,v2,p0);

draw(cone(pA1,r,h,Z,1),1bp+blue,longitudinalpen=nullpen);
draw(cone(pA2,r,h,-Z,1),1bp+blue,longitudinalpen=nullpen);

// Figure prévue initialement avec transparence du cône (+opacity(.6))
// supprimée dans les 2 lignes suivantes pour un meilleur rendu ci-contre.
draw(surface(cone(pA1,r,h,Z,1)),lightgray+white);
draw(surface(cone(pA2,r,h,-Z,1)),lightgray);

draw(surface(pl1),green+opacity(.6));
draw(pI--pB1^^pA2--pB2);
draw(pB1--pA1--pA2^^pI--pO--pB2,dashed);
draw(b1^^b2,1bp+red);

dot(pB1--pA1--pA2^^pI--pO--pB2);
dot((a,m,-h)--(a,m,h)--(a,-m,h)--(a,-m,-h));
dot(Label("$a$",align=-Y+X),(a,0,0));
label("$O$",pO,2E);
xaxis3("$x$",Arrow3);
yaxis3("$y$",Arrow3);
zaxis3("$z$",Arrow3);

shipout(bbox(.5cm,Fill(white)));
Asymptote - Figure 0028: fig_ca01_200309_unitcylinder.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ca01_200309_unitcylinder
import solids;

size(6cm);

currentprojection=orthographic(4,5,8);

limits(O,X+Y+Z);
xaxis3(Label("$(1,0,0)$",1),Arrow3);
yaxis3(Label("$(0,1,0)$",1),Arrow3);
zaxis3(Label("$(0,0,1)$",1),Arrow3);

draw(unitcylinder,blue+opacity(.6),1bp+orange);
Asymptote - Figure 0029: fig_ca02_280909_cylindre.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ca02_280909_cylindre
import solids;

size(7cm);

currentprojection=orthographic(
camera=(0.901370856430926,6.6670309932277,4.12892953058253),
up=(-0.00669345996391094,-0.00562113947193458,0.0167831924904972),
target=(0.250973517912766,0.260452385430086,1.72379105889263));

currentlight=White;

limits(O,2X+2Y+4Z);
xaxis3(Arrow3);
yaxis3(Arrow3);
zaxis3(Arrow3);

draw(zscale3(3)*unitcylinder,paleyellow+opacity(.95));
Asymptote - Figure 0030: fig_cb01_170211_cylindres_concentriques.asy
(Code compilé avec Asymptote version 2.09svn)
largeur320 Figure fig_cb01_170211_cylindres_concentriques
import solids;
size(7.5cm);
currentprojection=orthographic((5,2,2),up=Z,zoom=.95);
real r1=4, r2=3, h1=5, h2=3;
path3 p1=(0,0,0)--(r1,0,0)--(r1,0,h1)--(r2,0,h1),
      p2=(r2,0,h1)--(r2,0,h1+h2)--(0,0,h1+h2);
revolution g1=revolution(p1,Z),
           g2=revolution(p2,Z);
draw(surface(g1),lightblue);
draw(surface(g2),lightred);
limits((0,0,0),(r1+2,r1+2,h1+h2+2));
xaxis3("$x$",Arrow3());
yaxis3("$y$",Arrow3());
zaxis3("$z$",Arrow3());
Asymptote - Figure 0031: fig_cb02_041211_cylindres_concentriques.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_cb02_041211_cylindres_concentriques
import graph3;
size(7.5cm);
currentprojection=perspective(camera=(4,4,7),up=Z);

path3[] p=reverse(unitcircle3)^^scale3(0.5)*unitcircle3;
draw(surface(p,planar=true),red,render(merge=true));
draw(surface(shift(Z)*p,planar=true),red,render(merge=true));

path[] g=reverse(unitcircle)^^scale(0.5)*unitcircle;
for(path gi : g) draw(extrude(gi,Z),lightgray);

limits((0,0,0),1.5*(X+Y)+2Z);
xaxis3("$x$",Arrow3());
yaxis3("$y$",Arrow3());
zaxis3("$z$",Arrow3());
Asymptote - Figure 0032: fig_pa01_191108_cube.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_pa01_191108_cube
import solids;

currentprojection=orthographic(5,3,2);

size(6cm);

limits(O,X+Y+Z);
xaxis3(Label("$(1,0,0)$",1),Arrow3);
yaxis3(Label("$(0,1,0)$",1),Arrow3);
zaxis3(Label("$(0,0,1)$",1),Arrow3);

draw(unitbox);
dot(unitbox,blue); 

label("$O$",(0,0,0),NW);
Asymptote - Figure 0033: fig_pa02_191108_cube.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_pa02_191108_cube
// Fichier polyhedron_js.asy, téléchargeable ici : polyhedron_js.asy
import solids;
import polyhedron_js;

currentprojection=orthographic(5,3,2);

size(8cm);

limits(O,X+Y+Z);
xaxis3(Label("$x$",1),Arrow3);
yaxis3(Label("$y$",1),Arrow3);
zaxis3(Label("$z$",1),Arrow3);

// Dans l'exemple précédent, a été utilisé 'unitbox',
// dans celui-ci, on utilise 'cube' défini dans l'extension polyhedron_js
// (où on trouve définis des polyhèdres inscrits dans une sphère de rayon 1).
draw(scale3(.866)*cube,red);
// Un cube de côté 1 est inscrit dans une sphère de rayon rac(3)/2,
// ce qui explique la réduction de coefficient 0.866.

label("$O$",(0,0,0),NW);
dot("\scriptsize $\left(\frac{1}{2},0,0\right)$",(.5,0,0),NW,blue);
dot("\scriptsize $\left(0,\frac{1}{2},0\right)$",(0,.5,0),N,blue);
dot("\scriptsize $\left(0,0,\frac{1}{2}\right)$",(0,0,.5),W,blue);
Asymptote - Figure 0034: fig_pa03_141208_cube.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_pa03_141208_cube
// Lecture d'un fichier OBJ (avec plusieurs groupes)
// (fichier, téléchargeable ici : cube2.obj)

import obj;
size(7.5cm);
currentprojection=orthographic(3,2,4);
pen[] surfacepen={blue+opacity(.8),// un peu de transparence pour la face du dessus.
                  black,
                  yellow,
                  red,
                  green,
                  gray};
draw(obj("cube2.obj",surfacepen),nolight);
Asymptote - Figure 0035: fig_pa04_060309_cube.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_pa04_060309_cube
// Lecture d'un fichier OBJ (avec plusieurs groupes)
// (fichier, téléchargeable ici : cube2.obj)

import obj;
size(7.5cm);
currentprojection=orthographic(3,2,4);
pen[] surfacepen={paleblue,
                  palered,
                  paleyellow,
                  pink,
                  palegreen,
                  orange};
draw(obj("cube2.obj",surfacepen),nolight);
Asymptote - Figure 0036: fig_pa05_281009_cube.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_pa05_281009_cube
// Lecture d'un fichier OBJ (avec plusieurs groupes)
// (fichier, téléchargeable ici : cube2.obj)

settings.render=0;
settings.prc=false;
settings.outformat="pdf";

import obj;
size(8cm);
currentprojection=orthographic(3,2,2);
pen[] surfacepen={white,
                  white,
                  blue,
                  green,
                  blue,
                  green};
draw(obj("cube2.obj",surfacepen),nolight);

shipout(bbox(1cm,2cm,RadialShade(black,palered)));
Asymptote - Figure 0037: fig_pb01_191108_cube.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_pb01_191108_cube
// Fichier polyhedron_js.asy, téléchargeable ici : polyhedron_js.asy
import solids;
import polyhedron_js;

currentprojection=perspective(6,3,3);

size(7.5cm);

limits(O,X+Y+Z);
xaxis3(Label("$x$",1),red,Arrow3);
yaxis3(Label("$y$",1),red,Arrow3);
zaxis3(Label("$z$",1),red,Arrow3);

for (int i=0; i<=5; ++i){
    draw(surface(scale3(.866)*cube[i]),
         paleblue+white+opacity(.9),orange);
}
dot(scale(1.1)*"$\left(\frac{1}{2},0,0\right)$",(.5,0,0),2X+2Z,green);
dot(scale(1.1)*"$\left(0,\frac{1}{2},0\right)$",(0,.5,0),X+Y+Z,green);
dot(scale(1.1)*"$\left(0,0,\frac{1}{2}\right)$",(0,0,.5),Z,green);
Asymptote - Figure 0038: fig_pc01_200309_cube.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_pc01_200309_cube
import solids;

currentprojection=orthographic(5,4,4);

size(6cm);

draw(unitcube,blue+opacity(.6),orange);

label("$O$",(0,0,0),NW);
Asymptote - Figure 0039: fig_pc02_200309_cube.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_pc02_200309_cube
import solids;

currentprojection=orthographic(5,4,4);

size(6cm);

limits(O,1.2*(X+Y+Z));
xaxis3(Arrow3);
yaxis3(Arrow3);
zaxis3(Arrow3);

draw(unitcube,blue+opacity(.7),1.5bp+yellow,nolight);
Asymptote - Figure 0040: fig_pd01_191108_pave_droit.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_pd01_191108_pave_droit
// Fichier polyhedron_js.asy, téléchargeable ici : polyhedron_js.asy
import solids;
import polyhedron_js;

currentprojection=orthographic(5,3,4);

size(7.5cm);

real a=10,b=8,c=6;
polyhedron pave;
pave[0]=(0,0,0)--(a,0,0)--(a,b,0)--(0,b,0)--cycle;
pave[1]=(0,0,0)--(a,0,0)--(a,0,c)--(0,0,c)--cycle;
pave[2]=(0,b,0)--(0,0,0)--(0,0,c)--(0,b,c)--cycle;
pave[3]=(a,0,0)--(a,b,0)--(a,b,c)--(a,0,c)--cycle;
pave[4]=(a,b,0)--(0,b,0)--(0,b,c)--(a,b,c)--cycle;
pave[5]=(0,0,c)--(a,0,c)--(a,b,c)--(0,b,c)--cycle;
// Compilé avec render=4, l'ordre des faces
// a une incidence pour avoir un éclairage satisfaisant.

pave=shift(-(a/2)*X-(b/2)*Y-(c/2)*Z)*pave;

limits(O,(a/2+1)*X+(b/2+1)*Y+(c/2+1)*Z);
xaxis3(scale(1.5)*Label("$x$",1),1bp+green,Arrow3);
yaxis3(scale(1.5)*Label("$y$",1),1bp+green,Arrow3);
zaxis3(scale(1.5)*Label("$z$",1),1bp+green,Arrow3);

for (int i=0; i<=5; ++i){
   draw(surface(scale3(.866)*pave[i]),white+opacity(.75),1bp+black);
}
Asymptote - Figure 0041: fig_pd02_200309_pave_droit.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_pd02_200309_pave_droit
import solids;

currentprojection=orthographic(5,3,4);

size(7.5cm);

real a=5,b=4,c=3;

draw(box(O,(a,b,c)),blue);

limits(O,X+Y+Z);
xaxis3(scale(1.5)*Label("$x$",1),lightgreen,Arrow3);
yaxis3(scale(1.5)*Label("$y$",1),lightgreen,Arrow3);
zaxis3(scale(1.5)*Label("$z$",1),lightgreen,Arrow3);
Asymptote - Figure 0042: fig_pd03_200309_pave_droit.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_pd03_200309_pave_droit
import solids;

currentprojection=orthographic(5,3,4);

size(7.5cm);

real a=6,b=3,c=2;

draw(box(O,(a,b,c)),green);
draw(shift(Z)*unitsquare3,2bp+blue);

limits(O,X+Y+Z);
xaxis3(scale(1.5)*Label("$\vec{\imath}$",1),1bp+red,Arrow3);
yaxis3(scale(1.5)*Label("$\vec{\jmath}$",1),1bp+red,Arrow3);
zaxis3(scale(1.5)*Label("$\vec{k}$",1),1bp+red,Arrow3);
Asymptote - Figure 0043: fig_py01_251011_pyramide.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_py01_251011_pyramide
import three;

size(7cm);
currentprojection=orthographic(5,4,3);

triple pA=(2,2,0), pB=(-2,2,0), 
       pC=(-2,-2,0), pD=(2,-2,0),
       pS=(0,0,5);

draw(pA--pB--pC--pD--cycle);
draw(pA--pS--pB^^pC--pS--pD);
Asymptote - Figure 0044: fig_py02_251011_pyramide.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_py02_251011_pyramide
import three;

size(7cm);
currentprojection=orthographic(5,4,3);

triple pA=(2,2,0), pB=(-2,2,0), 
       pC=(-2,-2,0), pD=(2,-2,0),
       pS=(0,0,5);

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

label("$A$",pA,S);
label("$B$",pB,E);
label("$C$",pC,NW);
label("$D$",pD,W);
label("$S$",pS,N);
Asymptote - Figure 0045: fig_py03_251011_pyramide.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_py03_251011_pyramide
import three;
size(7cm);
currentprojection=orthographic(5,4,3);
currentlight=light(10,0,10);

triple pA=(2,2,0), pB=(-2,2,0), 
       pC=(-2,-2,0), pD=(2,-2,0),
       pS=(0,0,5);

path3[] faces={pA--pB--pC--pD--cycle,
               pS--pB--pC--cycle,
               pS--pC--pD--cycle,
               pS--pD--pA--cycle,
               pS--pA--pB--cycle};
// Compilé avec render=4, l'ordre des faces
// a une incidence pour avoir un éclairage satisfaisant.

draw(surface(faces),green+opacity(.8));

label("$A$",pA,S);
label("$B$",pB,E);
label("$D$",pD,W);
label("$S$",pS,N);
Asymptote - Figure 0046: fig_py04_251011_pyramide.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_py04_251011_pyramide
import three;

size(7cm);
currentprojection=orthographic(5,4,3);
currentlight=light(0,10,10);

triple pA=(2,2,0), pB=(-2,2,0), 
       pC=(-2,-2,0), pD=(2,-2,0),
       pS=(0,0,5);

path3[] faces={pA--pB--pC--pD--cycle,
               pS--pB--pC--cycle,
               pS--pC--pD--cycle,
               pS--pD--pA--cycle,
               pS--pA--pB--cycle};
// Compilé avec render=4, l'ordre des faces
// a une incidence pour avoir un éclairage satisfaisant.

draw(surface(faces),blue+opacity(.9));
draw(faces,1.5bp+orange);

label("$A$",pA,S);
label("$B$",pB,E);
label("$D$",pD,W);
label("$S$",pS,N);
Asymptote - Figure 0047: fig_py05_261011_pyramide.asy
(Code compilé avec Asymptote version 2.14svn)
largeur320 Figure fig_py05_261011_pyramide
import three;

size(7cm);
currentprojection=orthographic(5,4,3);

triple pA=(2,2,0), pB=(-2,2,0), 
       pC=(-2,-2,0), pD=(2,-2,0),
       pS=(0,0,5);
path3 cercle = pA..pB..pC..pD..cycle;

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

// Pas facile de détecter la partie cachée du cercle !
path pvisib1 = cut(project(cercle),project(pB--pS--pD),1).before,
     pvisib2 = cut(project(cercle),project(pB--pS--pD),2).after,
     pcache = cut(cut(project(cercle),project(pB--pS--pD),1).after,project(pB--pS--pD),1).before;
draw(invert(pvisib1,Z,O)^^invert(pvisib2,Z,O),blue);
draw(invert(pcache,Z,O),red+dashed);
// --- pour des explications sur cut : voir la sous-galerie "Intersections".

label("$A$",pA,S);
label("$B$",pB,E);
label("$C$",pC,NW);
label("$D$",pD,W);
label("$S$",pS,N);
Asymptote - Figure 0048: fig_ta01_300509_tore.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ta01_300509_tore
import solids; 
currentprojection=orthographic(8.5,9.5,8); 
currentlight=(0,5,5); 
 
size(8cm,0); 

real R=3, a=1, d=R+2a;

// On définit un tore et on le trace.
revolution tore=revolution(shift(R*X)*Circle(O,a,Y,32),Z); 
surface s=surface(tore); 
draw(s,orange); 

// On définit une courbe et on la trace...
path3 g=d*unit(X+.3Y)..0.5(X-Y)..d*unit(-X-Y)
        ..(-d,0,a)..0.5(Y-X)..d*unit(.5X+Y); 
draw(g,2bp+blue);
// ... en indiquant en vert les 6 points la définissant.
dot(g,4bp+green);

// On définit les points d'intersection du tore et de la courbe...
triple[] points=intersectionpoints(g,s); 
// ... que l'on place en rouge.
dot(points,6bp+red); 

// On ajoute les axes.
limits((-d,-d,-2a),(d,d,2a));
xaxis3("$x$",Arrow3);
yaxis3("$y$",Arrow3);
zaxis3("$z$",Arrow3);
Asymptote - Figure 0049: fig_ua01_281009_unit_solides.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ua01_281009_unit_solides
import graph3;

size(8cm);

currentprojection=perspective(
camera=(4.73967542895427,4.76147519718155,-2.88109885734294),
up=(-0.00275043462732612,0.0152291034920296,0.0169895927889711),
target=(1.06760561304443,0.948066353128621,-0.0573107557817889));
// Les réglages précédents ont été obtenus après avoir fait tourner 
// la figure via OpenGL et obtenu la position de la caméra par : 
// double-clic-droit sur l'écran puis en cliquant sur (c)Camera.

draw(unitsphere,green);
draw(shift(2X)*unithemisphere,palegreen);
draw(shift(2Y)*unitcone,palegreen);
draw(shift(-2Z)*unitsolidcone,palegreen);

limits((-2,-2,-2.5),(3.4,3.3,1.5));
xaxis3("$x$",Arrow3); 
yaxis3("$y$",Arrow3); 
zaxis3("$z$",Arrow3);
Asymptote - Figure 0050: fig_ua02_281009_unit_solides.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ua02_281009_unit_solides
import graph3;

size(8cm);

currentprojection=perspective(
camera=(4.53371578035063,6.12745948340995,5.70601516082761),
up=(0.000619140254556352,-0.0150578483347696,0.0142075032912145),
target=(1.04450822437829,0.602473887294338,0.00241466111189625));

draw(unitcube,green);
draw(shift(2X)*unitcylinder,palegreen);
draw(shift(2Y)*unitdisk,paleblue);
draw(shift(-2Z)*unitplane,palered);

limits((-2,-2,-2.5),(3.4,3.3,1.5));
xaxis3("$x$",Arrow3); 
yaxis3("$y$",Arrow3); 
zaxis3("$z$",Arrow3);
Asymptote - Figure 0051: fig_ua03_281009_unitfrustum.asy
(Code compilé avec Asymptote version 1.95svn)
largeur320 Figure fig_ua03_281009_unitfrustum
import graph3;

size(8cm);

currentprojection=perspective(
camera=(10.0727817501153,3.74298428635732,8.52398607861811),
up=(-0.0297367955490125,-0.00628656900952393,0.0232777528581501),
target=(2.23313907154483,2.16099419927418,-1.91821818048332));

patch p1=unitfrustum(0.5,1),
      p2=unitfrustum(2,3),
          p3=unitfrustum(4,6);

draw(surface(p1),blue);
draw(surface(p2),white);
draw(surface(p3),red);

limits((-2,-2,-2.5),(3.4,3.3,1.5));
xaxis3("$x$",Arrow3); 
yaxis3("$y$",Arrow3); 
zaxis3("$z$",Arrow3);

Dernière modification le Sat Jun 27 19:33:40 CEST 2015 par G.Marris       Valide XHTML