Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[pstricks,border=10pt]{standalone}
- usepackage{pst-solides3d}
- usepackage{arrayjob}
- begin{document}
- newarraycolors
- 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}
- edefcolorfaces{}%
- multido{i=0+1}{57}{%
- checkcolors(i)
- xdefcolorfaces{colorfacesispace(cachedata)space}}
- %
- deffigure#1#2{%
- psset{viewpoint=120 50 30 rtp2xyz,Decran=50}
- begin{pspicture}(-3,-3)(3,3)
- psSolid[a=8,object=cube,ngrid=3,%
- fcol=colorfaces%
- ,Rot#2=-#1space]%
- end{pspicture}
- }
- multido{iA=0+10}{36}{figure{iA}{X}}
- multido{iA=0+10}{36}{figure{iA}{Y}}
- multido{iA=0+10}{36}{figure{iA}{Z}}
- end{document}
- documentclass[pstricks,border=10pt]{standalone}
- usepackage{pst-solides3d}
- begin{document}
- psset{viewpoint=120 50 30 rtp2xyz,Decran=50}
- pstVerb{/Colors [(red)(yellow)(orange)(green)(blue)] def }
- deffigure#1#2{%
- begin{pspicture}(-3,-3)(3,3)
- psSolid[a=8,object=cube,ngrid=3,%
- fcol=
- 0 1 8 { Colors Rand 4.5 mul cvi get } for
- 9 1 17 { Colors Rand 4.5 mul cvi get } for
- 18 1 26 { Colors Rand 4.5 mul cvi get } for
- 27 1 35 { Colors Rand 4.5 mul cvi get } for
- 36 1 44 { Colors Rand 4.5 mul cvi get } for
- 45 1 53 { Colors Rand 4.5 mul cvi get } for,
- Rot#2=-#1space]%
- end{pspicture}
- }
- multido{iA=0+10}{36}{figure{iA}{X}}
- multido{iA=0+10}{36}{figure{iA}{Y}}
- multido{iA=0+10}{36}{figure{iA}{Z}}
- end{document}
- 0 1 8 { from 0 to 8 with step 1 do
- put the loop variable on the stack
- Colors. Load Color array
- Rand get a random number between 0 and 1
- 4.5 mul between 0 and 4.5
- cvi between 0 and 4
- get load color with random number
- } for. end of for loop
- documentclass[pstricks,border=10pt]{standalone}
- usepackage{pst-solides3d}
- begin{document}
- psset{viewpoint=120 50 30 rtp2xyz,Decran=50}
- pstVerb{/Colors [(red)(yellow)(orange)(green)(blue)] def }
- deffigure#1#2{%
- begin{pspicture}(-3,-3)(3,3)
- psSolid[a=8,object=cube,ngrid=3,%
- fcol=
- 0 1 8 { (red) } for
- 9 1 17 { (green) } for
- 18 1 26 { (blue) } for
- 27 1 35 { (orange) } for
- 36 1 44 { (yellow) } for
- 45 1 53 { (cyan) } for,
- Rot#2=-#1space]%
- end{pspicture}
- }
- multido{iA=0+10}{36}{figure{iA}{X}}
- multido{iA=0+10}{36}{figure{iA}{Y}}
- multido{iA=0+10}{36}{figure{iA}{Z}}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement