Je cherche à représenter un ensemble de briques type 'lego' en 3d. J'ai trouvé le package tikzbricks qui fonctionne pas mal. En jouant avec les paramètres de tdplotsetmaincoords{}{} j'arrive à obtenir une vue '3d' ainsi qu'une vue de face, de dessus, de gauche, d'arrière et de droite. Mais tout ne fonctionne pas... Une idée ? \documentclass[french,12pt,a4paper]{article} \usepackage{tikzbricks} \begin{document} \pagestyle{empty} tdplotsetmaincoords 70 160 \textbf{vue 3D} \tdplotsetmaincoords{70}{160} \begin{center} \begin{wall} \wallbrick[color=blue]{2}{2} \wallbrick[color=yellow]{2}{2} \addtocounter{brickx}{1} \wallbrick[color=orange]{2}{2} \addtocounter{bricky}{2} \addtocounter{brickx}{-7} \wallbrick[color=green]{2}{2} \wallbrick[color=violet]{2}{2} \addtocounter{brickx}{-3} \addtocounter{bricky}{-1} \addtocounter{brickz}{1} \wallbrick[color=black]{2}{2} \end{wall} \end{center} tdplotsetmaincoords 90 180 \textbf{vue de face} \tdplotsetmaincoords{90}{180} \begin{center} \begin{wall} \wallbrick[color=blue]{2}{2} \wallbrick[color=yellow]{2}{2} \addtocounter{brickx}{1} \wallbrick[color=orange]{2}{2} \addtocounter{bricky}{2} \addtocounter{brickx}{-7} \wallbrick[color=green]{2}{2} \wallbrick[color=violet]{2}{2} \addtocounter{brickx}{-3} \addtocounter{bricky}{-1} \addtocounter{brickz}{1} \wallbrick[color=black]{2}{2} \end{wall} \end{center} tdplotsetmaincoords 90 0 \textbf{vue arrière qui n'est pas la bonne} \tdplotsetmaincoords{90}{0} \begin{center} \begin{wall} \wallbrick[color=blue]{2}{2} \wallbrick[color=yellow]{2}{2} \addtocounter{brickx}{1} \wallbrick[color=orange]{2}{2} \addtocounter{bricky}{2} \addtocounter{brickx}{-7} \wallbrick[color=green]{2}{2} \wallbrick[color=violet]{2}{2} \addtocounter{brickx}{-3} \addtocounter{bricky}{-1} \addtocounter{brickz}{1} \wallbrick[color=black]{2}{2} \end{wall} \end{center} tdplotsetmaincoords 90 90 \textbf{vue de gauche} \tdplotsetmaincoords{90}{90} \begin{center} \begin{wall} \wallbrick[color=blue]{2}{2} \wallbrick[color=yellow]{2}{2} \addtocounter{brickx}{1} \wallbrick[color=orange]{2}{2} \addtocounter{bricky}{2} \addtocounter{brickx}{-7} \wallbrick[color=green]{2}{2} \wallbrick[color=violet]{2}{2} \addtocounter{brickx}{-3} \addtocounter{bricky}{-1} \addtocounter{brickz}{1} \wallbrick[color=black]{2}{2} \end{wall} \end{center} tdplotsetmaincoords 90 270 \textbf{vue de droite qui ne semble pas fonctionner} \tdplotsetmaincoords{90}{270} \begin{center} \begin{wall} \wallbrick[color=blue]{2}{2} \wallbrick[color=yellow]{2}{2} \addtocounter{brickx}{1} \wallbrick[color=orange]{2}{2} \addtocounter{bricky}{2} \addtocounter{brickx}{-7} \wallbrick[color=green]{2}{2} \wallbrick[color=violet]{2}{2} \addtocounter{brickx}{-3} \addtocounter{bricky}{-1} \addtocounter{brickz}{1} \wallbrick[color=black]{2}{2} \end{wall} \end{center} tdplotsetmaincoords 0 180 \textbf{vue de dessus} \tdplotsetmaincoords{0}{180} \begin{center} \begin{wall} \wallbrick[color=blue]{2}{2} \wallbrick[color=yellow]{2}{2} \addtocounter{brickx}{1} \wallbrick[color=orange]{2}{2} \addtocounter{bricky}{2} \addtocounter{brickx}{-7} \wallbrick[color=green]{2}{2} \wallbrick[color=violet]{2}{2} \addtocounter{brickx}{-3} \addtocounter{bricky}{-1} \addtocounter{brickz}{1} \wallbrick[color=black]{2}{2} \end{wall} \end{center} \end{document} Posée 17 Oct '23, 15:07 ablasz |
Une citation de la documentation : "Caveat: don’t move away too far from the default viewpoint, otherwise the correct rendering of the brick is not guaranteed."