summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pst-bspline/pst-bspline-doc.tex83
1 files changed, 81 insertions, 2 deletions
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 235522f7950..7df9fbf84e8 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
@@ -18,7 +18,7 @@
%\def\url@ttstyle{%
% \@ifundefined{selectfont}{\def\UrlFont{\tt}}{\def\UrlFont{\ttfamily\small}}}
\usepackage{hyperref}
-\hyphenation{Post-Script}
+\hyphenation{Post-Script de-fines}
%\date{} % Activate to display a given date or no date
\begin{document}
\begin{center}{\Large Cubic B-splines Using PSTricks\\[12pt]
@@ -49,8 +49,12 @@ I'll focus on two special cases: (i) relaxed, uniform B-splines; (ii) periodic,
\item[\cs{bspFnNode\{P\}\{5\}\{2.3\}\{Q\}}] requires that you first run \cs{bspcurvepoints}{\tt[E]} to create PostScript arrays with basename {\tt P}. It then sets a node {\tt Q} at position $x=1.3$ on the curve. (Nothing is drawn.) The result is meaningful only for a B-spline curve that is the graph of a function of $x$ and where $x_0<x_1<\cdots$.
\item[\cs{psBsplineInterp\{S\}\{4\}}] will construct a sequence {\tt SB0}..{\tt SB4} for which the associated B-spline curve interpolates {\tt S0}..{\tt S4}. (Nothing is drawn---you have to then issue the command \cs{psBsplineNodes\{SB\}\{4\}}.)
\item[\cs{psBsplineInterpC\{S\}\{4\}}] will construct a sequence {\tt SB0}..{\tt SB5} for which the associated closed B-spline curve interpolates {\tt S0}..{\tt S4}. (Nothing is drawn --- you have then to issue the command \cs{psBsplineNodesC\{SB\}\{5\}}.)
-\item[\cs{thickBspline\{B\}\{5\}\{12pt\}\{<graphic to clip>\}}] defines a clipping path 12{\tt pt} wide around the B-spline curve with control points {\tt B0}..{\tt B5}, then draws the {\tt <graphic>} clipped to that path.
\item[\cs{bspcurvenodes\{P\}\{Q\}}] creates a node sequence {\tt Q0} {\tt Q1},... from the position data in the arrays {\tt P.X}, {\tt P.Y} created a \cs{bspcurvepoints} macro.
+\item[\cs{thickBspline\{B\}\{5\}\{12pt\}\{<graphic to clip>\}}] defines a clipping path 12{\tt pt} wide around the B-spline curve with control points {\tt B0}..{\tt B5}, then draws the {\tt <graphic>} clipped to that path.
+\item[\cs{thickBEspline\{S\}\{5\}\{30pt\}\{18pt\}\{-70\}\{<graphic>\}}] defines a clipping path of width from {\tt18pt} to {\tt 30pt} and axis angle -70 degrees, then draws the {\tt <graphic>} clipped to that path. The clipping path is widest where the path is parallel to the axis angle. This macro is best called from the following auxiliary macro, because the data must be prepared in a specific order---see the example provided.
+\item[\cs{thickBdraw\{S\}\{30pt\}\{18pt\}\{-70\}\{<graphic>\}}] prepares and runs the macro \verb|thickBEspline| using all points in the node sequence {\tt S}, apassing all parameters to that macro.
+\item[\cs{thickBsplinePen\{S\}\{5\}\{.7cm\}\{.2cm\}\{-45\}\{<graphic>\}}] defines a clipping path following the outline of an elliptical pen drawn along the curve interpolating the points {\tt S0..S5}. The ellipse has $a=.7$cm, $b=.2$cm and and is rotated through -70 degrees. The macro then draws the {\tt <graphic>} clipped to that path. The underlying curve has relaxed endpoints.
+\item[\cs{thickBsplinePenE\{S\}\{5\}\{.7cm\}\{.2cm\}\{-45\}\{<graphic>\}}] defines a clipping path following the outline of an elliptical pen drawn along the curve interpolating the points {\tt S0..S5}. The ellipse has $a=.7$cm, $b=.2$cm and and is rotated through -70 degrees. The macro then draws the {\tt <graphic>} clipped to that path. The underlying curve omits the intial and final segments, and is not limited to relaxed endpoints.
\end{description}
Details and examples are provided below.
@@ -668,4 +672,79 @@ The \verb|\thickBspline| macro works as expected in the closed (periodic) case,
\end{pspicture}
\end{center}
+\vspace{12pt}
+
+There are three variants of the \verb|\thickBspline| macro. The first is
+\begin{verbatim}
+\thickBEspline#1#2#3#4#5#6
+% #1=root | #2=nsegments | #3=maxthickness |
+% #4=minthickness | #5=axis angle | #6=items to clip
+\end{verbatim}
+works just like \verb|\thickBspline|, but instead of providing a thickness, you provide three parameters specifying maxthickness, minthickness and an axis angle.
+An axis angle of -45 means that lines normal to angle -45 will be minthickness and lines normal to 45 will be maxthickness. You may get unexpected results if your initial curve is too curvy. This macro is best called from \verb|\thickBdraw|, as shown in the following example.
+\begin{verbatim}
+\psset{yunit=.7cm}
+\begin{pspicture}[showgrid=false](-1,-1)(6,7)
+\psgrid%
+\pnodes{S}(0,1)(0,5)(3,5)(4,2)(5,0)%
+\thickBdraw{S}{30pt}{16pt}{-70}{\psframe[fillstyle=solid,fillcolor=yellow](-1,-1)(6,7)}%
+\end{pspicture}
+\end{verbatim}
+
+\begin{center}
+\psset{yunit=.7cm}
+\begin{pspicture}[showgrid=false](-1,-1)(6,7)
+\psgrid%
+\pnodes{S}(0,1)(0,5)(3,5)(4,2)(5,0)%
+\thickBdraw{S}{30pt}{16pt}{-70}{\psframe[fillstyle=solid,fillcolor=yellow](-1,-1)(6,7)}%
+\end{pspicture}
+\psset{yunit=1cm}
+\end{center}
+
+A second variant \verb|\thickBsplinePen| simulates the effect of an elliptical pen run along the specified curve. Note that you will receive an error message if xunit differs from yunit---the calculations in the general case are quite nasty. The macro is called with something like
+\begin{verbatim}
+\thickBsplinePen{S}{\Snodecount}{2cm}{.5cm}{10}{%
+\psframe[fillstyle=crosshatch](-1,-1)(7,6)}%
+\end{verbatim}
+where {\tt S0..} is an established node sequence with highest index \verb|\Snodecount| and the pen has semi-major axis {\tt 2cm}, semi-minor axis {\tt.5cm}, and the major axis is rotated 10 degrees from the positive x axis. This gives results that look like those generated in \textsf{metafont/post} except that the curve ends are not drawn by the pen---if you want them, draw them separately using \verb|\psellipse|. Note that the underlying curve has relaxed ends.
+
+\begin{verbatim}
+\begin{pspicture}[showgrid=false](-1,-1)(7,7)
+\psgrid%
+\pnodes{S}(1,0)(4,1)(5,2)(3,3)(1,5)(5,6)%
+\thickBsplinePen[linecolor=green]{S}{\Snodecount}{.7cm}{.1cm}{-45}{\psframe[fillstyle=solid,fillcolor=green](-1,-1)(7,7)}%
+\psBsplineNodes[linestyle=solid]{SB}{\Snodecount}%
+\end{pspicture}
+\end{verbatim}
+
+\vspace{12pt}
+
+\begin{center}
+\begin{pspicture}[showgrid=false](-1,-1)(7,7)
+\psgrid%
+\pnodes{S}(1,0)(4,1)(5,2)(3,3)(1,5)(5,6)%
+\thickBsplinePen[linecolor=green]{S}{\Snodecount}{.7cm}{.1cm}{-45}{\psframe[fillstyle=solid,fillcolor=green](-1,-1)(7,7)}%
+\psBsplineNodes[linestyle=solid]{SB}{\Snodecount}%
+\end{pspicture}
+\end{center}
+
+A third variant \verb|\thickBsplinePenE| is quite similar but omits the first and last segments of the underlying curve, permitting the endpoints to not be relaxed.
+
+\begin{verbatim}
+\begin{pspicture}[showgrid=false](-1,-1)(7,7)
+\psgrid%
+\pnodes{S}(0,4)(1,0)(4,.5)(5,2)(3,3)(1,5)(5,6)(5,3)%
+\thickBsplinePenE[linecolor=green]{S}{\Snodecount}{.7cm}{.1cm}{30}{\psframe[fillstyle=solid,fillcolor=green](-1,-1)(7,7)}%
+\psBsplineNodesE[linestyle=solid]{SB}{\Snodecount}%
+\end{pspicture}
+\end{verbatim}
+
+\begin{center}
+\begin{pspicture}[showgrid=false](-1,-1)(7,7)
+\psgrid%
+\pnodes{S}(0,4)(1,0)(4,.5)(5,2)(3,3)(1,5)(5,6)(5,3)%
+\thickBsplinePenE[linecolor=green]{S}{\Snodecount}{.7cm}{.1cm}{30}{\psframe[fillstyle=solid,fillcolor=green](-1,-1)(7,7)}%
+\psBsplineNodesE[linestyle=solid]{SB}{\Snodecount}%
+\end{pspicture}
+\end{center}
\end{document} \ No newline at end of file