[pstricks] passing arguments in postscript(pst3d-solides)
Zbigniew Nitecki
zbigniew.nitecki at tufts.edu
Tue Jul 20 19:51:38 CEST 2010
In my attempt to build a macro for drawing several level surfaces of a quadratic, I have succeeded in what looked
at first like the hardest parts: drawing a "cut-open" hyperboloid of one sheet and a "cut open" double cone.
These have both been implemented in macros which accept as arguments many of the parameters of the problem,
including coefficients in the quadratic, colors, grid sizes, and colors.
Now I am trying to do the same for a hyperboloid of two sheets.
I am taking the tack of defining each of the two sheets as the graph
of a function, defined in polar coordinates and using the "surface parametree"
object in pst3d-solides; this involves defining two functions (one for each sheet)
and two pstsolids. The attached code
works fine if I take the four items out of a macro and use specific numbers for the parameters.
However, when I try to use it in the way shown in a macro, I get error messages that clearly tell me
that the parameters (which I thought I had defined into a user library) are undefined.
For example, with the code as shown I get
> ### This is /usr/texbin/simpdftex, Version 20070809
> ### /usr/texbin/latex pst3dtest5.1.tex
> This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009)
> entering extended mode
> (./pst3dtest5.1.tex
> LaTeX2e <2009/09/24>
> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
> yphenation, german-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, ar
> abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc
> h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono
> greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, ku
> rmanji, latin, latvian, lithuanian, mongolian, mongolian2a, bokmal, nynorsk, po
> lish, portuguese, romanian, russian, sanskrit, serbian, slovak, slovenian, span
> ish, swedish, turkish, ukenglish, ukrainian, uppersorbian, welsh, loaded.
> (/usr/local/texlive/2009/texmf-dist/tex/latex/base/article.cls
> Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
> (/usr/local/texlive/2009/texmf-dist/tex/latex/base/size11.clo))
> (/Users/zbigniewnitecki/Library/texmf/tex/latex/pst-solides3d/pst-solides3d.sty
> (/usr/local/texlive/2009/texmf-dist/tex/latex/pstricks/pstricks.sty
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pstricks/pstricks.tex
> `PSTricks' v1.29 <2009/05/19> (tvz)
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pstricks/pstricks.con))
> (/usr/local/texlive/2009/texmf-dist/tex/latex/xcolor/xcolor.sty
> (/usr/local/texlive/2009/texmf-dist/tex/latex/latexconfig/color.cfg)
> (/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/dvips.def)))
> (/Users/zbigniewnitecki/Library/texmf/tex/latex/pst-solides3d/pst-solides3d.tex
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pstricks/pst-node.tex
> v1.01, 2008/11/26)
> (/usr/local/texlive/2009/texmf-dist/tex/generic/xkeyval/pst-xkey.tex
> (/usr/local/texlive/2009/texmf-dist/tex/latex/xkeyval/xkeyval.sty
> (/usr/local/texlive/2009/texmf-dist/tex/generic/xkeyval/xkeyval.tex
> (/usr/local/texlive/2009/texmf-dist/tex/generic/xkeyval/keyval.tex))))
> (/usr/local/texlive/2009/texmf-dist/tex/generic/multido/multido.tex
> v1.41, 2004/05/18 <tvz>) `PSTSOLIDESIIID' v4.16, 2009/08/11))
> (/usr/local/texlive/2009/texmf-dist/tex/latex/pst-3dplot/pst-3dplot.sty
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pstricks/pst-plot.tex
> v1.04, 2009/06/08)
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pst-3d/pst-3d.tex
> `PST-3d' v1.00, 2005/09/03 (tvz))
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pstricks-add/pst-fp.tex
> `pst-fp' v0.02, 2009/04/02 (hv))
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pst-math/pst-math.tex
> `pst-math' v0.23 , (CJ,hv)) `pstricks-add' v3.35, 2009/10/12 (dr,hv))
> (/usr/local/texlive/2009/texmf-dist/tex/generic/multido/multido.tex
> v1.41, 2004/05/18 <tvz>) `PST-3dplot' v1.86, 2009/10/06 (HV,DL)))
> (/usr/local/texlive/2009/texmf-dist/tex/latex/pst-math/pst-math.sty
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pst-math/pst-math.tex
> `pst-math' v0.23 , (CJ,hv)))
> (/usr/local/texlive/2009/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex))
> (/usr/local/texlive/2009/texmf-dist/tex/latex/pst-3d/pst-3d.sty
> (/usr/local/texlive/2009/texmf-dist/tex/generic/pst-3d/pst-3d.tex
> `PST-3d' v1.00, 2005/09/03 (tvz))) (./pst3dtest5.1.aux)
> Overfull \hbox (121.72002pt too wide) in paragraph at lines 73--74
> [][]
> [1] (./pst3dtest5.1.aux) )
> (see the transcript file for additional information)
> Output written on pst3dtest5.1.dvi (1 page, 12720 bytes).
> Transcript written on pst3dtest5.1.log.
> ### /usr/texbin/dvips -R -Poutline -o /tmp/altpdflatex.46469-1279646821/pst3dtest5.1.ps pst3dtest5.1.dvi
> This is dvips(k) 5.98 Copyright 2009 Radical Eye Software (www.radicaleye.com)
> ' TeX output 2010.07.20:1327' -> /tmp/altpdflatex.46469-1279646821/pst3dtest5.1.ps
> </usr/local/texlive/2009/texmf/dvips/base/tex.pro>
> </usr/local/texlive/2009/texmf-dist/dvips/pstricks/pstricks.pro>
> </usr/local/texlive/2009/texmf-dist/dvips/pstricks/pst-algparser.pro>
> </usr/local/texlive/2009/texmf-dist/dvips/pstricks/pst-dots.pro>
> </usr/local/texlive/2009/texmf-dist/dvips/pstricks/pst-node.pro>
> </usr/local/texlive/2009/texmf-dist/dvips/pst-solides3d/solides.pro>
> </usr/local/texlive/2009/texmf-dist/dvips/pst-math/pst-math.pro>
> </usr/local/texlive/2009/texmf-dist/dvips/pstricks-add/pstricks-add.pro>
> </usr/local/texlive/2009/texmf-dist/dvips/pst-3dplot/pst-3dplot.pro>
> </usr/local/texlive/2009/texmf/dvips/base/texps.pro>
> </usr/local/texlive/2009/texmf/dvips/base/special.pro>
> </usr/local/texlive/2009/texmf/dvips/base/color.pro>.
> </usr/local/texlive/2009/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
> [1]
> ### ps2pdf13 /tmp/altpdflatex.46469-1279646821/pst3dtest5.1.ps /tmp/altpdflatex.46469-1279646821/pst3dtest5.1.pdf
> Error: /undefinedresult in --div--
> Operand stack:
> S --nostringval-- --nostringval-- 0.0 0.0 0.0 0.0
> Execution stack:
> %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop 1739 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- 1 1 4 --nostringval-- %for_pos_int_continue 1 1 4 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval--
> Dictionary stack:
> --dict:1150/1684(ro)(G)-- --dict:0/20(G)-- --dict:80/200(L)-- --dict:773/1012(L)-- --dict:175/300(L)-- --dict:38/200(L)-- --dict:185/200(L)-- --dict:773/1012(L)-- --dict:14/20(L)-- --dict:2/3(L)--
> Current allocation mode is local
> Last OS error: 2
> Current file position is 409336
> GPL Ghostscript 8.70: Unrecoverable error, exit code 1
> ### FAILED to generate /tmp/altpdflatex.46469-1279646821/pst3dtest5.1.pdf ()
which says to me that the "A" defined before the first \defFunction is not recognized within
the function definition.
How do I go about passing the value input at the macro level into the defFunction?
A search of the postscript cookbook, intro, and language reference manual led to no suggestions.
Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155
telephones:
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/20100720/b79db168/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pst3dtest5.1.tex
Type: application/octet-stream
Size: 1373 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20100720/b79db168/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20100720/b79db168/attachment-0003.html>
More information about the PSTricks
mailing list