For example with pst-solides3d
. If your data defines a function or simple 3d points you can plot the points with pst-plot3d
. If the data describes a 3d solid then use it this way. Run it with xelatex
:
\documentclass{minimal}
\usepackage[svgnames]{pstricks}
\usepackage{pst-solides3d}
\begin{document}
\psset{unit=0.4}
\begin{pspicture}(-4,-8)(6,6)
\psset{lightsrc=30 -40 10,viewpoint=50 -50 20 rtp2xyz,Decran=50,
RotX=90,sommets=(sommets_nefer.dat) run}
\psSolid[object=new,fillcolor=AntiqueWhite,linewidth=0.5\pslinewidth,faces=(faces_nefer.dat) run]
\end{pspicture}
\end{document}
The datafiles are sommets_nefer.dat which defines the coordinates of the polygons and face_nefer.dat defines the area. Every coordinate triple is numbered with 0,1,2,... These numbers are used for the polygons. For example:
\psset{unit=0.75cm,lightsrc=10 -20 50,viewpoint=50 -20 30 rtp2xyz,Decran=50}
\begin{pspicture}(-5.5,-2)(6,6)
\psSolid[object=new,fillcolor=red!50,incolor=yellow,action=draw,
sommets= 2 4 3 -2 4 3 -2 -4 3 2 -4 3 2 4 0
-2 4 0 -2 -4 0 2 -4 0 0 4 5 0 -4 5,
faces={ [0 1 2 3][7 6 5 4][0 3 7 4][3 9 2][1 8 0]
[8 9 3 0][9 8 1 2][6 7 3 2][2 1 5 6]},
num=all,show=all]
\end{pspicture}