[pstricks] Plotting a Mobius-strip with PStricks
Juergen Gilg
gilg at acrotex.net
Thu Dec 18 16:36:38 CET 2008
Heloo Fosk,
you might try -- however i think some better results are possible with
pst-solides3d -- see the documentation about surfaces in R^3:
\documentclass{article}
\usepackage{pst-3dplot}
\makeatletter
\define at key[psset]{pst-3dplot}{HueBegin}{% Between 0 and 1
\def\PstHSB at HueBegin{#1}}
\define at key[psset]{pst-3dplot}{HueEnd}{% Between 0 and 1
\def\PstHSB at HueEnd{#1}}
\define at boolkey[psset]{pst-3dplot}[Pst@]{HSB}[true]{}
% Default values
\psset[pst-3dplot]{HueBegin=0,HueEnd=1,HSB=false}
\psset{dimen=outer}
\def\parametricPlotThreeD at iii{% without arrows (quickplot)
\addto at pscode{%
\psk at ThreeDplot@yPlotpoints {
/Counter 0 def
/t tMin def
xyz \@nameuse{beginqp@\psplotstyle}
/t t dt add def
\psk at ThreeDplot@xPlotpoints\space 1 sub {
xyz
/Counter Counter 1 add def
1 Counter eq { moveto currentpoint /OldY ED /OldX ED }
{\ifPst at HSB % Other points than the first one
/PointY exch def
/PointX exch def
Counter \psk at ThreeDplot@xPlotpoints\space div
\PstHSB at HueEnd\space
\PstHSB at HueBegin\space sub mul
\PstHSB at HueBegin\space add
1 1 sethsbcolor
OldX OldY PointX PointY lineto lineto
stroke
PointX PointY moveto
/OldX PointX def /OldY PointY def
\else lineto \fi } ifelse
/t t dt add def
} repeat
/t t dt sub def
/u u du add def
} repeat
}%
\@nameuse{endqp@\psplotstyle}%
}
\makeatother
\begin{document}
\psset{Beta=20}
\begin{pspicture}(-4,-4)(4,4)
\def\Radius{5 }
\parametricplotThreeD[plotstyle=line,xPlotpoints=100,
yPlotpoints=100,drawStyle=xyLines,HSB](0,365)(-1,1){
t 2 div cos u mul \Radius add t cos mul
t 2 div cos u mul \Radius add t sin mul
t 2 div sin u mul }
%\pstThreeDCoor[xMin=-1,yMin=-1,zMin=-1]
\parametricplotThreeD[plotstyle=line,xPlotpoints=100,yPlotpoints=1,
linecolor=black,linewidth=1.5pt](488,-60){
t 2 div cos \Radius add t cos mul
t 2 div cos \Radius add t sin mul
t 2 div sin }
\parametricplotThreeD[plotstyle=line,xPlotpoints=100,yPlotpoints=1,
linecolor=black,linewidth=1.5pt](631,513){
t 2 div cos \Radius add t cos mul
t 2 div cos \Radius add t sin mul
t 2 div sin }
\end{pspicture}
\end{document}
Regards,
Juergen
Fosk wrote:
>
> Good morning everybody. How can I draw a Mobius strip using PStricks?
> I tried using pst-plot3d but i can't control the design of parametric
> 2-manifold (i obviously know a global atlas) ...I found only the
> function allowing to draw parametric curves in R3.
>
> Thanks a lot
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>
--
Jürgen Gilg
Austr. 59
70376 Stuttgart
-------------------------------------
Tel 0711.59 27 88
e-Mail gilg at acrotex.net
Websites www.acrotex.net
www.brueckenkurs-physik.de
www.gilligan-online.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20081218/0bda0a14/attachment.html
More information about the PSTricks
mailing list