Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. documentclass[pstricks,border=10pt]{standalone}
  2. usepackage{pst-solides3d}
  3. usepackage{arrayjob}
  4. begin{document}
  5.  
  6. newarraycolors
  7. readarray{colors}{red&red&red&red&red&red&red&red&yellow&yellow&yellow&yellow&yellow&yellow&yellow&yellow&yellow&orange&orange&orange&orange&orange&orange&orange&orange&orange&green&green&green&green&green&green&green&green&green&blue&blue&blue&blue&blue&blue&blue&blue&blue}
  8.  
  9. edefcolorfaces{}%
  10. multido{i=0+1}{57}{%
  11. checkcolors(i)
  12. xdefcolorfaces{colorfacesispace(cachedata)space}}
  13. %
  14. deffigure#1#2{%
  15. psset{viewpoint=120 50 30 rtp2xyz,Decran=50}
  16. begin{pspicture}(-3,-3)(3,3)
  17. psSolid[a=8,object=cube,ngrid=3,%
  18. fcol=colorfaces%
  19. ,Rot#2=-#1space]%
  20. end{pspicture}
  21. }
  22. multido{iA=0+10}{36}{figure{iA}{X}}
  23. multido{iA=0+10}{36}{figure{iA}{Y}}
  24. multido{iA=0+10}{36}{figure{iA}{Z}}
  25. end{document}
  26.  
  27. documentclass[pstricks,border=10pt]{standalone}
  28. usepackage{pst-solides3d}
  29. begin{document}
  30.  
  31. psset{viewpoint=120 50 30 rtp2xyz,Decran=50}
  32. pstVerb{/Colors [(red)(yellow)(orange)(green)(blue)] def }
  33. deffigure#1#2{%
  34. begin{pspicture}(-3,-3)(3,3)
  35. psSolid[a=8,object=cube,ngrid=3,%
  36. fcol=
  37. 0 1 8 { Colors Rand 4.5 mul cvi get } for
  38. 9 1 17 { Colors Rand 4.5 mul cvi get } for
  39. 18 1 26 { Colors Rand 4.5 mul cvi get } for
  40. 27 1 35 { Colors Rand 4.5 mul cvi get } for
  41. 36 1 44 { Colors Rand 4.5 mul cvi get } for
  42. 45 1 53 { Colors Rand 4.5 mul cvi get } for,
  43. Rot#2=-#1space]%
  44. end{pspicture}
  45. }
  46. multido{iA=0+10}{36}{figure{iA}{X}}
  47. multido{iA=0+10}{36}{figure{iA}{Y}}
  48. multido{iA=0+10}{36}{figure{iA}{Z}}
  49. end{document}
  50.  
  51. 0 1 8 { from 0 to 8 with step 1 do
  52. put the loop variable on the stack
  53. Colors. Load Color array
  54. Rand get a random number between 0 and 1
  55. 4.5 mul between 0 and 4.5
  56. cvi between 0 and 4
  57. get load color with random number
  58. } for. end of for loop
  59.  
  60. documentclass[pstricks,border=10pt]{standalone}
  61.  
  62. usepackage{pst-solides3d}
  63. begin{document}
  64.  
  65. psset{viewpoint=120 50 30 rtp2xyz,Decran=50}
  66. pstVerb{/Colors [(red)(yellow)(orange)(green)(blue)] def }
  67. deffigure#1#2{%
  68. begin{pspicture}(-3,-3)(3,3)
  69. psSolid[a=8,object=cube,ngrid=3,%
  70. fcol=
  71. 0 1 8 { (red) } for
  72. 9 1 17 { (green) } for
  73. 18 1 26 { (blue) } for
  74. 27 1 35 { (orange) } for
  75. 36 1 44 { (yellow) } for
  76. 45 1 53 { (cyan) } for,
  77. Rot#2=-#1space]%
  78. end{pspicture}
  79. }
  80. multido{iA=0+10}{36}{figure{iA}{X}}
  81. multido{iA=0+10}{36}{figure{iA}{Y}}
  82. multido{iA=0+10}{36}{figure{iA}{Z}}
  83. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement