Source PostScript (planaffine.pps)

Retour Texte non formaté
%% plan : origine, base, range, ngrid %% [0 0 0 [1 0 0 0 1 0] [-3 3 -2 2] [1. 1.] ] /explan [0 0 0 [1 0 0 0 1 0 0 0 1] [-3 3 -2 2] [1. 1.] ] def %% syntaxe : any isplan --> bool /isplan { 1 dict begin /candidat exch def candidat isarray { candidat length 6 eq { candidat 3 get isarray { candidat 4 get isarray { candidat 5 get isarray } { false } ifelse } { false } ifelse } { false } ifelse } { false } ifelse end } def /newplanaffine { [0 0 0 [1 0 0 0 1 0] [-3 3 -2 2] [1 1]] } def %% syntaxe : plantype getorigine --> x y z /plangetorigine { 1 dict begin /plan exch def plan isplan not { (Erreur : mauvais type d argument dans plangetorigine) == Error } if plan 0 get plan 1 get plan 2 get end } def %% syntaxe : plantype getbase --> [u v] %% ou u, v et w vecteurs de R^3 /plangetbase { 1 dict begin /plan exch def plan isplan not { (Erreur : mauvais type d argument dans plangetbase) == Error } if plan 3 get end } def %% syntaxe : plantype getrange --> array %% ou array = [xmin xmax ymin ymax] /plangetrange { 1 dict begin /plan exch def plan isplan not { (Erreur : mauvais type d argument dans plangetrange) == Error } if plan 4 get end } def %% syntaxe : plantype getngrid --> array %% ou array = [n1 n2] /plangetngrid { 1 dict begin /plan exch def plan isplan not { (Erreur : mauvais type d argument dans plangetngrid) == Error } if plan 5 get end } def %% =================== %% syntaxe : plantype x y z putorigine --> - /planputorigine { 4 dict begin /z exch def /y exch def /x exch def /plan exch def plan isplan not { (Erreur : mauvais type d argument dans planputorigine) == Error } if plan 0 x put plan 1 y put plan 2 z put end } def %% syntaxe : plantype [u v w] putbase --> - %% ou u, v et w vecteurs de R^3 /planputbase { 2 dict begin /base exch def /plan exch def plan isplan not { (Erreur : mauvais type d argument dans planputbase) == Error } if plan 3 base put end } def %% syntaxe : plantype array putrange --> - %% ou array = [xmin xmax ymin ymax] /planputrange { 2 dict begin /table exch def /plan exch def plan isplan not { (Erreur : mauvais type d argument dans planputrange) == Error } if plan 4 table put end } def %% syntaxe : plantype array putngrid --> - %% ou array = [n1 n2] /planputngrid { 2 dict begin /table exch def /plan exch def plan isplan not { (Erreur : mauvais type d argument dans planputngrid) == quit } if plan 5 table put end } def %% -3 3 -2 2 1. 1. newgrille %% drawsolid %orange %% plan : origine, base, range, ngrid %% syntaxe : plantype drawplanaffine --> - /drawplanaffine { 5 dict begin /plan exch def plan plangetbase aload pop /imK defpoint3d /imJ defpoint3d /imI defpoint3d newpath plan plangetrange plan plangetngrid aload pop quadrillagexOy_ plan plangetorigine [imI imK] false planprojpath stroke end } def %% %% syntaxe : [a b c d] (x0 y0 z0) alpha defeqplanaffine --> plantype %% %% plan defini par l equation ax+by+cz+d=0, %% %% rotation de alpha autour de la normale (alpha est optionnel) %% %% origine (x0, y0, z0). l origine est optionnelle %% /defeqplanaffine { %% 5 dict begin %% dup isarray { %% /alpha 0 def %% } { %% dup isstring { %% /alpha 0 def %% } { %% /alpha exch def %% } ifelse %% } ifelse %% dup isstring { %% cvx /origine exch def %% } if %% /table exch def %% table length 4 ne { %% (Erreur : mauvais type d argument dans defeqplanaffine) == %% Error %% } if %% table 0 get /a exch def %% table 1 get /b exch def %% table 2 get /c exch def %% table 3 get /d exch def %% /resultat newplanaffine def %% [a b c alpha] normalvect_to_orthobase %% /imK defpoint3d %% /imJ defpoint3d %% /imI defpoint3d %% resultat [imI imJ imK] planputbase %% currentdict /origine known { %% origine /z exch def /y exch def /x exch def %% a x mul b y mul add c z mul add d add 0 ne { %% (Erreur : mauvaise origine dans defeqplanaffine) == %% Error %% } if %% resultat origine planputorigine %% } { %% c 0 ne { %% resultat 0 0 d neg c div planputorigine %% } { %% a 0 ne { %% resultat d neg a div 0 0 planputorigine %% } { %% resultat 0 d neg b div 0 planputorigine %% } ifelse %% } ifelse %% } ifelse %% resultat %% end %% } def %% /explan [0 0 0 [1 0 0 0 1 0 0 0 1] [-3 3 -2 2] [1 1] ] def %% explan drawplanaffine %% noir %% /explan [0 0 2 [1 0 0 0 1 0 0 0 1] [-3 3 -2 2] [1 .5] ] def %% explan drawplanaffine %% orange %% [0 0 1 -2] defeqplanaffine %% drawplanaffine %% noir %% [0 0 1 0] defeqplanaffine %% drawplanaffine %% bleu %% [1 1 1 0] (1 -1 0) defeqplanaffine %% drawplanaffine %% /dessinebase { 4 dict begin gsave /V3 defpoint3d /V2 defpoint3d /V1 defpoint3d /M0 defpoint3d rouge V3 newvecteur {M0 translatepoint3d} solidtransform drawsolid** bleu V2 newvecteur {M0 translatepoint3d} solidtransform drawsolid** orange V1 newvecteur {M0 translatepoint3d} solidtransform drawsolid** grestore end } def %% syntaxe : solid i solidface2eqplan --> [a b c d] %% equation cartesienne de la face d'indice i du solide solid /solidface2eqplan { 8 dict begin /i exch def /solid exch def solid i solidnormaleface /c exch def /b exch def /a exch def solid 0 i solidgetsommetface /z exch def /y exch def /x exch def [a b c a x mul b y mul add c z mul add neg] end } def %% syntaxe : plantype newplan --> solid /newplan { 5 dict begin /lepl@n exch def lepl@n plangetbase /@base exch def @base 0 getp3d /@U defpoint3d @base 1 getp3d /@V defpoint3d lepl@n plangetorigine /@M defpoint3d lepl@n plangetrange /@range exch def lepl@n plangetngrid /@ngrid exch def /@F { 2 dict begin /@y exch def /@x exch def @U @x mulv3d @V @y mulv3d addv3d @M addv3d end } def @range aload pop @ngrid {@F} newsurfaceparametree end } def %% syntaxe : M eqplan --> real %% image de M par la fonction definie par l equation eqplan /pointeqplan { 8 dict begin /eqplan exch def /@z exch def /@y exch def /@x exch def /@a eqplan 0 get def /@b eqplan 1 get def /@c eqplan 2 get def /@d eqplan 3 get def @a @x mul @b @y mul add @c @z mul add @d add end } def /plan2eq { 6 dict begin /leplan exch def leplan plangetbase aload pop vectprod3d /c exch def /b exch def /a exch def leplan plangetorigine /z0 exch def /y0 exch def /x0 exch def [a b c a x0 mul b y0 mul add c z0 mul add neg] end } def %% syntaxe : [a b c d] (x0 y0 z0) alpha defeqplanaffine --> plantype %% plan defini par l equation ax+by+cz+d=0, %% rotation de alpha autour de la normale (alpha est optionnel) %% origine (x0, y0, z0). l origine est optionnelle /eq2plan { 5 dict begin dup isarray { /alpha 0 def } { dup isstring { /alpha 0 def } { /alpha exch def } ifelse } ifelse dup isstring { cvx /origine exch def } if /table exch def table length 4 ne { (Erreur : mauvais type d argument dans eq2plan) == quit } if table 0 get /a exch def table 1 get /b exch def table 2 get /c exch def table 3 get /d exch def /resultat newplanaffine def [a b c alpha] normalvect_to_orthobase /imK defpoint3d /imJ defpoint3d /imI defpoint3d resultat [imI imJ] planputbase currentdict /origine known { origine /z exch def /y exch def /x exch def a x mul b y mul add c z mul add d add 0 ne { (Erreur : mauvaise origine dans eq2plan) == quit } if resultat origine planputorigine } { c 0 ne { resultat 0 0 d neg c div planputorigine } { a 0 ne { resultat d neg a div 0 0 planputorigine } { b 0 ne { resultat 0 d neg b div 0 planputorigine } { (Error dans eq2plan : (a,b,c) = (0,0,0)) == } ifelse } ifelse } ifelse } ifelse resultat end } def /points2eqplan { 10 dict begin /C defpoint3d /B defpoint3d /A defpoint3d A B vecteur3d A C vecteur3d vectprod3d normalize3d /c exch def /b exch def /a exch def A /zA exch def /yA exch def /xA exch def [a b c a xA mul b yA mul add c zA mul add neg] end } def %% /monplan %% %[0 0 -2 [1 0 0 0 1 0 0 0 1] [-3 3 -2 2] [1. 1.]] %% [0 0 1 1] 30 eq2plan %% def %% %% [0 0 1 -2] eq2plan newplan %% dup (blanc) outputcolors %% monplan newplan %% dup (blanc) outputcolors %% solidfuz %% drawsolid** %% monplan plangetorigine %% monplan plangetbase aload pop dessinebase %% syntaxe : x0 y0 z0 [normalvect] norm2plan /norm2plan { 9 dict begin normalvect_to_orthobase /imK defpoint3d /imJ defpoint3d /imI defpoint3d imK /c exch def /b exch def /a exch def /z0 exch def /y0 exch def /x0 exch def [a b c a x0 mul b y0 mul add c z0 mul add neg] eq2plan dup x0 y0 z0 planputorigine dup [imI imJ] planputbase end } def %% syntaxe : plantype planxmarks /planxmarks { 5 dict begin dup isbool { /mybool exch def } { /mybool true def } ifelse /leplan exch def leplan plangetrange aload pop /ymax exch def /ymin exch def /xmax exch def /xmin exch def newpath xmin truncate cvi 0 smoveto xmax truncate cvi 0 slineto leplan mybool projpath stroke xmin truncate cvi xmkstep xmax truncate cvi { dup 0 ne { /x exch def x x x truncate eq { cvi } if dup chaine cvs exch 0 leplan mybool dctextp3d newpath x 0 smoveto 0 2.5 rmoveto 0 -5 rlineto leplan mybool projpath stroke } { pop (0) 0 0 leplan mybool dltextp3d } ifelse } for end } def %% syntaxe : plantype planymarks /planymarks { 5 dict begin dup isbool { /mybool exch def } { /mybool true def } ifelse /leplan exch def leplan plangetrange aload pop /ymax exch def /ymin exch def /xmax exch def /xmin exch def newpath 0 ymin truncate cvi smoveto 0 ymax truncate cvi slineto leplan mybool projpath stroke ymin truncate cvi ymkstep ymax truncate cvi { dup 0 ne { /y exch def y y y truncate eq { cvi } if dup chaine cvs exch 0 exch leplan mybool cltextp3d newpath 0 y smoveto 2.5 0 rmoveto -5 0 rlineto leplan mybool projpath stroke } { pop (0) 0 0 leplan mybool dltextp3d } ifelse } for end } def %% syntaxe : plantype planmarks /planmarks { 1 dict begin dup isbool { /mybool exch def } { /mybool true def } ifelse dup mybool planxmarks mybool planymarks end } def %% bleu %% [-3 3 -2 2] quadrillagexOy_ %% stroke %% noir %% syntaxe : [xmin xmax ymin ymax] dx dy quadrillagexOy_ /quadrillagexOy_ { 4 dict begin dup isarray { /dx 1 def /dy 1 def } { /dy exch def dup isarray { /dx dy def } { /dx exch def } ifelse } ifelse /table exch def table 0 get /xmin exch def table 1 get /xmax exch def table 2 get /ymin exch def table 3 get /ymax exch def ymin dy ymax { /y exch def xmin y smoveto xmax y slineto } for xmin dx xmax { /x exch def x ymin smoveto x ymax slineto } for end } def %% syntaxe : plan [ngrid] planquadrillage /planquadrillage { 4 dict begin dup isbool { /mybool exch def } { /mybool true def } ifelse dup isplan { /ngrid [1 1] def } { /ngrid exch def } ifelse /leplan exch def /dx ngrid 0 get def /dy ngrid 1 get def /table leplan plangetrange def table 0 get cvi truncate /xmin exch def table 1 get cvi truncate /xmax exch def table 2 get cvi truncate /ymin exch def table 3 get cvi truncate /ymax exch def newpath ymin dy ymax { /y exch def xmin y smoveto xmax y slineto } for xmin dx xmax { /x exch def x ymin smoveto x ymax slineto } for leplan mybool projpath stroke end } def %% syntaxe : plantype str1 str2 planshowbase -> - %% syntaxe : plantype str2 planshowbase -> - %% syntaxe : plantype planshowbase -> - /planshowbase { 3 dict begin dup isbool { /mybool exch def } { /mybool true def } ifelse dup isstring { /couleur2 exch def dup isstring { /couleur1 exch def } { /couleur1 (rouge) def } ifelse } { /couleur1 (rouge) def /couleur2 (vert) def } ifelse mybool bprojscene couleur1 cvx exec newpath 0 0 smoveto 1 0 slineto stroke 0 0 1 0 oldarrow couleur2 cvx exec newpath 0 0 smoveto 0 1 slineto stroke 0 0 0 1 oldarrow eprojscene end } def %% syntaxe : plantype str1 str2 str3 planshowbase3d -> - %% syntaxe : plantype str2 str3 planshowbase3d -> - %% syntaxe : plantype str3 planshowbase3d -> - %% syntaxe : plantype planshowbase3d -> - %% syntaxe : plantype str1 str2 str3 array planshowbase3d -> - %% syntaxe : plantype str2 str3 array planshowbase3d -> - %% syntaxe : plantype str3 array planshowbase3d -> - %% syntaxe : plantype array planshowbase3d -> - /planshowbase3d { 7 dict begin dup isbool { /mybool exch def } { /mybool true def } ifelse dup dup isarray exch isplan not and { /table exch def } { /table {} def } ifelse dup isstring { /couleur3 exch def dup isstring { /couleur2 exch def dup isstring { /couleur1 exch def } { /couleur1 (rouge) def } ifelse } { /couleur2 (vert) def /couleur1 (rouge) def } ifelse } { /couleur1 (rouge) def /couleur2 (vert) def /couleur3 (bleu) def } ifelse /plan exch def plan couleur1 couleur2 mybool planshowbase plan plangetorigine /I defpoint3d plan plangetbase dup 0 getp3d /u defpoint3d 1 getp3d /v defpoint3d u v vectprod3d table newvecteur {I addv3d} solidtransform dup couleur3 solidputcolors solidgridOff drawsolid** end } def %% syntaxe : plantype x y z plantranslate --> - /plantranslate { 4 dict begin /M defpoint3d /plan exch def plan isplan not { (Erreur : mauvais type d argument dans plantranslate) == quit } if plan plan plangetorigine M addv3d planputorigine end } def % syntaxe : alpha_x alpha_y alpha_z rotateOpplan --> - /rotateOplan { 4 dict begin /Rxyz defpoint3d /plan exch def plan isplan not { (Erreur : mauvais type d argument dans rotateOplan) == quit } if plan plan plangetorigine Rxyz rotateOpoint3d planputorigine plan plangetbase 0 getp3d /U defpoint3d plan plangetbase 1 getp3d /V defpoint3d plan [ U Rxyz rotateOpoint3d V Rxyz rotateOpoint3d ] planputbase end } def %% syntaxe : plantype phi rotateplan --> - /rotateplan { 5 dict begin /phi exch def /leplan exch def leplan plangetbase 0 getp3d /U defpoint3d leplan plangetbase 1 getp3d /V defpoint3d U phi cos mulv3d V phi sin mulv3d addv3d /U0 defpoint3d U phi sin neg mulv3d V phi cos mulv3d addv3d /V0 defpoint3d leplan [U0 V0] planputbase end } def %% syntaxe : solid i solidface2plan --> plantype %% syntaxe : solid i I solidface2plan --> plantype /solidface2plan { 5 dict begin 2 copy pop issolid { /i exch def /solid exch def solid i solidcentreface /I defpoint3d } { /I defpoint3d /i exch def /solid exch def } ifelse /result newplanaffine def solid i solidcentreface /G defpoint3d solid i solidnormaleface /K defpoint3d solid 0 i solidgetsommetface solid 1 i solidgetsommetface milieu3d /A defpoint3d G A vecteur3d normalize3d /U defpoint3d K U vectprod3d /V defpoint3d result [U V] planputbase result I planputorigine result end } def %% 27/06/08 %% %% plan : origine, base, range, ngrid %% 27/06/08 %% %% [0 0 0 [1 0 0 0 1 0] [-3 3 -2 2] [1. 1.] ] %% 27/06/08 %% %% 27/06/08 %% /explan [0 0 0 [1 0 0 0 1 0 0 0 1] [-3 3 -2 2] [1. 1.] ] def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : any isplan --> bool %% 27/06/08 %% /isplan { %% 27/06/08 %% 1 dict begin %% 27/06/08 %% /candidat exch def %% 27/06/08 %% candidat isarray { %% 27/06/08 %% candidat length 6 eq { %% 27/06/08 %% candidat 3 get isarray { %% 27/06/08 %% candidat 4 get isarray { %% 27/06/08 %% candidat 5 get isarray %% 27/06/08 %% } { %% 27/06/08 %% false %% 27/06/08 %% } ifelse %% 27/06/08 %% } { %% 27/06/08 %% false %% 27/06/08 %% } ifelse %% 27/06/08 %% } { %% 27/06/08 %% false %% 27/06/08 %% } ifelse %% 27/06/08 %% } { %% 27/06/08 %% false %% 27/06/08 %% } ifelse %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% /newplanaffine { %% 27/06/08 %% [0 0 0 [1 0 0 0 1 0] [-3 3 -2 2] [1 1]] %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype getorigine --> x y z %% 27/06/08 %% /plangetorigine { %% 27/06/08 %% 1 dict begin %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans plangetorigine) == %% 27/06/08 %% Error %% 27/06/08 %% } if %% 27/06/08 %% plan 0 get %% 27/06/08 %% plan 1 get %% 27/06/08 %% plan 2 get %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype getbase --> [u v] %% 27/06/08 %% %% ou u et v vecteurs de R^3 %% 27/06/08 %% /plangetbase { %% 27/06/08 %% 1 dict begin %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans plangetbase) == %% 27/06/08 %% Error %% 27/06/08 %% } if %% 27/06/08 %% plan 3 get %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype getrange --> array %% 27/06/08 %% %% ou array = [xmin xmax ymin ymax] %% 27/06/08 %% /plangetrange { %% 27/06/08 %% 1 dict begin %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans plangetrange) == %% 27/06/08 %% Error %% 27/06/08 %% } if %% 27/06/08 %% plan 4 get %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype getngrid --> array %% 27/06/08 %% %% ou array = [n1 n2] %% 27/06/08 %% /plangetngrid { %% 27/06/08 %% 1 dict begin %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans plangetngrid) == %% 27/06/08 %% Error %% 27/06/08 %% } if %% 27/06/08 %% plan 5 get %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% =================== %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype x y z putorigine --> - %% 27/06/08 %% /planputorigine { %% 27/06/08 %% 4 dict begin %% 27/06/08 %% /z exch def %% 27/06/08 %% /y exch def %% 27/06/08 %% /x exch def %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans planputorigine) == %% 27/06/08 %% Error %% 27/06/08 %% } if %% 27/06/08 %% plan 0 x put %% 27/06/08 %% plan 1 y put %% 27/06/08 %% plan 2 z put %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype [u v w] putbase --> - %% 27/06/08 %% %% ou u, v et w vecteurs de R^3 %% 27/06/08 %% /planputbase { %% 27/06/08 %% 2 dict begin %% 27/06/08 %% /base exch def %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans planputbase) == %% 27/06/08 %% Error %% 27/06/08 %% } if %% 27/06/08 %% plan 3 base put %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype array putrange --> - %% 27/06/08 %% %% ou array = [xmin xmax ymin ymax] %% 27/06/08 %% /planputrange { %% 27/06/08 %% 2 dict begin %% 27/06/08 %% /table exch def %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans planputrange) == %% 27/06/08 %% Error %% 27/06/08 %% } if %% 27/06/08 %% plan 4 table put %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype array putngrid --> - %% 27/06/08 %% %% ou array = [n1 n2] %% 27/06/08 %% /planputngrid { %% 27/06/08 %% 2 dict begin %% 27/06/08 %% /table exch def %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans planputngrid) == %% 27/06/08 %% quit %% 27/06/08 %% } if %% 27/06/08 %% plan 5 table put %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% -3 3 -2 2 1. 1. newgrille %% 27/06/08 %% %% drawsolid %% 27/06/08 %% %% 27/06/08 %% %orange %% 27/06/08 %% %% 27/06/08 %% %% plan : origine, base, range, ngrid %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype drawplanaffine --> - %% 27/06/08 %% /drawplanaffine { %% 27/06/08 %% 5 dict begin %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan plangetbase %% 27/06/08 %% aload pop %% 27/06/08 %% /imK defpoint3d %% 27/06/08 %% /imJ defpoint3d %% 27/06/08 %% /imI defpoint3d %% 27/06/08 %% newpath %% 27/06/08 %% plan plangetrange plan plangetngrid aload pop quadrillagexOy_ %% 27/06/08 %% plan plangetorigine [imI imK] false planprojpath %% 27/06/08 %% stroke %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% 27/06/08 %% %% %% syntaxe : [a b c d] (x0 y0 z0) alpha defeqplanaffine --> plantype %% 27/06/08 %% %% %% plan defini par l equation ax+by+cz+d=0, %% 27/06/08 %% %% %% rotation de alpha autour de la normale (alpha est optionnel) %% 27/06/08 %% %% %% origine (x0, y0, z0). l origine est optionnelle %% 27/06/08 %% %% /defeqplanaffine { %% 27/06/08 %% %% 5 dict begin %% 27/06/08 %% %% dup isarray { %% 27/06/08 %% %% /alpha 0 def %% 27/06/08 %% %% } { %% 27/06/08 %% %% dup isstring { %% 27/06/08 %% %% /alpha 0 def %% 27/06/08 %% %% } { %% 27/06/08 %% %% /alpha exch def %% 27/06/08 %% %% } ifelse %% 27/06/08 %% %% } ifelse %% 27/06/08 %% %% dup isstring { %% 27/06/08 %% %% cvx /origine exch def %% 27/06/08 %% %% } if %% 27/06/08 %% %% /table exch def %% 27/06/08 %% %% table length 4 ne { %% 27/06/08 %% %% (Erreur : mauvais type d argument dans defeqplanaffine) == %% 27/06/08 %% %% Error %% 27/06/08 %% %% } if %% 27/06/08 %% %% table 0 get /a exch def %% 27/06/08 %% %% table 1 get /b exch def %% 27/06/08 %% %% table 2 get /c exch def %% 27/06/08 %% %% table 3 get /d exch def %% 27/06/08 %% %% /resultat newplanaffine def %% 27/06/08 %% %% [a b c alpha] normalvect_to_orthobase %% 27/06/08 %% %% /imK defpoint3d %% 27/06/08 %% %% /imJ defpoint3d %% 27/06/08 %% %% /imI defpoint3d %% 27/06/08 %% %% resultat [imI imJ imK] planputbase %% 27/06/08 %% %% currentdict /origine known { %% 27/06/08 %% %% origine /z exch def /y exch def /x exch def %% 27/06/08 %% %% a x mul b y mul add c z mul add d add 0 ne { %% 27/06/08 %% %% (Erreur : mauvaise origine dans defeqplanaffine) == %% 27/06/08 %% %% Error %% 27/06/08 %% %% } if %% 27/06/08 %% %% resultat origine planputorigine %% 27/06/08 %% %% } { %% 27/06/08 %% %% c 0 ne { %% 27/06/08 %% %% resultat 0 0 d neg c div planputorigine %% 27/06/08 %% %% } { %% 27/06/08 %% %% a 0 ne { %% 27/06/08 %% %% resultat d neg a div 0 0 planputorigine %% 27/06/08 %% %% } { %% 27/06/08 %% %% resultat 0 d neg b div 0 planputorigine %% 27/06/08 %% %% } ifelse %% 27/06/08 %% %% } ifelse %% 27/06/08 %% %% } ifelse %% 27/06/08 %% %% resultat %% 27/06/08 %% %% end %% 27/06/08 %% %% } def %% 27/06/08 %% %% 27/06/08 %% %% /explan [0 0 0 [1 0 0 0 1 0 0 0 1] [-3 3 -2 2] [1 1] ] def %% 27/06/08 %% %% explan drawplanaffine %% 27/06/08 %% %% noir %% 27/06/08 %% %% /explan [0 0 2 [1 0 0 0 1 0 0 0 1] [-3 3 -2 2] [1 .5] ] def %% 27/06/08 %% %% explan drawplanaffine %% 27/06/08 %% %% 27/06/08 %% %% orange %% 27/06/08 %% %% [0 0 1 -2] defeqplanaffine %% 27/06/08 %% %% drawplanaffine %% 27/06/08 %% %% noir %% 27/06/08 %% %% [0 0 1 0] defeqplanaffine %% 27/06/08 %% %% drawplanaffine %% 27/06/08 %% %% bleu %% 27/06/08 %% %% [1 1 1 0] (1 -1 0) defeqplanaffine %% 27/06/08 %% %% drawplanaffine %% 27/06/08 %% %% %% 27/06/08 %% %% 27/06/08 %% /dessinebase { %% 27/06/08 %% 4 dict begin %% 27/06/08 %% gsave %% 27/06/08 %% /V3 defpoint3d %% 27/06/08 %% /V2 defpoint3d %% 27/06/08 %% /V1 defpoint3d %% 27/06/08 %% /M0 defpoint3d %% 27/06/08 %% rouge %% 27/06/08 %% V3 newvecteur %% 27/06/08 %% {M0 translatepoint3d} solidtransform %% 27/06/08 %% drawsolid** %% 27/06/08 %% bleu %% 27/06/08 %% V2 newvecteur %% 27/06/08 %% {M0 translatepoint3d} solidtransform %% 27/06/08 %% drawsolid** %% 27/06/08 %% orange %% 27/06/08 %% V1 newvecteur %% 27/06/08 %% {M0 translatepoint3d} solidtransform %% 27/06/08 %% drawsolid** %% 27/06/08 %% grestore %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : solid i solidface2eqplan --> [a b c d] %% 27/06/08 %% %% equation cartesienne de la face d'indice i du solide solid %% 27/06/08 %% /solidface2eqplan { %% 27/06/08 %% 8 dict begin %% 27/06/08 %% /i exch def %% 27/06/08 %% /solid exch def %% 27/06/08 %% solid i solidnormaleface %% 27/06/08 %% /c exch def %% 27/06/08 %% /b exch def %% 27/06/08 %% /a exch def %% 27/06/08 %% solid 0 i solidgetsommetface %% 27/06/08 %% /z exch def %% 27/06/08 %% /y exch def %% 27/06/08 %% /x exch def %% 27/06/08 %% [a b c a x mul b y mul add c z mul add neg] %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype newplan --> solid %% 27/06/08 %% /newplan { %% 27/06/08 %% 5 dict begin %% 27/06/08 %% /lepl@n exch def %% 27/06/08 %% lepl@n plangetbase /@base exch def %% 27/06/08 %% @base 0 getp3d /@U defpoint3d %% 27/06/08 %% @base 1 getp3d /@V defpoint3d %% 27/06/08 %% lepl@n plangetorigine /@M defpoint3d %% 27/06/08 %% lepl@n plangetrange /@range exch def %% 27/06/08 %% lepl@n plangetngrid /@ngrid exch def %% 27/06/08 %% /@F { %% 27/06/08 %% 2 dict begin %% 27/06/08 %% /@y exch def %% 27/06/08 %% /@x exch def %% 27/06/08 %% @U @x mulv3d %% 27/06/08 %% @V @y mulv3d %% 27/06/08 %% addv3d %% 27/06/08 %% @M addv3d %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% @range aload pop @ngrid {@F} newsurfaceparametree %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : M eqplan --> real %% 27/06/08 %% %% image de M par la fonction definie par l equation eqplan %% 27/06/08 %% /pointeqplan { %% 27/06/08 %% 8 dict begin %% 27/06/08 %% /eqplan exch def %% 27/06/08 %% /@z exch def %% 27/06/08 %% /@y exch def %% 27/06/08 %% /@x exch def %% 27/06/08 %% /@a eqplan 0 get def %% 27/06/08 %% /@b eqplan 1 get def %% 27/06/08 %% /@c eqplan 2 get def %% 27/06/08 %% /@d eqplan 3 get def %% 27/06/08 %% @a @x mul @b @y mul add @c @z mul add @d add %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% /plan2eq { %% 27/06/08 %% 6 dict begin %% 27/06/08 %% /leplan exch def %% 27/06/08 %% leplan plangetbase aload pop vectprod3d %% 27/06/08 %% /c exch def %% 27/06/08 %% /b exch def %% 27/06/08 %% /a exch def %% 27/06/08 %% leplan plangetorigine %% 27/06/08 %% /z0 exch def %% 27/06/08 %% /y0 exch def %% 27/06/08 %% /x0 exch def %% 27/06/08 %% [a b c a x0 mul b y0 mul add c z0 mul add neg] %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : [a b c d] (x0 y0 z0) alpha defeqplanaffine --> plantype %% 27/06/08 %% %% plan defini par l equation ax+by+cz+d=0, %% 27/06/08 %% %% rotation de alpha autour de la normale (alpha est optionnel) %% 27/06/08 %% %% origine (x0, y0, z0). l origine est optionnelle %% 27/06/08 %% /eq2plan { %% 27/06/08 %% 5 dict begin %% 27/06/08 %% dup isarray { %% 27/06/08 %% /alpha 0 def %% 27/06/08 %% } { %% 27/06/08 %% dup isstring { %% 27/06/08 %% /alpha 0 def %% 27/06/08 %% } { %% 27/06/08 %% /alpha exch def %% 27/06/08 %% } ifelse %% 27/06/08 %% } ifelse %% 27/06/08 %% dup isstring { %% 27/06/08 %% cvx /origine exch def %% 27/06/08 %% } if %% 27/06/08 %% /table exch def %% 27/06/08 %% table length 4 ne { %% 27/06/08 %% (Erreur : mauvais type d argument dans eq2plan) == %% 27/06/08 %% quit %% 27/06/08 %% } if %% 27/06/08 %% table 0 get /a exch def %% 27/06/08 %% table 1 get /b exch def %% 27/06/08 %% table 2 get /c exch def %% 27/06/08 %% table 3 get /d exch def %% 27/06/08 %% /resultat newplanaffine def %% 27/06/08 %% [a b c alpha] normalvect_to_orthobase %% 27/06/08 %% /imK defpoint3d %% 27/06/08 %% /imJ defpoint3d %% 27/06/08 %% /imI defpoint3d %% 27/06/08 %% resultat [imI imJ] planputbase %% 27/06/08 %% currentdict /origine known { %% 27/06/08 %% origine /z exch def /y exch def /x exch def %% 27/06/08 %% a x mul b y mul add c z mul add d add 0 ne { %% 27/06/08 %% (Erreur : mauvaise origine dans eq2plan) == %% 27/06/08 %% quit %% 27/06/08 %% } if %% 27/06/08 %% resultat origine planputorigine %% 27/06/08 %% } { %% 27/06/08 %% c 0 ne { %% 27/06/08 %% resultat 0 0 d neg c div planputorigine %% 27/06/08 %% } { %% 27/06/08 %% a 0 ne { %% 27/06/08 %% resultat d neg a div 0 0 planputorigine %% 27/06/08 %% } { %% 27/06/08 %% b 0 ne { %% 27/06/08 %% resultat 0 d neg b div 0 planputorigine %% 27/06/08 %% } { %% 27/06/08 %% (Error dans eq2plan : (a,b,c) = (0,0,0)) == %% 27/06/08 %% } ifelse %% 27/06/08 %% } ifelse %% 27/06/08 %% } ifelse %% 27/06/08 %% } ifelse %% 27/06/08 %% resultat %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% /points2eqplan { %% 27/06/08 %% 10 dict begin %% 27/06/08 %% /C defpoint3d %% 27/06/08 %% /B defpoint3d %% 27/06/08 %% /A defpoint3d %% 27/06/08 %% A B vecteur3d %% 27/06/08 %% A C vecteur3d %% 27/06/08 %% vectprod3d %% 27/06/08 %% normalize3d %% 27/06/08 %% /c exch def %% 27/06/08 %% /b exch def %% 27/06/08 %% /a exch def %% 27/06/08 %% A %% 27/06/08 %% /zA exch def %% 27/06/08 %% /yA exch def %% 27/06/08 %% /xA exch def %% 27/06/08 %% [a b c a xA mul b yA mul add c zA mul add neg] %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% /monplan %% 27/06/08 %% %% %[0 0 -2 [1 0 0 0 1 0 0 0 1] [-3 3 -2 2] [1. 1.]] %% 27/06/08 %% %% [0 0 1 1] 30 eq2plan %% 27/06/08 %% %% def %% 27/06/08 %% %% %% 27/06/08 %% %% [0 0 1 -2] eq2plan newplan %% 27/06/08 %% %% dup (blanc) outputcolors %% 27/06/08 %% %% monplan newplan %% 27/06/08 %% %% dup (blanc) outputcolors %% 27/06/08 %% %% solidfuz %% 27/06/08 %% %% drawsolid** %% 27/06/08 %% %% monplan plangetorigine %% 27/06/08 %% %% monplan plangetbase aload pop dessinebase %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : x0 y0 z0 [normalvect] norm2plan %% 27/06/08 %% /norm2plan { %% 27/06/08 %% 9 dict begin %% 27/06/08 %% normalvect_to_orthobase %% 27/06/08 %% /imK defpoint3d %% 27/06/08 %% /imJ defpoint3d %% 27/06/08 %% /imI defpoint3d %% 27/06/08 %% imK %% 27/06/08 %% /c exch def %% 27/06/08 %% /b exch def %% 27/06/08 %% /a exch def %% 27/06/08 %% /z0 exch def %% 27/06/08 %% /y0 exch def %% 27/06/08 %% /x0 exch def %% 27/06/08 %% [a b c a x0 mul b y0 mul add c z0 mul add neg] eq2plan %% 27/06/08 %% dup x0 y0 z0 planputorigine %% 27/06/08 %% dup [imI imJ] planputbase %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype planxmarks %% 27/06/08 %% /planxmarks { %% 27/06/08 %% 5 dict begin %% 27/06/08 %% dup isbool { %% 27/06/08 %% /mybool exch def %% 27/06/08 %% } { %% 27/06/08 %% /mybool true def %% 27/06/08 %% } ifelse %% 27/06/08 %% /leplan exch def %% 27/06/08 %% leplan plangetrange aload pop %% 27/06/08 %% /ymax exch def %% 27/06/08 %% /ymin exch def %% 27/06/08 %% /xmax exch def %% 27/06/08 %% /xmin exch def %% 27/06/08 %% newpath %% 27/06/08 %% xmin truncate cvi 0 smoveto %% 27/06/08 %% xmax truncate cvi 0 slineto %% 27/06/08 %% leplan mybool projpath %% 27/06/08 %% stroke %% 27/06/08 %% xmin truncate cvi xmkstep xmax truncate cvi { %% 27/06/08 %% dup 0 ne { %% 27/06/08 %% /x exch def %% 27/06/08 %% x %% 27/06/08 %% x x truncate eq { %% 27/06/08 %% cvi %% 27/06/08 %% } if %% 27/06/08 %% dup chaine cvs exch 0 leplan mybool dctextp3d %% 27/06/08 %% newpath %% 27/06/08 %% x 0 smoveto %% 27/06/08 %% 0 2.5 rmoveto %% 27/06/08 %% 0 -5 rlineto %% 27/06/08 %% leplan mybool projpath %% 27/06/08 %% stroke %% 27/06/08 %% } { %% 27/06/08 %% pop (0) 0 0 leplan mybool dltextp3d %% 27/06/08 %% } ifelse %% 27/06/08 %% } for %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype planymarks %% 27/06/08 %% /planymarks { %% 27/06/08 %% 5 dict begin %% 27/06/08 %% dup isbool { %% 27/06/08 %% /mybool exch def %% 27/06/08 %% } { %% 27/06/08 %% /mybool true def %% 27/06/08 %% } ifelse %% 27/06/08 %% /leplan exch def %% 27/06/08 %% leplan plangetrange aload pop %% 27/06/08 %% /ymax exch def %% 27/06/08 %% /ymin exch def %% 27/06/08 %% /xmax exch def %% 27/06/08 %% /xmin exch def %% 27/06/08 %% newpath %% 27/06/08 %% 0 ymin truncate cvi smoveto %% 27/06/08 %% 0 ymax truncate cvi slineto %% 27/06/08 %% leplan mybool projpath %% 27/06/08 %% stroke %% 27/06/08 %% ymin truncate cvi ymkstep ymax truncate cvi { %% 27/06/08 %% dup 0 ne { %% 27/06/08 %% /y exch def %% 27/06/08 %% y %% 27/06/08 %% y y truncate eq { %% 27/06/08 %% cvi %% 27/06/08 %% } if %% 27/06/08 %% dup chaine cvs exch 0 exch leplan mybool cltextp3d %% 27/06/08 %% newpath %% 27/06/08 %% 0 y smoveto %% 27/06/08 %% 2.5 0 rmoveto %% 27/06/08 %% -5 0 rlineto %% 27/06/08 %% leplan mybool projpath %% 27/06/08 %% stroke %% 27/06/08 %% } { %% 27/06/08 %% pop (0) 0 0 leplan mybool dltextp3d %% 27/06/08 %% } ifelse %% 27/06/08 %% } for %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype planmarks %% 27/06/08 %% /planmarks { %% 27/06/08 %% 1 dict begin %% 27/06/08 %% dup isbool { %% 27/06/08 %% /mybool exch def %% 27/06/08 %% } { %% 27/06/08 %% /mybool true def %% 27/06/08 %% } ifelse %% 27/06/08 %% dup mybool planxmarks mybool planymarks %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% bleu %% 27/06/08 %% %% [-3 3 -2 2] quadrillagexOy_ %% 27/06/08 %% %% stroke %% 27/06/08 %% %% noir %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : [xmin xmax ymin ymax] dx dy quadrillagexOy_ %% 27/06/08 %% /quadrillagexOy_ { %% 27/06/08 %% 4 dict begin %% 27/06/08 %% dup isarray { %% 27/06/08 %% /dx 1 def %% 27/06/08 %% /dy 1 def %% 27/06/08 %% } { %% 27/06/08 %% /dy exch def %% 27/06/08 %% dup isarray { %% 27/06/08 %% /dx dy def %% 27/06/08 %% } { %% 27/06/08 %% /dx exch def %% 27/06/08 %% } ifelse %% 27/06/08 %% } ifelse %% 27/06/08 %% /table exch def %% 27/06/08 %% table 0 get /xmin exch def %% 27/06/08 %% table 1 get /xmax exch def %% 27/06/08 %% table 2 get /ymin exch def %% 27/06/08 %% table 3 get /ymax exch def %% 27/06/08 %% ymin dy ymax { %% 27/06/08 %% /y exch def %% 27/06/08 %% xmin y smoveto %% 27/06/08 %% xmax y slineto %% 27/06/08 %% } for %% 27/06/08 %% xmin dx xmax { %% 27/06/08 %% /x exch def %% 27/06/08 %% x ymin smoveto %% 27/06/08 %% x ymax slineto %% 27/06/08 %% } for %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plan [ngrid] planquadrillage %% 27/06/08 %% /planquadrillage { %% 27/06/08 %% 4 dict begin %% 27/06/08 %% dup isbool { %% 27/06/08 %% /mybool exch def %% 27/06/08 %% } { %% 27/06/08 %% /mybool true def %% 27/06/08 %% } ifelse %% 27/06/08 %% dup isplan { %% 27/06/08 %% /ngrid [1 1] def %% 27/06/08 %% } { %% 27/06/08 %% /ngrid exch def %% 27/06/08 %% } ifelse %% 27/06/08 %% /leplan exch def %% 27/06/08 %% /dx ngrid 0 get def %% 27/06/08 %% /dy ngrid 1 get def %% 27/06/08 %% /table leplan plangetrange def %% 27/06/08 %% table 0 get cvi truncate /xmin exch def %% 27/06/08 %% table 1 get cvi truncate /xmax exch def %% 27/06/08 %% table 2 get cvi truncate /ymin exch def %% 27/06/08 %% table 3 get cvi truncate /ymax exch def %% 27/06/08 %% newpath %% 27/06/08 %% ymin dy ymax { %% 27/06/08 %% /y exch def %% 27/06/08 %% xmin y smoveto %% 27/06/08 %% xmax y slineto %% 27/06/08 %% } for %% 27/06/08 %% xmin dx xmax { %% 27/06/08 %% /x exch def %% 27/06/08 %% x ymin smoveto %% 27/06/08 %% x ymax slineto %% 27/06/08 %% } for %% 27/06/08 %% leplan mybool projpath %% 27/06/08 %% stroke %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype str1 str2 planshowbase -> - %% 27/06/08 %% %% syntaxe : plantype str2 planshowbase -> - %% 27/06/08 %% %% syntaxe : plantype planshowbase -> - %% 27/06/08 %% /planshowbase { %% 27/06/08 %% 3 dict begin %% 27/06/08 %% dup isstring { %% 27/06/08 %% /couleur2 exch def %% 27/06/08 %% dup isstring { %% 27/06/08 %% /couleur1 exch def %% 27/06/08 %% } { %% 27/06/08 %% /couleur1 (rouge) def %% 27/06/08 %% } ifelse %% 27/06/08 %% } { %% 27/06/08 %% /couleur1 (rouge) def %% 27/06/08 %% /couleur2 (vert) def %% 27/06/08 %% } ifelse %% 27/06/08 %% bprojscene %% 27/06/08 %% couleur1 cvx exec %% 27/06/08 %% newpath %% 27/06/08 %% 0 0 smoveto %% 27/06/08 %% 1 0 slineto %% 27/06/08 %% stroke %% 27/06/08 %% 0 0 1 0 oldarrow %% 27/06/08 %% couleur2 cvx exec %% 27/06/08 %% newpath %% 27/06/08 %% 0 0 smoveto %% 27/06/08 %% 0 1 slineto %% 27/06/08 %% stroke %% 27/06/08 %% 0 0 0 1 oldarrow %% 27/06/08 %% eprojscene %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype str1 str2 str3 planshowbase3d -> - %% 27/06/08 %% %% syntaxe : plantype str2 str3 planshowbase3d -> - %% 27/06/08 %% %% syntaxe : plantype str3 planshowbase3d -> - %% 27/06/08 %% %% syntaxe : plantype planshowbase3d -> - %% 27/06/08 %% %% syntaxe : plantype str1 str2 str3 array planshowbase3d -> - %% 27/06/08 %% %% syntaxe : plantype str2 str3 array planshowbase3d -> - %% 27/06/08 %% %% syntaxe : plantype str3 array planshowbase3d -> - %% 27/06/08 %% %% syntaxe : plantype array planshowbase3d -> - %% 27/06/08 %% /planshowbase3d { %% 27/06/08 %% 7 dict begin %% 27/06/08 %% dup dup isarray exch isplan not and { %% 27/06/08 %% /table exch def %% 27/06/08 %% } { %% 27/06/08 %% /table {} def %% 27/06/08 %% } ifelse %% 27/06/08 %% dup isstring { %% 27/06/08 %% /couleur3 exch def %% 27/06/08 %% dup isstring { %% 27/06/08 %% /couleur2 exch def %% 27/06/08 %% dup isstring { %% 27/06/08 %% /couleur1 exch def %% 27/06/08 %% } { %% 27/06/08 %% /couleur1 (rouge) def %% 27/06/08 %% } ifelse %% 27/06/08 %% } { %% 27/06/08 %% /couleur2 (vert) def %% 27/06/08 %% /couleur1 (rouge) def %% 27/06/08 %% } ifelse %% 27/06/08 %% } { %% 27/06/08 %% /couleur1 (rouge) def %% 27/06/08 %% /couleur2 (vert) def %% 27/06/08 %% /couleur3 (bleu) def %% 27/06/08 %% } ifelse %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan couleur1 couleur2 planshowbase %% 27/06/08 %% plan plangetorigine /I defpoint3d %% 27/06/08 %% plan plangetbase %% 27/06/08 %% dup 0 getp3d /u defpoint3d %% 27/06/08 %% 1 getp3d /v defpoint3d %% 27/06/08 %% u v vectprod3d table newvecteur %% 27/06/08 %% {I addv3d} solidtransform %% 27/06/08 %% dup couleur3 solidputcolors %% 27/06/08 %% solidgridOff %% 27/06/08 %% drawsolid** %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% %% syntaxe : plantype x y z plantranslate --> - %% 27/06/08 %% /plantranslate { %% 27/06/08 %% 4 dict begin %% 27/06/08 %% /M defpoint3d %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans plantranslate) == %% 27/06/08 %% quit %% 27/06/08 %% } if %% 27/06/08 %% plan plan plangetorigine M addv3d planputorigine %% 27/06/08 %% end %% 27/06/08 %% } def %% 27/06/08 %% %% 27/06/08 %% % syntaxe : alpha_x alpha_y alpha_z rotateOpplan --> - %% 27/06/08 %% /rotateOplan { %% 27/06/08 %% 4 dict begin %% 27/06/08 %% /Rxyz defpoint3d %% 27/06/08 %% /plan exch def %% 27/06/08 %% plan isplan not { %% 27/06/08 %% (Erreur : mauvais type d argument dans rotateOplan) == %% 27/06/08 %% quit %% 27/06/08 %% } if %% 27/06/08 %% plan plan plangetorigine Rxyz rotateOpoint3d planputorigine %% 27/06/08 %% %% 27/06/08 %% plan plangetbase 0 getp3d /U defpoint3d %% 27/06/08 %% plan plangetbase 1 getp3d /V defpoint3d %% 27/06/08 %% plan [ %% 27/06/08 %% U Rxyz rotateOpoint3d %% 27/06/08 %% V Rxyz rotateOpoint3d %% 27/06/08 %% ] planputbase %% 27/06/08 %% %% 27/06/08 %% end %% 27/06/08 %% } def