[pstricks] [Fwd: pstricks/pst-solides3d question]

Christoph Bersch usenet at bersch.net
Tue Jun 10 11:13:02 CEST 2008


I posted something in comp.text.tex:

Aaron Jackson schrieb:
> I would really like to have a pstricks picture of a truncated
> octahedron
[...]
> Would anybody know a way to induce pst-solides3d to generate one?

I don't have any data for a truncated octahedron, but you can make one
by yourself as follows:

In a file 'points.dat' you must write the 3D coordinates of all points,
one point in each line:

e.g.

---- points.dat ----
0 0 0
1 0 0
1 1 0
.
.
.
-------------------

These points you must generate by yourself.
Next you need a second data file, where you define all faces referencing
to the points (0 ... (N-1)) in 'points.dat'.

---- faces.dat ----
[ 0 1 2 3 ]
.
.
.
-------------------

An example TeX-file may look as follows:

\documentclass{article}
\usepackage{pst-solides3d}

\begin{document}
\bgroup
\psset{lightsrc=50 10 30}
\noindent
\psset{SphericalCoor,viewpoint=50 -10 30,Decran=60,unit=3}

\begin{pspicture}(-2,-2)(2,2)

\psSolid[object=new,RotZ=45,fillcolor=blue!50,incolor=yellow!50,
     sommets= (points.dat) run,linewidth=0.5\pslinewidth,
     faces={(faces.dat) run}]%
\end{pspicture}

\egroup

\end{document}

I hope this helps you to generate your own solide object!

Christoph



More information about the PSTricks mailing list