[pstricks] Re : pst-vue3D: two examples

hjsalchow at aol.com hjsalchow at aol.com
Mon Oct 23 03:49:26 CEST 2006


mluque5130 at aol.com schrieb:
>  
> >dear manuel,
> >typical cooling towers hyperbolic structures. See:
>
> >http://en.wikipedia.org/wiki/Hyperboloid_structure
>
> >http://en.wikipedia.org/wiki/Cooling_tower
>
>
>
> >Your example seems to me as a mixture of a hyperbolic structure and a tube.
>
>
> The author of these two splendid examples is Christian Sgraja :
>
> http://www.tug.org/pipermail/pstricks/2006/003384.html
>
>     
> However, I also a little studied the representation of a tower of
> cooling of a nuclear thermal power station with the subscribers of the
> Syracuse list and the photographs of Jean-Michel Sarlat. The
> photographs and the PSTricks examples are here:
>
> http://syracuse.eu.org/~jms/photos/2006/0813-civaux1/
> http://syracuse.eu.org/~jms/photos/2006/0813-civaux2/
>
> http://syracuse.eu.org/syracuse/mluque/
>
> http://syracuse.eu.org/syracuse/mluque/pst-v3d/pst-V3D0.42/tours-civaux/
>
> Manuel 
>  
>
>
>
>
>
> Hans-Juergen Salchow
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org <mailto:pstricks%40tug.org>
> http://tug.org/mailman/listinfo/pstricks
> ------------------------------------------------------------------------
>
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>   

Dear manuel,
enclosed the source code and the pdf file of a first draft on how to
draw revolving bezier curves. Hope you like it. May be this is a further
pstricks/ pst-vue3d example for cetan.

Best regards
Hans-Juergen Salchow

\documentclass{article}
\usepackage{amsmath,pstricks,pst-plot,pst-3dplot,graphicx}
\begin{document}
\title{Revolving Bezier--Curves}
\author{Hans--Juergen Salchow\thanks{This is a first draft only,
please do not quote without the authors permission. Any comments are
welcome, send them to: hjsalchow at aol.com}}
\date{September 22, 2006}
\maketitle
\begin{abstract}
This are some notes how to draw a revolving bezier curve with for
\TeX, using the \verb+pstricks+ and \verb+pst-3dplot+.
\end{abstract}
\psset{unit=.0615mm}
\begin{center}
\begin{figure}[h]
\makebox[0pt][l]{\includegraphics[scale=.224]{IMG_1183a.eps}}
\begin{pspicture}(-982,-160)(330,-1313)
\psbezier[linecolor=orange](211,-197)(192,-493)(197,-583)(329,-973)
\psbezier[linecolor=orange](-211,-197)(-192,-493)(-197,-583)(-329,-973)
\end{pspicture}
\end{figure}
\end{center}


\section{Introduction}
Using \TeX{} or \LaTeX{}, the package \verb+pstricks+ together with
\verb+pst-vue3d+, \verb+pst-3d+, \verb+pst-3dplot+, and
\verb+pst-gr3d+ allows to draw three dimensional images. These
packages is described in more detail in [1], chapter~27--30.
Frequently needed graphics objects such as a cube, a sphere, a
cylinder, a cone and so on were predefined, so that they can easily
be used.

Sometimes bezier curves seem to be the best approximations for non
linear structures, as for example the two orange bezier curves that
fits quite well the cooling towers of the nuclear power plant in
cevaux, france\footnote{Photo courtesy from Jean-Michel Sarlat~[3];
converted to eps graphics format by the author}. The question was
rised if it is possible to redraw the three dimensional structure.
However, no revolving bezier curve were predefined. In the following
section an attempt is made to fill this gap.

\section{Drawing revolving bezier curves}
This section has two part. First \verb+\mybezier+ is redefined, that
draws a bezier curve. The difference to the usual \verb+\psbezier+
is that \verb+\mybezier+ plots bezier curves by the means of a
\verb+\parametricplot+ from \verb+pst-plot+--package.  This allows
in the second part to extend the definition to plot a revolving
bezier curve using \verb+\parametricplotThreeD+.

\subsection{Drawing a bezier curve}

 Let $b_i\in\Re^2$, $i\in\{0,1,2,3\}$, be the
control points of a bezier curve and let the function
$f:[0,1]\to\Re^2$ be defined by
$$f(t)=b_0\cdot (1-t)^{3}
      +3 b_1\cdot t\cdot (1-t)^{2}
      +3 b_2\cdot t^2\cdot (1-t)
      +b_3\cdot t^3,$$
then it is well known that the bezier curve equals the image
$f[0,1]$, see~[2]. The function $f$ expands to
$$f(t)=(((b_3-3 b_2+3 b_1-b_0)\cdot t+
              3 b_2-6 b_1+3b_0)\cdot t+
        3 b_1-3 b_0)\cdot t+
        b_0,
      $$
