Changeset 54

Show
Ignore:
Timestamp:
06/19/08 10:25:44 (7 months ago)
Author:
jpv
Message:

Gestion des couleurs pour affinage et gestion lumière pour vecteurs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/doc/par-section.tex

    r49 r54  
    599599         name=parts_cube, 
    600600         action=none](a 2 div,a 2 div,a 2 div) 
    601 \psSolid[object=load, 
    602          load=parts_cube1, 
    603          action=writesolid, 
    604          file=cubeHexagone] 
     601%\psSolid[object=load, 
     602%         load=parts_cube1, 
     603%         action=writesolid, 
     604%         file=cubeHexagone] 
    605605\psSolid[object=datfile, 
    606606         fcol=0 (Dandelion), 
  • trunk/solides.pro

    r44 r54  
    11%! 
    22% PostScript prologue for pst-solides3d.tex. 
    3 % Version 3.30, 2008/06/13 
     3% Version 3.31, 2008/06/19 
    44% 
    55%% COPYRIGHT 2008 by Jean-Paul Vignault, Manuel Luque 
     
    613613         /frct true def 
    614614         pop 
    615         i 0 eq { 
    616            0 
    617         } if 
     615        i 0 eq { 
     616            0 
     617        } if 
    618618      } { 
    619619         dup 45 eq { 
     
    621621            pop 
    622622         } { 
    623            frct not { 
     623            frct not { 
    624624               i 1 ge signnum 0 ge and i 2 ge or { 
    625625                  exch 10 mul 48 sub add 
     
    627627                  48 sub 
    628628               } ifelse 
    629            } { 
    630               48 sub 
    631               /k k 1 add store 
    632               10 k exp div add 
    633            } ifelse 
     629            } { 
     630               48 sub 
     631               /k k 1 add store 
     632               10 k exp div add 
     633            } ifelse 
    634634         } ifelse 
    635635      } ifelse 
     
    945945      3 dict begin 
    946946         /lepl@n exch def 
    947         lepl@n plangetbase aload pop 
    948         /@V defpoint3d 
    949         /@U defpoint3d 
    950         lepl@n plangetorigine 
    951         [@U @U @V vectprod3d] mybool planprojpath 
     947        lepl@n plangetbase aload pop 
     948        /@V defpoint3d 
     949        /@U defpoint3d 
     950        lepl@n plangetorigine 
     951        [@U @U @V vectprod3d] mybool planprojpath 
    952952      end 
    953953   } { 
     
    35643564      0 1 n 1 sub { 
    35653565         /j exch def 
    3566         j i ne { 
     3566        j i ne { 
    35673567            solid j solidgetsommet 
    3568         } if 
     3568        } if 
    35693569      } for 
    35703570   ] def 
     
    35763576         %% face d indice j 
    35773577         /j exch def 
    3578         /Fj solid j solidgetface def 
    3579         [0 1 Fj length 1 sub { 
    3580            %% sommet d indice k de la face Fj 
    3581            /k exch def 
    3582            Fj k get dup i gt { 
    3583               1 sub 
    3584            } if 
    3585         } for] 
     3578        /Fj solid j solidgetface def 
     3579        [0 1 Fj length 1 sub { 
     3580            %% sommet d indice k de la face Fj 
     3581            /k exch def 
     3582            Fj k get dup i gt { 
     3583               1 sub 
     3584            } if 
     3585        } for] 
    35863586      } for 
    35873587   ] def 
     
    39053905         i sol j solidgetface in { 
    39063906            %% le sommet i est dans la face j 
    3907            pop 
     3907            pop 
    39083908            exit 
    39093909         } if 
     
    39323932      dup isarray { 
    39333933         /tableaffectation exch def 
    3934         /mode -1 def 
     3934        /mode -1 def 
    39353935      } { 
    39363936         /mode defaultsolidmode def 
     
    49854985         candidat 3 get isarray { 
    49864986            candidat 4 get isarray { 
    4987                candidat 5 get isarray              
     4987               candidat 5 get isarray               
    49884988            } { 
    49894989               false 
    49904990            } ifelse 
    49914991         } { 
    4992            false 
     4992            false 
    49934993         } ifelse 
    49944994      } { 
     
    54475447      dup 0 ne { 
    54485448         /x exch def 
    5449        
    5450         x x truncate eq { 
    5451            cvi 
    5452         } if 
     5449       
     5450        x x truncate eq { 
     5451            cvi 
     5452        } if 
    54535453         dup chaine cvs exch 0 leplan mybool dctextp3d 
    5454         newpath 
    5455            x 0 smoveto 
    5456            0 2.5 rmoveto 
    5457            0 -5 rlineto 
    5458            leplan mybool projpath 
    5459         stroke 
     5454        newpath 
     5455            x 0 smoveto 
     5456            0 2.5 rmoveto 
     5457            0 -5 rlineto 
     5458            leplan mybool projpath 
     5459        stroke 
    54605460      } { 
    54615461         pop (0) 0 0 leplan mybool dltextp3d  
     
    54875487      dup 0 ne { 
    54885488         /y exch def 
    5489        
    5490         y y truncate eq { 
    5491             cvi 
    5492         } if 
     5489       
     5490        y y truncate eq { 
     5491             cvi 
     5492        } if 
    54935493         dup chaine cvs exch 0 exch leplan mybool cltextp3d 
    5494         newpath 
    5495            0 y smoveto 
    5496            2.5 0 rmoveto 
    5497            -5 0 rlineto 
    5498            leplan mybool projpath 
    5499         stroke 
     5494        newpath 
     5495            0 y smoveto 
     5496            2.5 0 rmoveto 
     5497            -5 0 rlineto 
     5498            leplan mybool projpath 
     5499        stroke 
    55005500      } { 
    55015501         pop (0) 0 0 leplan mybool dltextp3d  
     
    56535653      dup isstring { 
    56545654         /couleur2 exch def 
    5655         dup isstring { 
     5655        dup isstring { 
    56565656            /couleur1 exch def 
    5657         } { 
     5657        } { 
    56585658            /couleur1 (rouge) def 
    5659         } ifelse 
     5659        } ifelse 
    56605660      } { 
    56615661         /couleur2 (vert) def 
     
    64496449         0 1 indicesommetstries length 1 sub { 
    64506450            /k exch def 
    6451        nouveauxindices indicesommetstries k get get 
     6451         nouveauxindices indicesommetstries k get get 
    64526452         } for  
    64536453      ] solidaddface 
     
    67196719         0 1 indicesommetstries length 1 sub { 
    67206720            /k exch def 
    6721        nouveauxindices indicesommetstries k get get 
     6721         nouveauxindices indicesommetstries k get get 
    67226722         } for  
    67236723      ] solidaddface 
     
    69006900               /v ymin j dy mul add def 
    69016901               u v 
    6902               surfz {2 copy} if 
    6903               f_surface 
     6902               surfz {2 copy} if 
     6903               f_surface 
    69046904               pstrickactionR3 
    69056905           } for 
     
    81848184      0 1 Fi length 1 sub { 
    81858185         /j exch def 
    8186         lefichierfaces Fi j get chaine cvs writestring 
     8186        lefichierfaces Fi j get chaine cvs writestring 
    81878187         lefichierfaces 32 write %% espace 
    81888188      } for 
     
    84468446      k1 k2 vectprod3d normalize3d /k3 defpoint3d 
    84478447      k3 norme3d 0 eq { 
    8448          tub@dernierk3 aload pop /k3 defpoint3d 
     8448          tub@dernierk3 aload pop /k3 defpoint3d 
    84498449      } { 
    84508450         /tub@dernierk3 [k3] store 
     
    86398639/writeoff {solidfilename writeofffile} def 
    86408640/none {pop} def 
     8641/vecteur_en_c@urs false def 
    86418642 
    86428643/gere_pstricks_color_inout { 
     
    86838684         /i exch def 
    86848685         plansection i get solidplansection 
    8685         dup 0 solidrmface 
     8686        dup 0 solidrmface 
    86868687      } for 
    86878688   } if 
     
    86958696   } if 
    86968697   solidaffinage length 0 ne { 
     8698      %% si on affine, il faut colorier avant 
     8699      activationgestioncouleurs { 
     8700         gere_pstricks_color_out 
     8701      } if 
    86978702      solidaffinage 0 get isstring { 
    86988703         dup affinagecoeff 
    8699         /solidfcolor where { 
    8700            pop 
    8701            solidfcolor 
    8702         } if 
    8703         affinagerm solidaffine 
     8704        /solidfcolor where { 
     8705            pop 
     8706            solidfcolor 
     8707        } if 
     8708        affinagerm solidaffine 
    87048709      } { 
    87058710         dup affinagecoeff solidaffinage 
    8706         /solidfcolor where { 
    8707            pop 
    8708            solidfcolor 
    8709         } if 
    8710         affinagerm solidaffine 
     8711        /solidfcolor where { 
     8712            pop 
     8713            solidfcolor 
     8714        } if 
     8715        affinagerm solidaffine 
    87118716      } ifelse 
     8717      %% et il faut evider et coloriier l'interieur si necessaire 
     8718      solidhollow { 
     8719         dup videsolid 
     8720         activationgestioncouleurs { 
     8721            gsave 
     8722               dup  [fillincolor] (setrgbcolor) astr2str inputcolors 
     8723            grestore 
     8724         } if 
     8725      } if 
     8726      /activationgestioncouleurs false def 
    87128727   } if 
    87138728   tx@Dict /plansepare known { 
     
    87488763      } if 
    87498764   } ifelse 
    8750    /lightsrc where {pop solidlightOn} if 
     8765   vecteur_en_c@urs not { 
     8766      /lightsrc where {pop solidlightOn} if 
     8767   } { 
     8768      /vecteur_en_c@urs false def 
     8769   } ifelse 
    87518770   dup action 
    87528771   noir 
     
    91439162/pst-vecteur { 
    91449163gsave 
    9145 2 dict begin 
    91469164   /activationgestioncouleurs false def 
    9147    solidlightOf
     9165   /vecteur_en_c@urs true de
    91489166   solidlinewidth setlinewidth 
    91499167   2 setlinejoin 
     
    91589176   args definition cvx exec newvecteur 
    91599177   dup 
     9178   gsave 
    91609179      [linecolor currentrgbcolor] ( ) astr2str (setrgbcolor) append  
    91619180      outputcolors 
     9181   grestore 
    91629182   gere_pstricks_opt 
    9163 end 
    91649183grestore 
    91659184} def