diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-15 23:09:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-15 23:09:30 +0000 |
commit | 19b68112afa7a9fefc611f2e796e82a3884d0e08 (patch) | |
tree | 569ff823f08987a1733ee6de9d4507b15599632d | |
parent | 1df1829282a57c887b9dc8ceefc83905a3359252 (diff) |
pst-bspline (15oct10)
git-svn-id: svn://tug.org/texlive/trunk@20115 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-bspline/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.pdf | bin | 86397 -> 101556 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex | 132 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-bspline/pst-bspline.tex | 109 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-bspline/pst-bspline.sty | 16 |
5 files changed, 211 insertions, 50 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-bspline/README b/Master/texmf-dist/doc/generic/pst-bspline/README index a5bc5e71956..3e8dd393146 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.3, 2010/09/04 +%% Version 1.4, 2010/10/14 %% %% 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. +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. This version adds a \thickBspline macro. 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 Binary files differindex c116ed3af90..6c395adbf4f 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 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 1de47c211ac..9e08c19d7f1 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 @@ -3,7 +3,7 @@ \usepackage{amsthm} \usepackage{graphicx} \usepackage{pstricks} -\usepackage{multido,pst-bspline,pstricks-add} +\usepackage{multido,pst-node,pst-bspline,pstricks-add} \usepackage{amssymb} \usepackage[parfill]{parskip} \usepackage{hyperref} @@ -35,7 +35,7 @@ The {\tt pst-Bspline} package implements this algorithm as \verb|\psBspline|, wh \noindent \verb|\psBspline(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4)| -\noindent The coordinates are the B-spline control points. Aside from the usual keywords, like {\tt linestyle}, {\tt linecolor} and {\tt arrows}, there is a Boolean keyword {\tt showframe}. The effect of {\tt showframe} is to show the intermediate points and lines in the algorithm described above. +\noindent The coordinates are the B-spline control points. Aside from the usual keywords, like {\tt linestyle}, {\tt linecolor} and {\tt arrows}, there is a Boolean keyword {\tt showframe}. The effect of {\tt showframe=true} is to show the intermediate points and lines in the algorithm described above. There is another optional argument that can be applied if you wish to be able to refer to any of the points constructed in the algorithm. By example, @@ -44,7 +44,7 @@ There is another optional argument that can be applied if you wish to be able to \noindent sets the root of the naming scheme to {\tt B}, the effect of which is that the B-spline control points will be nodes of type \verb|\pnode| with names {\tt B0}, {\tt B1} and so on, the other points being similarly named {\tt BL0}, {\tt BL1}, ... , {\tt BR0}, {\tt BR1}, ... , {\tt BS0}, {\tt BS1}, ... . For example, to draw a line between {\tt BL1} and {\tt BS4}, just use \verb|\ncline(BL1)(BS4)|. -The algorithm is implemented entirely in PSTricks code, without any PostScript programming at all, depending for the most part on the flexibility of nodes, and above all the \verb|\multido| macro, which allows one to construct with relative ease items that look and feel like arrays. Use of \verb|\SpecialCoor| is essential. +The algorithm is implemented entirely in PSTricks code with PostScript specials, but no PostScript header file, depending for the most part on the flexibility of nodes, and above all the \verb|\multido| macro, which allows one to construct with relative ease items that look and feel like arrays. Use of \verb|\SpecialCoor| is essential. There is a closely related macro \verb|\psBsplineE| which removes the first and last B\'ezier segments, much as \verb|\psecurve| acts in relation to \verb|\pscurve|, allowing one one to draw B-splines with non-zero curvature at the endpoints. @@ -56,8 +56,8 @@ There is a closely related macro \verb|\psBsplineE| which removes the first and \begin{document} \SpecialCoor % essential for pst-bspline package \psset{unit=.6in} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) -\psBspline[showframe]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\psBspline[showframe=true]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) \multido{\i=0+1}{5}{\uput[20](B\i){B\i}} \uput[90](B5){B5} \uput[90](BS1){S1} @@ -73,8 +73,8 @@ There is a closely related macro \verb|\psBsplineE| which removes the first and \vspace{1pc} \begin{center} \psset{unit=.6in} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) -\psBspline[showframe]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\psBspline[showframe=true]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) \multido{\i=0+1}{5}{\uput[20](B\i){B\i}} \uput[90](B5){B5} \uput[90](BS1){S1} @@ -94,8 +94,8 @@ There is a closely related macro \verb|\psBsplineE| which removes the first and \begin{document} \SpecialCoor % essential for pst-bspline package \psset{unit=.6in} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) -\psBsplineE[showframe]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\psBsplineE[showframe=true]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) \multido{\i=0+1}{5}{\uput[20](B\i){B\i}} \uput[90](B5){B5} \uput[90](BS1){S1} @@ -111,8 +111,8 @@ There is a closely related macro \verb|\psBsplineE| which removes the first and \vspace{1pc} \begin{center} \psset{unit=.6in} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) -\psBsplineE[showframe]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\psBsplineE[showframe=true]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) \multido{\i=0+1}{5}{\uput[20](B\i){B\i}} \uput[90](B5){B5} \uput[90](BS1){S1} @@ -146,8 +146,8 @@ The macro in this case is \verb|\psBsplineC|, where the {\tt C} stands for Close \begin{document} \SpecialCoor % essential for pst-bspline package \psset{unit=.6in} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) -\psBsplineC[showframe]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\psBsplineC[showframe=true]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) \multido{\i=0+1}{5}{\uput[20](B\i){B\i}} \uput[90](B5){B5}\uput[90](BS1){S1} \uput[90](BS2){S2}\uput[180](BS3){S3} @@ -160,8 +160,8 @@ The macro in this case is \verb|\psBsplineC|, where the {\tt C} stands for Close \vspace{1pc} \begin{center} \psset{unit=.6in} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) -\psBsplineC[showframe]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\psBsplineC[showframe=true]{B}(.5,.5)(2,0)(5,2)(6,4)(4,5)(2,4) \multido{\i=0+1}{5}{\uput[20](B\i){B\i}} \uput[90](B5){B5} \uput[90](BS1){S1} @@ -205,7 +205,7 @@ for the $B_k$. In matrix form, this becomes the tridiagonal system &1&4&1\\ &&\cdots&&1\\ &&&1&4\end{pmatrix} -\begin{pmatrix}B_1\\B_2\\B_3\\ \cdots\\ B_{n-1}\end{pmatrix}=§ +\begin{pmatrix}B_1\\B_2\\B_3\\ \cdots\\ B_{n-1}\end{pmatrix}=ß \begin{pmatrix}6S_1-S_0\\6S_2\\6S_3\\ \cdots\\6S_{n-1}-S_{n}\end{pmatrix} \] The LU decomposition of the tridiagonal matrix may be seen to take the form @@ -262,7 +262,7 @@ for the $B_k$, $1\le k\le n$. In matrix form, this becomes the system &1&4&1\\ &&\cdots&&1\\ 1&&&1&4\end{pmatrix} -\begin{pmatrix}B_1\\B_2\\B_3\\ \cdots\\ B_{n}\end{pmatrix}=§ +\begin{pmatrix}B_1\\B_2\\B_3\\ \cdots\\ B_{n}\end{pmatrix}=ß \begin{pmatrix}6S_1\\6S_2\\6S_3\\ \cdots\\6S_{n}\end{pmatrix} \] Let $(x_k,y_k)=6S_k$. We perform Gaussian elimination on the matrix @@ -336,10 +336,10 @@ The following example illustrates that there is a difference between \verb|\pscc \usepackage{pstricks} \usepackage{pst-bspline,pstricks-add} \begin{document} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) -\pnodes{P}(0,1)(2,0)(5,2)(6,4)(4,5)(2,4) -\psBsplineInterpC{P}{5} -\psBsplineNodesC*[linecolor=gray!40]{PB}{5} +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\pnodes{P}(0,1)(2,0)(5,2)(6,4)(4,5)(2,4)% +\psBsplineInterpC{P}{5}% +\psBsplineNodesC*[linecolor=gray!40]{PB}{5}% \psccurve[linecolor=red,showpoints=true](0,1)(2,0)(5,2)(6,4)(4,5)(2,4) \end{pspicture} \end{document} @@ -349,15 +349,33 @@ The following example illustrates that there is a difference between \verb|\pscc \begin{center} Slight difference between psccurve and B-spline interpolation\\ \vspace*{2pc} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) -\pnodes{P}(0,1)(2,0)(5,2)(6,4)(4,5)(2,4) -\psBsplineInterpC{P}{5} -\psBsplineNodesC*[linecolor=gray!40]{PB}{5} +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\pnodes{P}(0,1)(2,0)(5,2)(6,4)(4,5)(2,4)% +\psBsplineInterpC{P}{5}% +\psBsplineNodesC*[linecolor=gray!40]{PB}{5}% \psccurve[linecolor=red,showpoints=true](0,1)(2,0)(5,2)(6,4)(4,5)(2,4) \end{pspicture} \end{center} +A B-spline curve can in many cases provide a good function interpolation mechanism, but the result is not guaranteed to be the graph of a function. +\begin{verbatim} +\begin{center} +\begin{pspicture}[showgrid=true](-.5,-.5)(6,4) +\psdots(0,3.5)(1,.5)(3,2.5)(4,0)(5,2)(6,.5) +\psaxes(0,0)(-.5,-.5)(6,4) +\psbspline(0,3.5)(1,.5)(3,2.5)(4,0)(5,2)(6,.5) +\end{pspicture} +\end{center} +\end{verbatim} + +\begin{center} +\begin{pspicture}(-.5,-.5)(6,4) +\psdots(0,3.5)(1,.5)(3,2.5)(4,0)(5,2)(6,.5) +\psbspline(0,3.5)(1,.5)(3,2.5)(4,0)(5,2)(6,.5) +\psaxes(0,0)(-.5,-.5)(6,4) +\end{pspicture} +\end{center} +\vspace{12pt} -\newpage \begin{verbatim} \documentclass{article} \usepackage{graphicx} @@ -365,7 +383,7 @@ Slight difference between psccurve and B-spline interpolation\\ \usepackage{pst-bspline,pstricks-add} \begin{document} \psset{unit=.25in} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) \pnodes{P}(0,1)(2,0)(5,2)(6,4)(4,5)(2,4) \pnode(3,3){C} \multido{\ra=0+.05,\rb=1+.05,\i=30+1}{40}{% @@ -380,7 +398,7 @@ Slight difference between psccurve and B-spline interpolation\\ \vspace{1pc} \begin{center} \psset{unit=.25in} -\begin{pspicture}[showgrid](-.5,-.5)(6,5) +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) \pnodes{P}(0,1)(2,0)(5,2)(6,4)(4,5)(2,4) \pnode(3,3){C} \multido{\ra=0+.05,\rb=1+.05,\i=30+1}{40}{% @@ -390,4 +408,62 @@ Slight difference between psccurve and B-spline interpolation\\ ([nodesep=\ra]{C}P4)([nodesep=\ra]{C}P5)} \end{pspicture} \end{center} +\section{Thick B-spline curves} +Inspired by the package {\tt pst-thick}, we provide a similar option for curves generated as B-spline interpolations. The new macro that accomplishes this is +\begin{verbatim} +\thickBspline#1#2#3#4 +%#1=root | #2=nsegments | #3=thickness | #4=items to clip +\end{verbatim} + which expects the following data. + \begin{itemize} +\item +A node sequence. This can be constructed with a command like +\begin{verbatim} +\pnodes{S}(0,0)(5,1)(4,4)(1,3)% +\end{verbatim} +which declares nodes S0..S3, and sets the macro \verb|\Snodecount| to 3. +\item An interpolation command, such as +\begin{verbatim} +\psBsplineInterp{S}{\Snodecount}% +\end{verbatim} +which creates a framework of B-spline control points {\tt SB0..SB3}. +\item Create the interpolating curve and the B\'ezier control points for its components, with names like {\tt SBR0..SBR2,SBL1..SBL3} etc, using +\begin{verbatim} +\psBsplineNodes[linestyle=none]{SB}{\Snodecount}% +\end{verbatim} +(The {\tt [linestyle=none]} may be omitted if you want the curve to show.) +\item Create a clipping path of specified thickness around the interpolating curve and place graphics to be clipped: +\begin{verbatim} +\thickBspline[plotpoints=50,linestyle=none]{S}{3}{20pt}{\psline[linecolor=red,linestyle=solid](0,0)(6,6)}% +\end{verbatim} +(The {\tt [linestyle=none]} controls whether the clipping path is rendered, and {\tt plotpoints} controls the number of subdivisions of each B\'ezier component. Its default value is 50.) +\end{itemize} +The clipping path is drawn by default positively oriented so that objects are clipped to its interior. By specifying the keyword {\tt reverseclip}, the clipping path will be reversed so that objects are clipped to the exterior. + +\begin{verbatim} +\documentclass{article} +\usepackage{pstricks} +\usepackage{pst-bspline,pstricks-add} +\begin{document} +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\pnodes{S}(1,0)(5,1)(4,4)(1,3)% +\psdots(1,0)(5,1)(4,4)(1,3)% +\psBsplineInterp{S}{\Snodecount}% +\psBsplineNodes[linestyle=none]{SB}{\Snodecount}% +\thickBspline[plotpoints=50,linestyle=none]{S}{3}{20pt}% +{\psframe[fillstyle=crosshatch](-1,-1)(6,6)}% +\end{pspicture} +\end{document} +\end{verbatim} + +\begin{center} +\begin{pspicture}[showgrid=true](-.5,-.5)(6,5) +\pnodes{S}(1,0)(5,1)(4,4)(1,3)% +\psdots(1,0)(5,1)(4,4)(1,3)% +\psBsplineInterp{S}{\Snodecount}% +\psBsplineNodes[linestyle=none]{SB}{\Snodecount}% +\thickBspline[plotpoints=50,linestyle=none]{S}{\Snodecount}{20pt}{\psframe[fillstyle=crosshatch](-1,-1)(6,6)}% +\end{pspicture} +\end{center} + \end{document}
\ No newline at end of file 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 ded6c31d4f4..b5a0b11b139 100644 --- a/Master/texmf-dist/tex/generic/pst-bspline/pst-bspline.tex +++ b/Master/texmf-dist/tex/generic/pst-bspline/pst-bspline.tex @@ -8,8 +8,8 @@ \ifx\PSTricksLoaded\endinput \else\input pstricks.tex\fi \ifx\PSTnodeLoaded\endinput \else\input pst-node.tex\fi \ifx\PSTXKeyLoaded\endinput \else\input pst-xkey \fi -\def\fileversion{1.3} -\def\filedate{2010/09/04} +\def\fileversion{1.4} +\def\filedate{2010/10/14} \message{`pst-bspline' v\fileversion, \filedate\space Bspline routines for pstricks (ms)} % @@ -40,6 +40,8 @@ % showframe key and its default are global \define@boolkey[psset]{pst-bspline}[Pst@]{showframe}[true]{} \psset[pst-bspline]{showframe=false}% +\define@boolkey[psset]{pst-bspline}[Pst@]{reverseclip}[true]{} +\psset[pst-bspline]{reverseclip=false}% % %Bspline drawing macros \def\psBsplineNodes{\def\pst@par{}\pst@object{psBsplineNodes}}% @@ -212,16 +214,21 @@ \def\noderoot{#1}% \pnode(\noderoot 0){\noderoot B0}% \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)(\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 +\ifnum\top@mone>\m@ne% at least 3 points to interpolate + \ifnum\top@mone>\z@% we started with 4 or more points to interpolate + \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)(\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 + \else% exactly 3 points to interpolate + \nodexn{1.5(\noderoot1)-.25(\noderoot0)-.25(\noderoot2)}{\noderoot B1}% +\fi\fi% }% end def \def\psBsplineInterpC#1#2{% % #1=node name root, #2=top index, - % eg, if we want to interpolate S0,..., S100, #1=100, #2=S + % eg, if we want to interpolate S0,..., S100, #1=S, #2=100 % interpolation in this case is periodic (closed curve) \pst@killglue \newcount\top@mone \top@mone=#2\relax% @@ -269,5 +276,89 @@ ycoeff \iA\space ycoeff \iA\space get mcoeff \iA\space get ycoeff \iB\space get {\noderoot B\iA}}% \pnode(\noderoot B\the\top@ndx){\noderoot B0}% \ignorespaces}% +% +\def\thickBspline{\def\pst@par{}\pst@object{thickBspline}}% +\def\thickBspline@i#1#2#3#4{{% +% #1=root | #2=nsegments | #3=thickness | #4=items to clip + \pst@killglue% + \use@par% + %prepare array + \pssetlength{\pst@dimp}{#3}\pst@dimtonum{\pst@dimp}{\thickness}% thickness in TeX pt + \newcount\n@cnt% + \newcount\np@cnt% + \newcount\ary@max \ary@max=\psk@plotpoints \relax% + \multiply\ary@max #2\np@cnt=\ary@max \multiply\ary@max 4\relax% + \advance\ary@max 4\relax % + \n@cnt=\ary@max \advance\n@cnt \m@ne% + \multiply\np@cnt \tw@\advance\np@cnt \tw@% count of points in array + \pstVerb{ gsave tx@Dict begin % + /psxu \pst@number\psxunit\space def /psyu \pst@number\psyunit\space def % + /uratio psyu psxu div def % so that perp to a, b is -b*uratio a + /nseg #2 def /nplotpt \psk@plotpoints\space def % + /clipary #2 nplotpt mul 4 mul 4 add array def % + /lindex 2 def /uindex \the\ary@max\space 1 sub def % + /dt 1 \psk@plotpoints\space div def % +% /halfthck #3 2 div def % + end grestore }% + \multido{\iA=0+1,\iB=1+1}{#2}{% +% pass control points of this segment to PostScript variables +\pstVerb{% + gsave tx@Dict begin % + STV CP T \psGetNodeCenter{#1\iA}\space \psGetNodeCenter{#1BR\iA}\space \psGetNodeCenter{#1BL\iB}\space \psGetNodeCenter{#1\iB}\space % + /bez@1.x #1\iA.x def /bez@1.y #1\iA.y def %initial point on segment + %(START) = bez@1.x = bez@1.y = SB1.x = % + /bez@2.x #1BR\iA.x bez@1.x sub def %adjusted control points (less init pt) + /bez@2.y #1BR\iA.y bez@1.y sub def % + /bez@3.x #1BL\iB.x bez@1.x sub def % + /bez@3.y #1BL\iB.y bez@1.y sub def % + /bez@4.x #1\iB.x bez@1.x sub def % + /bez@4.y #1\iB.y bez@1.y sub def % + /bez@1x bez@2.x 3 mul def % for position--w1=3z1 + /bez@1y bez@2.y 3 mul def % + /bez@2x bez@3.x bez@2.x 2 mul sub 3 mul def %position w2=3(z2-2z1) + /bez@2y bez@3.y bez@2.y 2 mul sub 3 mul def % + /bez@2xT bez@2x 2 mul def % for tangent + /bez@2yT bez@2y 2 mul def % + /bez@3x bez@4.x bez@2.x bez@3.x sub 3 mul add def % w3=z3+3z1-3z2 + /bez@3y bez@4.y bez@2.y bez@3.y sub 3 mul add def % + /bez@3xT bez@3x 3 mul def % tangent + /bez@3yT bez@3y 3 mul def % + /Func % position + ( bez@3x t mul bez@2x add t mul bez@1x add t mul bez@1.x add psxu mul % + bez@3y t mul bez@2y add t mul bez@1y add t mul bez@1.y add psyu mul ) cvx def % +%/FuncT % tangent +% ( bez@1x t bez@2xT mul add t t bez@3xT mul mul add % +% bez@1y t bez@2yT mul add t t bez@3yT mul mul add ) cvx def +/FuncN % unit normal times delta + ( bez@2yT t bez@3yT mul add t mul bez@1y add uratio mul neg + bez@2xT t bez@3xT mul add t mul bez@1x add 2 copy Pyth dup % + 3 1 roll div 3 1 roll div \thickness\space 2 div dup 3 1 roll mul 3 1 roll mul ) cvx def % + end grestore }% +\ifnum\iA=0 \relax% + \pnode(! /t 0 def FuncN /dy exch def /dx exch def Func 2 copy % + /y0 ED /x0 ED % + clipary 0 x0 dx add put clipary 1 y0 dy add put % + clipary uindex y0 dy sub put clipary uindex 1 sub x0 dx sub put % + /uindex uindex 2 sub def ){tmp@P}% +\fi% +\multido{\i=1+1}{\psk@plotpoints}{% + %make array elements for this segment using #3 + \pnode(! /t dt \i\space mul def FuncN /dy ED /dx ED Func 2 copy /y0 ED /x0 ED % + clipary lindex x0 dx add put clipary lindex 1 add y0 dy add put % + clipary uindex y0 dy sub put clipary uindex 1 sub x0 dx sub put % + /lindex lindex 2 add def /uindex uindex 2 sub def ){tmp@P}% +}% end multido \i +}% end multido \iA +% make a clipping path in PS and pass commands #4 +\psclip{\pscustom{% + \code{ clipary aload pop moveto nseg nplotpt mul 2 mul % + 1 add { lineto } repeat closepath % + \ifPst@reverseclip\space reversepath \fi}}}% + #4 +\endpsclip% +\pstVerb{% +tx@Dict begin % +}}% +\ignorespaces}% \catcode`\@=\TheAtCode\relax \endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/pst-bspline/pst-bspline.sty b/Master/texmf-dist/tex/latex/pst-bspline/pst-bspline.sty index 58c9eca005b..6500f4dbefb 100644 --- a/Master/texmf-dist/tex/latex/pst-bspline/pst-bspline.sty +++ b/Master/texmf-dist/tex/latex/pst-bspline/pst-bspline.sty @@ -1,11 +1,5 @@ -\RequirePackage{pstricks} -\ProvidesPackage{pst-bspline}[2007/12/23 package wrapper for - pst-bspline.tex (hv)] -\input{pst-bspline.tex} -%\IfFileExists{pst-bspline.pro}{% -% \ProvidesFile{pst-bspline.pro} -% [2007/03/23 v. 0.01, PostScript prologue file (hv)] -% \@addtofilelist{pst-bspline.pro}}{}% -\ProvidesFile{pst-bspline.tex} - [\filedate\space v\fileversion\space `pst-bspline' (ms)] -\endinput +\ProvidesPackage{pst-bspline} + +\input{pst-bspline} + +\endinput
\ No newline at end of file |