From: Christophe Poulain Date: Mon, 17 Oct 2011 16:25:29 +0000 (+0200) Subject: Ajout d'une option traits dans la représentation des solides créés par révolution. X-Git-Url: https://melusine.eu.org/syracuse/G/git/?p=mp-solid.git;a=commitdiff_plain;h=1f8aec0ce511eb72c7f4ca808c5dfd66020b2f87 Ajout d'une option traits dans la représentation des solides créés par révolution. --- diff --git a/mp-solid.mp b/mp-solid.mp index 49d35fa..11f5294 100644 --- a/mp-solid.mp +++ b/mp-solid.mp @@ -1,32 +1,26 @@ -%% ============================================================================= -%% Fichier : mp-solid.mp -%% ============================================================================= -%% Le fichier spatial d'Anthony Phan m'a permis de mettre certaines choses au -%% clair. ;-) -%% 14/08/2008 - +%Le fichier spatial d'Anthony Phan m'a permis de mettre certaines choses au clair. ;-) +%v1 +%14/08/2008 prologues:=2; -%% Constantes ------------------------------------------------------------------ -u := 1cm; -pi := 3.141592654; -c := 57.29578; % conversion d'un radian en degrés - -color rouge, vert, bleu, jaune, noir, blanc, orange, rose, violet, ciel, - cielfonce, orangevif, gris, marron; -rouge = (1,0,0); -bleu = (0,0,1); -noir = (0,0,0); -blanc = (1,1,1); -orange = (1,0.5,0); -violet = blanc-vert; -rose = (1,0.7,0.7); -cielfonce = 0.9*(0.25,1,1); -ciel = bleu+vert; -orangevif = (1,0.25,0.1); -vert = (0,1,0); -jaune = blanc-bleu; -gris = 0.8*white; +%Constantes +u:=1cm; +pi:=3.141592654; +c:=57.29578; % conversion d'un radian en degrés +color rouge,vert,bleu,jaune,noir,blanc,orange,rose,violet,ciel,cielfonce,orangevif,gris,marron; +rouge=(1,0,0); +bleu=(0,0,1); +noir=(0,0,0); +blanc=(1,1,1); +orange=(1,0.5,0); +violet=blanc-vert; +rose=(1,0.7,0.7); +cielfonce=0.9*(0.25,1,1); +ciel=bleu+vert; +orangevif=(1,0.25,0.1); +vert=(0,1,0); +jaune=blanc-bleu; +gris=0.8*white; input format; input marith; @@ -37,7 +31,7 @@ input objets; color Sommet[]; -%% Anthony Phan +%Anthony Phan vardef Norm primary z = abs (abs(Xpart z, Ypart z), Zpart z) enddef; @@ -48,7 +42,7 @@ let Zpart = bluepart; % string typerepre,pointilles; -typerepre := "persp"; +typerepre:="persp"; vardef Initialisation(expr r,t,p,d)= Rho:=r; @@ -685,10 +679,20 @@ vardef Sparam(expr fn,umin,umax,upas,vmin,vmax,vpas)=%fonction if arcenciel: lumin(cpt[k])*Hsvtorgb((floor((cpt[k]/apj)*360),satu,lum)) else: lumin(cpt[k])*outcolor fi else:lumin(cpt[k])*incolor fi; - draw for l=1 upto 4: - Projette(Fc[cpt[k]][l])-- - endfor - cycle; + if traits=true: + draw for l=1 upto 4: + Projette(Fc[cpt[k]][l])-- + endfor + cycle; + else: + draw for l=1 upto 4: + Projette(Fc[cpt[k]][l])-- + endfor + cycle withcolor if Vue[cpt[k]]: + if arcenciel: lumin(cpt[k])*Hsvtorgb((floor((cpt[k]/apj)*360),satu,lum)) + else: lumin(cpt[k])*outcolor fi + else:lumin(cpt[k])*incolor fi; + fi; endfor; ); Spar:=false;