quinta-feira, 5 de julho de 2012

Mapas 3D no LaTeX

Veja que legal estes mapas 3D feitos no LaTeX com PSTricks.

\documentclass{article}
\usepackage{pst-map3d}
\begin{document}

\begin{pspicture}(-4,-4)(4,4)
\psset{RotX=10,RotZ=-75,PHI=5,THETA=0.3333,visibility=false,
Decran=15,path=/usr/local/texlive/2011/texmf-dist/tex/generic/pst-geo/data}
\WorldMapThreeD[circles=false,blueEarth=false]
\WorldMapThreeD[circles=false,visibility=true,opacity=0.7]
\psmeridien[visibility=true]{13.33}
\psparallel[visibility=true]{52.51}
\mapputIIID(245,215){Brazil}
\psparallel[visibility=true]{0}
\end{pspicture}

\end{document}


Baixe mapa3d.tex.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[margin=1cm]{geometry}
\usepackage{pstricks-add,pst-map3d}
\pagestyle{empty}
\begin{document}
%\psset{path=../data}
\psset{path=/usr/local/texlive/2011/texmf-dist/tex/generic/pst-geo/data}

\definecolor{graygreen}{cmyk}{0.7,0,0.6,0.2}
\begin{pspicture*}(-0.5\linewidth,-0.5\textheight)(0.5\linewidth,0.5\textheight)
\psset{PHI=45,THETA=5,unit=7.5}
\WorldMapThreeD[lakes=false,circlesep=0.25,lakes=false,gridmap=false,
mapcolor=graygreen!50,bordercolor=red,rivers=false,
coastcolor=blue,coasts=false,islandcolor=blue]%
\WorldMapThreeD[gridmapcolor=yellow,circles=false,lakes=true,gridmapdiv=5,
france=true,islandcolor=blue,blueEarth=false,
bordercolor=red,islands=false,borders=false,rivers=true,
coasts=true,coastcolor=blue]%
\psmeridien{2.32}
\psparallel{48.85}
\newpsstyle{NodeLabelStyle}{fillstyle=solid,fillcolor=yellow!50,framesep=0,
linestyle=none,opacity=0.5}
\input{villesFrance3d}
\newpsstyle{NodeLabelStyle}{fillstyle=solid,fillcolor=red!50,
framesep=0,linestyle=none,opacity=0.5}
\newpsstyle{psNodeMapStyle}{fillstyle=solid,fillcolor=yellow!50,linecolor=red}
\psset{nodeWidth=0.025\psunit,linecolor=red}
\pnodeMapIIID(15.2833,37.0833){Syracuse}
\pscircle[fillstyle=solid,fillcolor=green](Syracuse){0.025\psunit}
\psdot[dotsize=0.025\psunit](Syracuse)
\uput[l](Syracuse){\psframebox[fillstyle=solid,fillcolor=yellow!50,framesep=0,
linestyle=none,opacity=0.5]{\textsf{Syracuse}}}
\pnodeMapIIID(10.51667,43.85){Lucques}
\pscircle[fillstyle=solid,fillcolor=green](Lucques){0.025\psunit}
\psdot[dotsize=0.025\psunit](Lucques)
\uput[u](Lucques){\psframebox[fillstyle=solid,fillcolor=yellow!50,framesep=0,
linestyle=none,opacity=0.5]{\textsf{Lucques}}}
\input{capitales3d}
\psepicenter[circlecolor=red,waves=16,Rmax=2000](0.3333,46.5833){Poitiers}
\end{pspicture*}

\end{document}


Baixe france.tex. Tive que adaptar esta figura para os novos pacotes pst-map3d instalados na minha pasta /usr/local/texlive/2011/texmf-dist/tex/generic/pst-geo/data.

Para compilar eu usei latexmk para gerar um pdf direto.
latexmk -xelatex mapa3d.tex france.tex

Fica o desafio: Faça o mapa do Brasil com as capitais e poste aqui pra nós.

Mais informações:
Drawing the Celestial Sphere with Tikz Package
pst-map3d
pst-geo package
france.tex original

Palavras-chave: mapas 3D no LaTeX, mapas 3D com PSTricks