[pstricks] hyperboloids in pst-solides3d

Zbigniew Nitecki zbigniew.nitecki at tufts.edu
Mon Jul 12 21:49:37 CEST 2010

I want to draw (in one pspicture) the level surfaces of f(x,y,z)=x^2+y^2-z^2 
for the values -1,0, and 1.  

My attempt to do this with \parametricplotThreeD is not so successful:  either I have
a collection of lines (and difficulty hiding some) or if I use enough plotpoints, the 
inside stuff is totally wiped out.  So I'm trying to see if I can do it more easily in

The cone for 0 is easy.  I tried to understand from
the example at the end of section 6.6.4, p. 90 in the (English) documentation for
pst-solides-3d how to draw a hyperboloid of one sheet in this system, but
I need someone to parse for me the function definitions embedded in it.

Here is the code in the example:

> \begin{pspicture*}(-5,-5)(3,5) \psSolid[object=new,fillcolor=red!50,incolor=yellow,
> hollow, a=10, %% nb d’etages b=20, %% diviseur de 360, nb de meridiens h=8, %% hauteur action=draw**,sommets=
> /z0 h neg 2 div def a-10{
> /k exch def 01b1 sub {
> /i exch def /r z0 h a div k mul add dup mul 4 div 1 add sqrt def 360 b idiv i mul cos r mul 360 b idiv i mul sin r mul z0 h a div k mul add
> } for } for, faces={
> 0 1 a 1 sub { /k exch def k b mul 1 add 1 k 1 add b mul 1 sub { /i exch def [i i 1 sub b i add 1 sub b i add]
> } for [k b mul k 1 add b mul 1 sub k 2 add b mul 1 sub k 1
> add b mul] }for
> }] \end{pspicture*}

I am having trouble understanding the structure of lines 3-8.

Can anyone explain it for me?  I have (limited) experience with postscript, but none with jps.

Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20100712/305b8682/attachment-0001.html>

More information about the PSTricks mailing list