[pstricks] drawing arrows

Zbigniew Nitecki zbigniew.nitecki at tufts.edu
Wed Jan 7 21:02:23 CET 2009

I am not sure what is wrong with the following code;  I am drawing the
surface z=xy over the square [0,1]\times[0,1] (this works fine, if the
multido is commented out) and then to draw
unit normal vectors to this surface.
***********************************************************************
%!TEX TS-program =  latex
\documentclass[11pt]{article}
\usepackage{amsmath, amssymb}
\usepackage[dvipsnames, svgnames]{pstricks}
\usepackage{pst-plot, pst-math, pst-3dplot}
\title{Brief Article}
\author{The Author}
\begin{document}
\maketitle
\begin{figure}[htbp]
\begin{center}
\begin{pspicture}(-3.5,-3)(3.5,3.5)
\psset{Alpha=-30, unit=3}
\pstThreeDCoor[xMin=0, xMax=1.5, yMin=0, yMax=1.5, zMin=0, zMax=2]
\pstThreeDSquare[fillstyle=solid, fillcolor=gray, linestyle=none]
(0,0,0)(1,0,0)(0,1,0)
\psplotThreeD[xPlotpoints=10, yPlotpoints=10, drawStyle=xyLines](0,1)
(0,1){x y mul}

\newcommand{\veclength}[3]{%
#1 dup mul #2 dup mul #3 dup mul add add 0.5 exp
}
\newcommand{\makevector}[3]{%
\pstThreeDLine[arrows=->, arrowscale=2, linewidth=2pt](0,0,0)
(#1,#2,#3)%
}

\multido{\rx=0+0.1}{10}{%
\multido{\ry=0+0.1}{10}{%
\pstThreeDPut(!\rx, \ry, \rx\space \ry\space mul){%
\makevector{\ry\space \veclength{\rx}{\ry}{1}\space div neg}%
{\rx\space \veclength{\rx}{\ry}{1}\space div neg}%
{1 \veclength{\rx}{\ry}{1}\space div neg}%
}
}
}
\end{pspicture}
\label{fig:fluxint1}
\end{center}
\end{figure}

\end{document}
************************************************************************************************
Here is my console output:
############################################################
### This is /usr/texbin/simpdftex, Version 20070809
### /usr/texbin/latex MinimalPST3DTest.tex
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
%&-line parsing enabled.
entering extended mode
(./MinimalPST3DTest.tex
LaTeX2e <2005/12/01>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax,
dumylang, noh
yphenation, german-x-2008-06-18, ngerman-x-2008-06-18, 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, la
tin, mongolian, mongolian2a, bokmal, nynorsk, polish, portuguese,
romanian, rus
sian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish,
ukenglis
(/usr/local/texlive/2008/texmf-dist/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/local/texlive/2008/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the ?' option.
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2008/texmf-dist/tex/generic/pstricks/latex/
pstricks.sty
(/usr/local/texlive/2008/texmf-dist/tex/generic/pstricks/pstricks.tex
PSTricks' v1.26  <2008/07/31> (tvz)
(/usr/local/texlive/2008/texmf-dist/tex/generic/pstricks/pstricks.con))
(/usr/local/texlive/2008/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/local/texlive/2008/texmf/tex/latex/config/color.cfg)
(/usr/local/texlive/2008/texmf-dist/tex/latex/graphics/dvips.def)
(/usr/local/texlive/2008/texmf-dist/tex/latex/graphics/dvipsnam.def)
(/usr/local/texlive/2008/texmf-dist/tex/latex/xcolor/svgnam.def)))
(/usr/local/texlive/2008/texmf-dist/tex/generic/pstricks/latex/pst-
plot.sty
(/usr/local/texlive/2008/texmf-dist/tex/generic/pstricks/pst-plot.tex
(/usr/local/texlive/2008/texmf-dist/tex/generic/multido/multido.tex
v1.41, 2004/05/18 <tvz>)  v1.01, 2008/01/26))
(/usr/local/texlive/2008/texmf-dist/tex/latex/pst-math/pst-math.sty
(/usr/local/texlive/2008/texmf-dist/tex/generic/pst-math/pst-math.tex
pst-math' v0.3 (Rev 1.0, 2004-06-15 22:29:36+02), C.Jorssen))
(/usr/local/texlive/2008/texmf-dist/tex/latex/pst-3dplot/pst-3dplot.sty
(/usr/local/texlive/2008/texmf-dist/tex/generic/pst-3dplot/
pst-3dplot.tex
(/usr/local/texlive/2008/texmf-dist/tex/generic/pst-3d/pst-3d.tex
(/usr/local/texlive/2008/texmf-dist/tex/generic/xkeyval/pst-xkey.tex
(/usr/local/texlive/2008/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2008/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2008/texmf-dist/tex/generic/xkeyval/keyval.tex))))
PST-3d' v1.00, 2005/09/03 (tvz))
(/usr/local/texlive/2008/texmf-dist/tex/generic/pstricks/pst-node.tex
v1.00, 2007/10/16) pstricks-add' v3.08, 2008/08/06 (dr,hv))
(/usr/local/texlive/2008/texmf-dist/tex/generic/multido/multido.tex
v1.41, 2004/05/18 <tvz>) PST-3dplot' v1.80, 2008/02/08 (HV,DL)))
(/usr/local/texlive/2008/texmf-dist/tex/latex/pst-func/pst-func.sty
(/usr/local/texlive/2008/texmf-dist/tex/generic/pst-func/pst-func.tex
PST-func' v0.55, 2008/06/12 (hv)))
(/usr/local/texlive/2008/texmf-dist/tex/latex/pst-text/pst-text.sty
(/usr/local/texlive/2008/texmf-dist/tex/generic/pst-text/pst-text.tex
v1.00, 2006/11/05(tvz,hv)))

No file MinimalPST3DTest.aux.
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2008/texmf-dist/tex/latex/amsfonts/umsb.fd) [1]
(./MinimalPST3DTest.aux)

LaTeX Warning: Label(s) may have changed. Rerun to get cross-
references right.

)
Output written on MinimalPST3DTest.dvi (1 page, 478444 bytes).
Transcript written on MinimalPST3DTest.log.
### /usr/texbin/dvips -R -Poutline  -o /tmp/altpdflatex.
4410-1231358305/MinimalPST3DTest.ps MinimalPST3DTest.dvi
)
' TeX output 2009.01.07:1458' -> /tmp/altpdflatex.4410-1231358305/
MinimalPST3DTest.ps
</usr/local/texlive/2008/texmf/dvips/base/tex.pro>
</usr/local/texlive/2008/texmf-dist/dvips/pstricks/pstricks.pro>
</usr/local/texlive/2008/texmf-dist/dvips/pstricks/pst-algparser.pro>
</usr/local/texlive/2008/texmf-dist/dvips/pstricks/pst-dots.pro>
</usr/local/texlive/2008/texmf-dist/dvips/pst-math/pst-math.pro>
</usr/local/texlive/2008/texmf-dist/dvips/pstricks/pst-node.pro>
</usr/local/texlive/2008/texmf-dist/dvips/pst-3dplot/pst-3dplot.pro>
</usr/local/texlive/2008/texmf-dist/dvips/pst-func/pst-func.pro>
</usr/local/texlive/2008/texmf-dist/dvips/pst-text/pst-text.pro>
</usr/local/texlive/2008/texmf/dvips/base/texps.pro>
</usr/local/texlive/2008/texmf/dvips/base/special.pro>
</usr/local/texlive/2008/texmf/dvips/base/color.pro>.
</usr/local/texlive/2008/texmf-dist/fonts/type1/bluesky/cm/cmr10.pfb>
</usr/local/texlive/2008/texmf-dist/fonts/type1/bluesky/cm/cmmi10.pfb>
</usr/local/texlive/2008/texmf-dist/fonts/type1/bluesky/cm/cmr12.pfb>
</usr/local/texlive/2008/texmf-dist/fonts/type1/bluesky/cm/cmr17.pfb>[1]
### ps2pdf13 /tmp/altpdflatex.4410-1231358305/MinimalPST3DTest.ps /tmp/
altpdflatex.4410-1231358305/MinimalPST3DTest.pdf
Error: /undefined in !0.0
Operand stack:

Execution stack:
%interp_exit   .runexec2   --nostringval--   --nostringval--   --
nostringval--   2   %stopped_push   --nostringval--   --
nostringval--   --nostringval--   false   1   %stopped_push   1905
1   3   %oparray_pop   1904   1   3   %oparray_pop   1888   1   3
%oparray_pop   1771   1   3   %oparray_pop   --nostringval--
%errorexec_pop   .runexec2   --nostringval--   --nostringval--   --
nostringval--   2   %stopped_push   --nostringval--   --
nostringval--   --nostringval--
Dictionary stack:
--dict:1148/1684(ro)(G)--   --dict:0/20(G)--   --dict:
122/200(L)--   --dict:178/300(L)--   --dict:104/200(L)--   --dict:56/400(L)--
--dict:0/10(L)--   --dict:104/200(L)--   --dict:95/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 182602
GPL Ghostscript 8.62: Unrecoverable error, exit code 1
### FAILED to generate /tmp/altpdflatex.4410-1231358305/
MinimalPST3DTest.pdf ()
#################################################################

Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20090107/c69f0010/attachment.html