[pstricks] producing a sequence of Pstricks files

Juergen Gilg gilg at acrotex.net
Sun Feb 10 00:44:07 CET 2008


Hi Patrick,

PSTricks offers the _multido_ command to reproduce some different 
graphics with animation character.

They are setup on multiple pages. If you scroll the pages you get the 
imitation of an animation.

You can split the PDF pages and use them for other software to produce 
an animation. pdf2swf or stuff.

I do not really understand the aim you have.

What is the advantage to have ONE TeX file per frame?  Isn't it easier 
to have ONE TeX file for all the necessary frames and rework the 
produced PDF?

animate package delivers the necessary commands to make an animation. 
AcroTeX as well however distiller is needed to produce the necessary 
layers for an animation.

What format for the frames is the wanted for your purpose?

Compile the following done with multido and then view the pages of the 
resulting PDF.

Regards,

Juergen


\documentclass{article}
\usepackage{pst-3dplot}
\usepackage{pstricks-add}
\usepackage[nomessages]{fp}

\pagestyle{empty}

\definecolor{APBoceanblue}{rgb}{0.00,0.20,0.74}
\definecolor{APBcoldblue}{rgb}{0.00,0.48,0.73}

\begin{document}
% \section*{A Torus}
\def\voc{
\psset{Beta=20,Alpha=50,linewidth=0.1pt,linecolor=APBcoldblue,origin={0,0,0}}%
    \parametricplotThreeD[xPlotpoints=100](80,\bi)(0,360){%
        /k 2 def /k2 4 def
        t cos 2 mul 4 u sin 2 mul add mul
        t sin 2 mul 4 u sin 2 mul add mul
        u cos 4 mul
    }
    \parametricplotThreeD[yPlotpoints=75](0,360)(80,\bi){%
        /k 2 def /k2 4 def
        u cos 2 mul 4 t sin 2 mul add mul
        u sin 2 mul 4 t sin 2 mul add mul
        t cos 4 mul
    }
\parametricplotThreeD[yPlotpoints=1,linecolor=APBoceanblue,linewidth=2pt](0,360)(80,360){%
        /k 2 def /k2 4 def
        u cos 2 mul 4 t sin 2 mul add mul
        u sin 2 mul 4 t sin 2 mul add mul
        t cos 4 mul
    }
}

\psset{unit=0.35}

\FPdiv{\myDeltaA}{16}{36}%
    \def\ai{-8}%
\FPdiv{\myDeltaB}{280}{36}%
    \def\bi{80}%

\multido{\i=1+1}{37}{%
 \begin{pspicture}(-2,-8)(2,8)
  \voc
 \end{pspicture}
 \newpage
 \FPadd{\ai}{\ai}{\myDeltaA}
 \FPadd{\bi}{\bi}{\myDeltaB}
}
\end{document}

Patrick Drechsler wrote:
> Herbert Voss <Herbert.Voss at FU-Berlin.DE> writes:
>
>   
>> Patrick Drechsler schrieb:
>>
>>     
>>> I would like to produce a sequence of individual pstricks files. Is
>>> there a LaTeX (or Pstricks) method to do this?
>>>       
>> http://tug.org/PSTricks/main.cgi?file=Animation/basics
>>     
>
> Thank you for pointing out the examples (I've also looked at AcroTeX,
> but it has too many dependencies I can not fulfill at the moment).
>
> I am still trying to understand the contents of the links provided on
> this page. Although the examples by Manuel Luque look very cool, they
> are way over my head (mainly because my french is very rusty).
>
> Nevertheless, the examples for using the package "animate" are similar
> to the examples published with the documentation of the package. They
> use the *inline* capabilities to produce animations. As I wrote in my
> original mail:
>
>   
>>> I would like to refrain from using the inline version of writing code
>>> in favour of using external files (each "frame" in a separate file).
>>>       
>
> The reason for this is that my system does not provide the required
> GhostScript version. I would therefore like to create the animation on a
> different system and than include it on my main document.
>
> I think it might work using a combination of the "preview" and "pst-pdf"
> package. Here is a new example:
>
> *b-main.tex* 
> (this file can be compiled on a system with ghostscript <8.31):
> --8<---------------cut here---------------start------------->8---
> \documentclass{beamer}
> \usepackage{animate}
> \usepackage{graphicx}
> \begin{document}
> \begin{center}
>   \animategraphics[
>   controls, loop,
>   timeline=timeline.txt
>   ]{4}{b-images-pics}{}{}
> \end{center}
> \end{document}
> --8<---------------cut here---------------end--------------->8---
>
> *b-images.tex* 
> (run ps4pdf; this pdf file has to be created on a system with
> ghostscript >8.31; output file is called b-images-pics.pdf):
> --8<---------------cut here---------------start------------->8---
> \documentclass{article}
> \usepackage{pstricks-add}
> \usepackage{pst-pdf}
> \pagestyle{empty}
> \begin{document}
> \begin{pspicture}[showgrid=false](5,5)
>   \pscircle(1,1){1}
> \end{pspicture}
> \begin{pspicture}[showgrid=false](5,5)
>   \pscircle(2,2){1}
> \end{pspicture}
> \begin{pspicture}[showgrid=false](5,5)
>   \pscircle(3,3){1}
> \end{pspicture}
> \end{document}
> --8<---------------cut here---------------end--------------->8---
>
> Can I create the file b-images-pics.pdf using "whiledo" or "multido"
> instead of having a "pspicture"-environment for each frame?
>
> Is my question phrased in an understandable manner? Please do not
> hesitate to ask for further details.
>
> Cheers,
>
> Patrick 
>
> BTW, there is a typo on the link you have provided:
>
> http://tug.org/PSTricks/main.cgi?file=Animation/basics
>
> The main header for the example currently reads "package animat". This
> should be "package animate" (with an "e" at the end).
>
> Also, there is a dead link on the site. The link titled "Script for
> Linux" (pointing to http://tug.org/PSTricks/Examples/AnimWaves.sh) is
> dead.
>   

-- 
 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/20080210/d26f2559/attachment.html 


More information about the PSTricks mailing list