%% $Id: pst-hyperboloid-doc-exa5.tex 1273 2026-06-02 10:47:27Z herbert $

\begin{externalDocument}[
  compiler=lualatex, runs=1, crop,
  %xindex, xindexOptions={-l DE --config AU},
  %mpwidth=0.6\linewidth, 
  usefancyvrb=false,
  docType=latex,
]{voss}
\DocumentMetadata{}
\documentclass{article}
\pagestyle{empty}
\usepackage{libertinus}
%StartVisiblePreamble
\usepackage[dvipsnames,svgnames]{pstricks}
\usepackage{pst-hyperboloid}
%StopVisiblePreamble
\begin{document}
\begin{pspicture}(-8,-3)(8,8)
\psset{unit=1cm}
\psset{viewpoint=50 60 30 rtp2xyz,lightsrc=viewpoint,Decran=50}
\psframe(-5,-3)(5,8)
\pstVerb{/iface 0 def
         /decalage -120 3.14159265359 mul 180 div def /H 4 def /Rayon 3 def}%
\defFunction[algebraic]{hyperboloidonesheet}(u,v)%
  {Rayon*(cos(u)*(1-v)+v*(cos(u+decalage)))}
  {Rayon*(sin(u)*(1-v)+v*(sin(u+decalage)))}
  {v*H}%
\psSolid[object=surfaceparametree,
  ngrid=36 18, incolor=yellow!20,
  fcol= 0 1 35{/Rang exch def
     Rang 2 div cvi 2 mul cvi Rang eq 
         {/Damier {iface (Black) iface 1 add (White)} def}
         {/Damier {iface (White) iface 1 add (Black)} def} ifelse
     9 { Damier /iface iface 2 add def } repeat
  } for, base=0 2 Pi mul 1 0, function=hyperboloidonesheet]
\gridIIID[Zmin=0,Zmax=4](-3,3)(-3,3)
\end{pspicture}
\end{document}
\end{externalDocument}
