summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-12-14 00:33:10 +0000
committerKarl Berry <karl@freefriends.org>2008-12-14 00:33:10 +0000
commit39bd5e5b62002cfa5d3183fc0492f950d5db7002 (patch)
treec1c7cace60faea582f56dd0348ec688c07a896c9
parentccfef10698e5e6e1afc70cb15e03ae531a376de5 (diff)
pst-bspline update (13dec08)
git-svn-id: svn://tug.org/texlive/trunk@11611 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/generic/pst-bspline/README4
-rw-r--r--Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.pdfbin94291 -> 94795 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pst-bspline/pst-bspline.tex39
4 files changed, 41 insertions, 8 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-bspline/README b/Master/texmf-dist/doc/generic/pst-bspline/README
index 9fc2816ecd9..d1bd117b148 100644
--- a/Master/texmf-dist/doc/generic/pst-bspline/README
+++ b/Master/texmf-dist/doc/generic/pst-bspline/README
@@ -2,10 +2,10 @@
%%
%% Michael Sharpe <msharpe@ucsd.edu>
%%
-%% Version 1.11, 2008/10/18
+%% Version 1.13, 2008/12/13
%%
%% License: Free
This package draws uniform, cubic Bspline curves, open and closed, based on a sequence of Bspline control points. There is also code which permits drawing the open or closed cubic Bspline curve interplating a sequence of points.
-The .tex and .sty files should be installed in a folder searched by TeX. All documentation is in bsplinePstricks.pdf. \ No newline at end of file
+The .tex and .sty files should be installed in a folder searched by TeX. All documentation is in pst-bspline-doc.pdf. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.pdf b/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.pdf
index 79b5fafb58b..c322867e406 100644
--- a/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.pdf
+++ b/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex b/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex
index c8c12d2f9a5..5df2756a987 100644
--- a/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex
+++ b/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex
@@ -241,6 +241,12 @@ will construct a sequence {\tt SB0} $\cdots ${\tt SB4} of nodes at the B-spline
\begin{verbatim}
\psBsplineNodes{SB}{4}
\end{verbatim}
+If you don't care about keeping track of the internal operations and names for nodes, you may generate the curve directly with, for example,
+\begin{verbatim}
+\psbspline(0,0)(.5,.1)(1.5,.6)(2.5,1.4)(3.5,1.8)(4.5,1.7)%
+(5.8,1.0)(7.5,.25)(10,0)
+\end{verbatim}
+
\subsection{Closed (periodic) case}
We turn now to the periodic uniform B-spline curve interpolating $n$ points $S_0$,...,$S_{n-1}$. Extend the sequence periodically with period $n$, so that $S_n=S_0$, $S_{n+1}=S_1$, $S_{-1}=S_{n-1}$, and so on. In order to find the periodic control points $B_k$, we have to solve the $n$ equations
\begin{align*}
diff --git a/Master/texmf-dist/tex/generic/pst-bspline/pst-bspline.tex b/Master/texmf-dist/tex/generic/pst-bspline/pst-bspline.tex
index 55949e9310b..398a42827d1 100644
--- a/Master/texmf-dist/tex/generic/pst-bspline/pst-bspline.tex
+++ b/Master/texmf-dist/tex/generic/pst-bspline/pst-bspline.tex
@@ -1,7 +1,7 @@
%% BEGIN pst-bspline.tex
-%% Author: Michael Sharpe (msharpe@ucsd.edu)
-\def\fileversion{1.12}
-\def\filedate{2008/11/28}
+%% Author: Michael Sharpe (msharpe at ucsd.edu)
+\def\fileversion{1.13}
+\def\filedate{2008/12/13}
%%
\message{ v\fileversion, \filedate}
\csname PSTBsplineLoaded\endcsname
@@ -49,6 +49,8 @@
%\def\nextpt#1#2#3{\typeout{Next points:#1:#2:#3:}}
\def\nextfour#1#2#3#4{\newwrite\foo \immediate\openout\foo=foo.txt \immediate\write\foo{Next chars:#1:#2:#3:#4:}\closeout\foo}
%end utility macros
+\newcount\PST@args%used in several macros
+\def\PST@root{}
\newcount\bsp@args
\newcount\bsp@cntA
\newcount\bsp@cntB
@@ -121,7 +123,7 @@
\let\bsp@arrowA\psk@arrowA%
\let\bsp@arrowB\psk@arrowB%
\let\bsp@linestyle\pslinestyle%
-\tracingcommands=2\tracingmacros=2
+%\tracingcommands=2\tracingmacros=2
%\ifbsp@seq\next@Point@ii \else
\next@Point%omit the \fi or it becomes the nextchar
}%
@@ -132,7 +134,7 @@
\advance\bsp@args by 1 \relax
\next@Point}
\def\next@Point@ii{%done reading nodes
-\tracingcommands=0\tracingmacros=0
+%\tracingcommands=0\tracingmacros=0
\ifbsp@seq\advance\bsp@args by 1\fi
\ifbsp@closed
\psset{doubleline=false}
@@ -210,6 +212,31 @@
\ignorespaces
}
%
+\def\psbspline{\pst@object{psbspline}}%
+\def\psbspline@i{\pst@getarrows\psbspline@ii}%
+\def\psbspline@ii{%
+\pnodesX%make the following sequences into nodes named S@0,...
+%last index=\PST@args
+}%
+\def\psbspline@iii{%
+\psBsplineInterp{S@}{\the\PST@args}%creates S@B0...
+\begingroup%
+\use@par%
+\psBsplineNodes{S@B}{\the\PST@args}%draw curve
+\endgroup}%
+%
+\def\pnodesX{%version of \pnodes where the last step moves to \psbspline@iii
+\PST@args=0\relax%
+\def\PST@root{S@}%
+\next@NodeX}%
+%
+\def\next@NodeX{\@ifnextchar({\next@NodeX@i}{\advance\PST@args by -1\typeout{Defined nodes \PST@root0 .. \PST@root\the\PST@args.}\psbspline@iii}}%
+%
+\def\next@NodeX@i(#1){%
+\pnode(#1){\PST@root\the\PST@args}%
+\advance\PST@args by 1\relax%
+\next@NodeX}
+%
\def\make@mcoeff#1{%
\pstVerb{ /mcoeff #1\space 1 add array def
mcoeff 1 0.25 put
@@ -231,7 +258,7 @@
\pnode(\noderoot #2){\noderoot B#2}%
\psLCNode(\noderoot 1){6}(\noderoot 0){-1}{\noderoot B1}% 6*S1-S0->SB1
\multido{\iA=2+1,\iAA=1+1}{\top@mone}{\psLCNodeVar(\noderoot\iA)(\noderoot B\iAA)(! 6 mcoeff \iAA\space get neg ){\noderoot B\iA}}%2 to n-2, 6*S_k-m_{k-1}*SB_{k-1}->SB_k
-\psLCNodeVar(\noderoot \the\top@ndx)(S#2)(! mcoeff \the\top@ndx\space get dup 6 mul exch neg ){tmp@node} %m_{99}*(6*S99-S100)->tmp@node
+\psLCNodeVar(\noderoot \the\top@ndx)(\noderoot #2)(! mcoeff \the\top@ndx\space get dup 6 mul exch neg ){tmp@node} %m_{99}*(6*S99-S100)->tmp@node
\psLCNodeVar(tmp@node)(\noderoot B\the\top@mone)(! 1 mcoeff \the\top@ndx\space get mcoeff \the\top@mone\space get mul neg ){\noderoot B\the\top@ndx}% temp@node -m_{98}*m_{99}*SB98->SB99
\multido{\iA=\the\top@mone+-1,\iAA=\the\top@ndx+-1}{\the\top@mone}{\psLCNodeVar(\noderoot B\iA)(\noderoot B\iAA)(! mcoeff \iA\space get dup neg ){\noderoot B\iA}% m_k*SB_k-m_k*SB_{k+1}->SB_k, k=98 downto 1
}% end multido