samedi 17 février 2018

Quatre façons de colorier un tore avec pst-solides3d





Les codes sont donnés ci-dessous :

\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}
\begin{document}
\multido{\i=0+10}{36}{
\begin{pspicture}(-5,-5)(5,5)
\psset[pst-solides3d]{viewpoint=100 60 20 rtp2xyz,solidmemory,
          Decran=100,lightsrc=viewpoint}
\pstVerb{/n1 18 def /n2 36 def}%
\psSolid[object=tore,r1=2.5,r0=1,name=T1,action=none,
               linewidth=0.001,incolor=yellow!20,
              hue=0 1,
              ngrid=n1 n2]%
\psSolid[object=cylindre,h=8,ngrid=8 6,r=0.04,
               name=C1,action=none,
               fillcolor=yellow,linecolor=yellow](0,0,-4)
\psSolid[object=cone,h=0.5,ngrid=8 12,r=0.15,
               name=C2,action=none,
               fillcolor=yellow,linecolor=yellow](0,0,4)
\psSolid[object=fusion,base=T1 C1 C2,
                linewidth=0.001,RotZ=\i,RotX=-20,RotSequence=zxy]
\end{pspicture}}
\end{document}

\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}
\begin{document}
\multido{\i=0+10}{36}{
\begin{pspicture}(-5,-5)(5,5)
\psset[pst-solides3d]{viewpoint=100 60 30 rtp2xyz,solidmemory,
           Decran=100,lightsrc=viewpoint}
\pstVerb{/n1 18 def /n2 36 def}%
\psSolid[object=tore,r1=2.5,r0=1,name=T1,action=none,
               linewidth=0.001,incolor=yellow!20,
               fcol=0 1 n1 1 sub {/i exch def /j 0 def
                      n2 {i j add [i n1 div] (1 1 sethsbcolor) astr2str /j j n1 add def} repeat} for,
                ngrid=n1 n2]%
\psSolid[object=cylindre,h=8,ngrid=8 6,r=0.025,
               name=C1,action=none,fillcolor=red](0,0,-4)
\psSolid[object=cone,h=0.3,ngrid=8 12,r=0.1,
               name=C2,action=none,fillcolor=red](0,0,4)
\psSolid[object=fusion,base=T1 C1 C2,linewidth=0.001,RotX=\i]
\end{pspicture}}
\end{document}

\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}
\begin{document}
\multido{\i=0+10}{36}{
\begin{pspicture}(-5,-5)(5,5)
\psset[pst-solides3d]{viewpoint=100 60 30 rtp2xyz,solidmemory,
       Decran=100,lightsrc=viewpoint}
\pstVerb{/n1 18 def /n2 36 def}%
\psSolid[object=tore,r1=2.5,r0=1,name=T1,action=none,
         linewidth=0.001,incolor=yellow!20,
         tablez=-1 0.1 1 {} for,
         zcolor=(jaune) (orange),
         ngrid=n1 n2]%
\psSolid[object=cylindre,h=8,ngrid=8 6,r=0.025,name=C1,
         action=none,tablez=-4 0.1 4 {} for,
         zcolor=(jaune) (orange)](0,0,-4)
\psSolid[object=cone,h=0.3,ngrid=8 12,r=0.1,name=C2,
         action=none,fillcolor=red](0,0,4)
\psSolid[object=fusion,base=T1 C1 C2,linewidth=0.001,RotY=\i]
\end{pspicture}}
\end{document}

\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}
\begin{document}
\multido{\i=0+10}{36}{
\begin{pspicture}(-5,-5)(5,5)
\psset[pst-solides3d]{viewpoint=100 0 0 rtp2xyz,solidmemory,
       Decran=100,lightsrc=viewpoint}
\pstVerb{/n1 24 def /n2 42 def}%
\psSolid[object=tore,r1=2.5,r0=1,
         action=none,name=torusrainbow,
         RotY=\i,
         ngrid=n1 n2]%
\psSolid[object=load,load=torusrainbow,
         linewidth=0.001,
         tablez=-3.5 0.1 3.5 {} for,
         zcolor=0 1]
\psSolid[object=cylindre,h=7,r=0.1,
         ngrid=20 4,grid,
         tablez=-3.5 0.1 3.5 {} for,
         zcolor=0 1](0,-4.5,-3.5)
\end{pspicture}}
\end{document}

Si le sujet vous intéresse, voici quelques liens de ce blog qui traitent de différentes façons de décorer un tore (ou bien, dans le champ de recherches tapez !tore) :

http://pstricks.blogspot.fr/2015/02/tore-decoupe-en-rubans-de-villarceau.html
http://pstricks.blogspot.fr/2015/02/le-numero-396-janvier-fevrier-2015-de.html
http://pstricks.blogspot.fr/2015/02/tore-decoupe-en-rubans-de-villarceau_13.html
http://pstricks.blogspot.fr/2015/02/tore-decoupe-en-cercles-de-villarceau_8.html
http://pstricks.blogspot.fr/2015/04/solides-avec-decor-pois-de-couleur_9.html
http://pstricks.blogspot.fr/2015/02/une-autre-image-dun-tore.html
http://pstricks.blogspot.fr/2015/02/cercles-de-villarceau-sur-un-tore-3.html
http://pstricks.blogspot.fr/2015/02/tore-decoupe-en-cercles-de-villarceau.html

http://pstricks.blogspot.fr/2017/08/texte-et-image-sur-une-surface.html

http://pstricks.blogspot.fr/2017/02/generalisation-des-tubes-avec-pst.html
http://pstricks.blogspot.fr/2016/08/les-cyclides-de-dupin-avec-pst_11.html
http://pstricks.blogspot.fr/2016/06/enroulements-autour-dun-tore-1-une.html
http://pstricks.blogspot.fr/2015/03/maillage-dun-solide-comme-un-mur-de.html
http://pstricks.blogspot.fr/2015/02/tore-evide-avec-pst-solides3d.html
http://pstricks.blogspot.fr/2014/08/la-marche-dun-ressort-simulation.html

Aucun commentaire:

Enregistrer un commentaire