This permits to define \verb+\mybezier+, which works analog to
\verb+\psbezier+, as follows
\begin{verbatim}
\def\mybezier(#1,#2)(#3,#4)(#5,#6)(#7,#8){%
       \parametricplot{0}{1}{%
           %x
           #7 3 #5 mul sub 3 #3 mul add #1 sub t mul
           3 #5 mul add 6 #3 mul sub 3 #1 mul add t mul
           3 #3 mul add 3 #1 mul sub t mul
           #1 add
           %y
           #8 3 #6 mul sub 3 #4 mul add #2 sub t mul
           3 #6 mul add 6 #4 mul sub 3 #2 mul add t mul
           3 #4 mul add 3 #2 mul sub t mul
           #2 add
          } %end of \parametricplot
       } %end of \mybezier
\end{verbatim}
Notice that the second component in the \verb+\parametricplot+ is
analog to the first, exempt that $\#k$ is replaced $\#k+1$ with
$k\in\{1,3,5,7\}$.

\subsection{Extension to three dimensions}
The \verb+\def+'inition of \verb+\mybezier+ generalizes easily to a
revolving the bezier curve, called \verb+\mybezierThreeD+. The first
component has to be duplicated. Afterwards the original first
component is multiplied by $\cos u$ and the copy by $\sin u$. The
result is
\begin{verbatim}
\def\mybezierThreeD(#1,#2)(#3,#4)(#5,#6)(#7,#8){%
       \parametricplotThreeD(0,1)(0,360){%
           %x
           #7 3 #5 mul sub 3 #3 mul add #1 sub t mul
           3 #5 mul add 6 #3 mul sub 3 #1 mul add t mul
           3 #3 mul add 3 #1 mul sub t mul
           #1 add
           u cos mul
           %y
           #7 3 #5 mul sub 3 #3 mul add #1 sub t mul
           3 #5 mul add 6 #3 mul sub 3 #1 mul add t mul
           3 #3 mul add 3 #1 mul sub t mul
           #1 add
           u sin mul
           %z
           #8 3 #6 mul sub 3 #4 mul add #2 sub t mul
           3 #6 mul add 6 #4 mul sub 3 #2 mul add t mul
           3 #4 mul add 3 #2 mul sub t mul
           #2 add
          } %end of \parametricplot
       } %end of \def\mybezierThreeD
\end{verbatim}

\def\mybezierThreeD(#1,#2)(#3,#4)(#5,#6)(#7,#8){%
\parametricplotThreeD(0,1)(0,360){%
%x
#7 3 #5 mul sub 3 #3 mul add #1 sub t mul 3 #5 mul add 6 #3 mul sub
3 #1 mul add t mul 3 #3 mul add 3 #1 mul sub t mul #1 add u cos mul
%y
#7 3 #5 mul sub 3 #3 mul add #1 sub t mul 3 #5 mul add 6 #3 mul sub
3 #1 mul add t mul 3 #3 mul add 3 #1 mul sub t mul #1 add
u sin mul
%z
#8 3 #6 mul sub 3 #4 mul add #2 sub t mul 3 #6 mul add 6 #4 mul sub
3 #2 mul add t mul 3 #4 mul add 3 #2 mul sub t mul #2 add
} %end of \parametricplot
} %end of \mybezier

Given this definition is the plot of
\begin{verbatim}
\begin{pspicture}(-330,-60)(330,-1012)
\mybezierThreeD(211,-197)(192,-493)(197,-583)(329,-973)
%%%% bottom and top
\pstThreeDCircle(0,0,-973)(329,0,0)(0,329,0)
\pstThreeDCircle(0,0,-197)(211,0,0)(0,211,0)
%\end{pspicture}
\end{pspicture}
looks as follows
\end{verbatim}
\begin{center}
\begin{pspicture}(-330,-60)(330,-1012)
\mybezierThreeD(211,-197)(192,-493)(197,-583)(329,-973)
%%%% bottom and top
\pstThreeDCircle(0,0,-973)(329,0,0)(0,329,0)
\pstThreeDCircle(0,0,-197)(211,0,0)(0,211,0)
%\end{pspicture}
\end{pspicture}
\end{center}
\begin{thebibliography}{99}
\bibitem{} Vo\ss, Herbert (2005): PSTricks, 2nd Ed, Konrad Triltsch Print,
Germany, ISBN~3-86541-073-1
\bibitem{} URL:~\verb+http://en.wikipedia.org/wiki/Bezier_curve+

\bibitem{}
URL:~\verb+http://syracuse.eu.org/~jms/photos/2006/0813-civaux1/presentations/IMG_1183a.jpg.+,

\end{thebibliography}
\end{document}

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t.tex
Url: http://tug.org/pipermail/pstricks/attachments/20061023/d9f55c75/attachment.pl 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.pdf
Type: application/pdf
Size: 198421 bytes
Desc: not available
Url : http://tug.org/pipermail/pstricks/attachments/20061023/d9f55c75/attachment.pdf 


More information about the PSTricks mailing list