![]() ![]() |
import solids; size(7.5cm,0); currentprojection=perspective((45,45,20)); viewportmargin=(1mm,1mm); draw((4,0,8)--(-4,0,8)^^(0,4,8)--(0,-4,8),dashed+darkgray); draw("$x$",O--X,Arrow3);draw(O--3X); draw("$y$",O--Y,Arrow3);draw(O--3Y); draw("$z$",O--Z,Arrow3);draw(O--13Z); path3 gene=(0,2,3)..(0,3,3.5)..(0,4,4.5)..(0,4.5,6) ..(0,4,8)..(0,1,10)..(0,2,12); revolution vase=revolution(c=(0,0,0),gene, axis=Z, -70, 270); draw(surface(vase),palegreen+opacity(.4)); draw(vase,m=10,frontpen=.8bp+blue,backpen=.6bp+paleblue,longitudinalpen=nullpen); skeleton s; vase.transverse(s,reltime(vase.g,0.5),P=currentprojection); draw(s.transverse.back,1bp+yellow+linetype("8 8",8)); draw(s.transverse.front,1bp+yellow); draw((0,2,3)--(0,-2,3)^^(2,0,3)--(-2,0,3),dashed+gray); draw((0,2,12)--(0,-2,12)^^(2,0,12)--(-2,0,12),gray); draw (gene,1bp+green); draw ((2,0,12)..(0,2,12)..(-2,0,12)..(0,-2,12)..cycle,.4bp+red,Arrow3); dot(Label("$a$",align=SE),(0,0,3)); dot(Label("$z$",align=SE),(0,0,8),red); dot(Label("$b$",align=NE),(0,0,12)); draw("$r(z)$",(0,0,8)--(4,0,8),red,Arrow3); |
![]() ![]() |
// gm.asy est une extension personnelle (avec des définitions en phase de test) // téléchargeable ici : gm.asy import three; import gm; // currentprojection=obliqueX; currentprojection=cavaliereX; // défini dans gm.asy viewportmargin=(2mm,2mm); // pour laisser une zone blanche de 2mm autour currentlight=nolight; size(7.5cm,0); real a=1; transform r=rotate(90,(2a,2a)); path p1 = (a,0)--(4a,3a)--(4a,a)--(a,4a)--(3a,4a)--(0,a)--(0,3a)--(3a,0)--cycle, penta = (0,0)--(a,0)--(2a,a)--(a,2a)--(0,a)--cycle, p2[] = penta ^^ r*penta ^^ r^2*penta ^^ r^3*penta; transform3 tX=shift(4a*X), tY=shift(4a*Y), tZ=shift(4a*Z); path3 f1=path3(p1,XYplane), g1[]=path3(p2,XYplane), f2=path3(p1,YZplane), g2[]=path3(p2,YZplane), f3=path3(p1,ZXplane), g3[]=path3(p2,ZXplane), f[]=f1^^f2^^f3^^tZ*f1^^tX*f2^^tY*f3, g[]=g1^^g2^^g3^^tZ*g1^^tX*g2^^tY*g3; draw(surface(f),grey); draw(surface(g),white); draw(box((0,0,0),(4a,4a,4a)),1bp+blue); |
![]() ![]() |
// gm.asy est une extension personnelle (avec des définitions en phase de test) // téléchargeable ici : gm.asy import three; import gm; currentprojection=cavaliereX; // défini dans gm.asy currentlight=nolight; viewportmargin=(1mm,1mm); size(8cm,0); int a=6; triple sommet[] ={(0,0,0),(a,0,0),(a,a,0),(0,a,0),(0,0,a)}; string nom[] ={"P" ,"Q" ,"R" ,"S" ,"O" }; triple direction[] ={-X-Y-Z ,-2Y ,2Y ,2Y ,Z }; for(int z=0 ; z<a-1 ; ++z) for(int x=0 ; x<a-z-1 ; ++x) for(int y=0 ; y<a-z-1 ; ++y) draw(shift(x,y,z)*unitcube,lightgrey,.5bp+black); for(int k=0; k<nom.length; ++k) label(nom[k],sommet[k],direction[k]); draw(sommet[4]--sommet[1]--sommet[2]--cycle ^^sommet[2]--sommet[3]--sommet[4], 1bp+black); draw(sommet[3]--(0,a-1,0)^^sommet[1]--(a-1,0,0)^^sommet[4]--(0,0,a-1), linetype("4 4")); |
![]() ![]() |
import three; currentprojection=orthographic((10,2,4),up=Z); currentlight=nolight; viewportmargin=(1mm,1mm); size(8cm,0); int a=12; triple sommet[] ={(0,0,0),(a,0,0),(a,a,0),(0,a,0),(0,0,a)}; string nom[] ={"P" ,"Q" ,"R" ,"S" ,"O" }; triple direction[] ={-X-Y-Z ,-2Y ,2Y ,2Y ,Z }; for(int z=0 ; z<a-1 ; ++z) for(int x=0 ; x<a-z-1 ; ++x) for(int y=0 ; y<a-z-1 ; ++y) draw(shift(x,y,z)*unitcube,lightgrey,.5bp+black); for(int k=0; k<nom.length; ++k) label(nom[k],sommet[k],direction[k]); draw(sommet[4]--sommet[1]--sommet[2]--cycle ^^sommet[2]--sommet[3]--sommet[4], 1bp+black); draw(sommet[3]--(0,a-1,0)^^sommet[1]--(a-1,0,0)^^sommet[4]--(0,0,a-1), linetype("4 4")); |
![]() ![]() |
import three; size(8cm,0); currentprojection=orthographic((13,12,4),up=Z); currentlight=nolight; viewportmargin=(1mm,1mm); int n=15; // nombre de marches real a=5; // largeur des marches path p=(0,0); for(int k=0; k<n; ++k) p=p--(k,k+1)--(k+1,k+1); p=p--(n,0)--cycle; path3 p3[] = path3(p,XYplane)^^shift(0,0,a)*path3(p,XYplane); transform3 t=rotate(90,Z)*rotate(90,X); draw(t*extrude(p,a*Z),white,1bp+black); draw(t*surface(p3),gray); |
![]() ![]() |
import three; picture pic; unitsize(pic,5mm); currentprojection=orthographic((13,12,4),up=Z); currentlight=nolight; viewportmargin=(3mm,3mm); int n=10; // nombre de marches real a=5, // largeur des marches l=3; // largeur du palier path p=(0,0); for(int k=0; k<n; ++k) p=p--(k,k+1)--(k+1,k+1); p=p--(n+l,n)--(n+l,0)--cycle; path3 p3[] = path3(p,XYplane)^^shift(0,0,a)*path3(p,XYplane); transform3 t=rotate(90,Z)*rotate(90,X); draw(pic,t*extrude(p,a*Z),white,1bp+black); draw(pic,t*surface(p3),gray); projection[][] GMViews={{RightView,FrontView}, {currentprojection,TopView}}; addViews(pic,GMViews); |
![]() ![]() |
// Grand bouleversement par rapport au script précédent // ... pour pouvoir mettre des couleurs différentes aux // marches et aux contremarches. import three; picture pic; unitsize(pic,3mm); currentprojection=orthographic((13,-12,4),up=Z); currentlight=nolight; viewportmargin=(4mm,4mm); int n=10; // nombre de marches real a=5, // rapport emmarchement/hauteur d'une marche r=28/17, // rapport giron/hauteur d'une marche p=5; // profondeur du palier path3 contremarches[], marches[], palier, profil; surface contremarches3[], marches3[]; for(int k=0; k<n; ++k){ contremarches.push((0,r*k,k)--(0,r*k,k+1)); marches.push((0,r*k,k+1)--(0,r*(k+1),k+1)); profil=profil--contremarches[k]--marches[k]; contremarches3.push(extrude(contremarches[k],a*X)); marches3.push(extrude(marches[k],a*X)); draw(pic,contremarches3[k],.8paleblue,1bp+black); draw(pic,marches3[k],paleblue,1bp+black); } palier=(0,r*n,n)--(0,r*n+p,n)--(0,r*n+p,0)--(0,0,0); draw(pic,extrude(palier,a*X),.8paleblue,1bp+black); profil=profil--palier--cycle; draw(pic,surface(profil^^shift(a,0,0)*profil),.8palegray); projection[][] GMViews={{RightView,FrontView}, {currentprojection,TopView}}; addViews(pic,GMViews); |
![]() ![]() |
import solids; size(7.5cm,0); currentprojection=perspective((45,45,20)); viewportmargin=(1mm,1mm); draw("$x$",O--X,Arrow3);draw(O--3X); draw("$y$",O--Y,Arrow3);draw(O--3Y); draw("$z$",O--Z,Arrow3);draw(O--13Z); path3 gene=(0,1,2.5)--(0,1,5)--(0,4,4.5)..(0,1,7) --(0,3.5,6.5)..(0,1,9)--(0,3,8.5) ..(0,1,11)--(0,2.5,10.5)..(0,0,13); revolution vase=revolution(c=(0,0,0),gene, axis=Z, 0, 360); draw(surface(vase),palegreen+opacity(.8)); |
Dernière modification le Sun Aug 4 11:53:30 CEST 2013 par G.Marris Valide XHTML