[pstricks] psbezier in pscustom

Dwight Aplevich aplevich at uwaterloo.ca
Sun Aug 29 21:35:57 CEST 2010


Many thanks for the reply and the new parameter noCurrentPoint.

 From very preliminary tests, it seems that \psset{noCurrentPoint=true}
has to be invoked inside the pscustom environment rather than at the top
of a file, which would require detailed coding changes to legacy diagrams.
Would that be easy to change?

To avoid internal diagram changes, I've tentatively drafted the code
shown below that can be included globally.  It redefines
\psbezier to first set noCurrentPoint=true then invoke the original
macro.  It similarly defines a command \psbezierC (I would have
preferred \psbezier*) that sets noCurrentpoint=false in order to use
the current point as first argument.

Definitions such as these result in two commands that are independent
of \pscustom but accomplish what was intended when \psbezier was
changed. Similar functionality would be appropriate for \pscurve if
I were using that macro.  This probably could be done more simply inside
pstricks.tex but I don't intend to do that.

Draft global code:
\makeatletter%   psbezier redefinitions for 2010 Aug 27 pstricks.tex
   \ifx\Pst at noCurrentPoint\defined{%
     \ifx\MPS at PatchB\undefined{\gdef\MPS at PatchB{}%
       \typeout{ Redefining psbezier to require all coordinate pairs. }%
       \global\let\Pic at psbezier=\psbezier%
       \gdef\psbezier{\psset[pstricks]{noCurrentPoint=true}\Pic at psbezier}%
       \gdef\psbezierC{\psset[pstricks]{noCurrentPoint=false}\Pic at psbezier}}\fi}%
   \else{%   fix for some recent versions of pstricks.tex
     \ifx\MPS at PatchA\undefined{\gdef\MPS at PatchA{}%
     \def\psbezier at ii{\addto at pscode{%
     \ifshowpoints true \else false \fi\tx at OpenBezier%
     \ifshowpoints\tx at BezierShowPoints\fi}\end at OpenObj}}\fi}\fi%
   \makeatother%

Thank you again.


Dwight Aplevich  



More information about the PSTricks mailing list