summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-02-23 00:49:54 +0000
committerKarl Berry <karl@freefriends.org>2008-02-23 00:49:54 +0000
commit4fc1af1461e934c39f8f5e10d5d8788681d82223 (patch)
tree7716e8a3e8787a3d11c5ce728d21b808f786ce7d /Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex
parent6f5a4edf390b6e05291d7a4b816782b14122a205 (diff)
tikz/pgf 2.0 first attempt (22feb08)
git-svn-id: svn://tug.org/texlive/trunk@6741 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex177
1 files changed, 177 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex
new file mode 100644
index 00000000000..d07ae8ab6e5
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarydecorations.pathreplacing.code.tex
@@ -0,0 +1,177 @@
+% Copyright 2008 by Mark Wibrow
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usepgfmodule{decorations}
+
+
+%
+% Path replacing decorations
+%
+% These decorations change the path by replacing it by another path.
+% For instance, a line in the path might be replaced by small
+% ticks or unconnected curves or crosses. Applying a chopping
+% decoration to a path means that the path can no longer be used for
+% filling in the original manner.
+%
+
+
+
+%
+%
+% Kind 1: Path chopping with open subpaths
+%
+%
+
+
+% ticks decoration
+%
+% Parameters: \pgfdecorationsegmentlength, \pgfdecorationsegmentamplitude
+
+\pgfdeclaredecoration{ticks}{ticks}
+{
+ \state{ticks}[width=+\pgfdecorationsegmentlength]
+ {
+ \pgfpathmoveto{\pgfqpoint{0pt}{\pgfdecorationsegmentamplitude}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfdecorationsegmentamplitude}}
+ }
+ \state{final}
+ {
+ \pgfpathmoveto{\pgfqpoint{0pt}{\pgfdecorationsegmentamplitude}}
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfdecorationsegmentamplitude}}
+ \pgfpathmoveto{\pgfpointdecoratedpathlast}
+ }
+}
+
+
+
+% expanding waves decoration
+%
+% Parameters: \pgfdecorationsegmentangle, \pgfdecorationsegmentlength
+
+\pgfdeclaredecoration{expanding waves}{initial}
+{
+ \state{initial}[width=+\pgfdecorationsegmentlength,next state=wave]
+ {}
+
+ \state{wave}[switch if less than=+\pgfdecorationsegmentlength to last,
+ width=+\pgfdecorationsegmentlength]
+ {
+ \pgfpathmoveto{
+ \pgfpointadd
+ {\pgfqpoint{-\pgfdecoratedcompleteddistance}{0pt}}%
+ {\pgfpointpolar{\pgfdecorationsegmentangle}{+\pgfdecoratedcompleteddistance}}}%
+ \pgfpatharc{\pgfdecorationsegmentangle}{-\pgfdecorationsegmentangle}{+\pgfdecoratedcompleteddistance}%
+ }
+ \state{last}[width=+0pt,next state=final]
+ {
+ \pgfpathmoveto{
+ \pgfpointadd
+ {\pgfqpoint{-\pgfdecoratedcompleteddistance}{0pt}}%
+ {\pgfpointpolar{\pgfdecorationsegmentangle}{+\pgfdecoratedcompleteddistance}}}%
+ \pgfpatharc{\pgfdecorationsegmentangle}{-\pgfdecorationsegmentangle}{+\pgfdecoratedcompleteddistance}%
+ }
+ \state{final}
+ {
+ \pgfpathmoveto{\pgfpointdecoratedpathlast}
+ }
+}
+
+
+
+% waves decoration
+
+\pgfdeclaredecoration{waves}{wave}
+{
+ \state{wave}[width=\pgfdecorationsegmentlength]
+ {
+ \pgftransformxshift{+\pgfdecorationsegmentlength}
+ \pgfpathmoveto{
+ \pgfpointadd
+ {\pgfqpoint{-\pgfkeysvalueof{/pgf/decoration/start radius}}{0pt}}%
+ {\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}}}%
+ \pgfpatharc{\pgfdecorationsegmentangle}{-\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}%
+ }
+ \state{final}
+ {
+ \pgfpathmoveto{\pgfpointdecoratedpathlast}
+ }
+}
+
+
+
+% border decoration
+%
+% Parameters: \pgfdecorationsegmentlength, \pgfdecorationsegmentamplitude, \pgfdecorationsegmentangle
+
+\pgfdeclaredecoration{border}{tick}
+{
+ \state{tick}[switch if less than=+\pgfdecorationsegmentlength to last,
+ width=+\pgfdecorationsegmentlength]
+ {
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpointpolar{\pgfdecorationsegmentangle}{+\pgfdecorationsegmentamplitude}}
+ }
+ \state{last}[width=+\pgfdecorationsegmentamplitude,next state=final]
+ {
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpointpolar{\pgfdecorationsegmentangle}{+\pgfdecorationsegmentamplitude}}
+ }
+ \state{final}
+ {
+ \pgfpathmoveto{\pgfpointdecoratedpathlast}
+ }
+}
+
+
+
+
+
+
+% brace decorations
+%
+% Parameters: \pgfdecorationsegmentamplitude
+
+\pgfdeclaredecoration{brace}{brace}
+{
+ \state{brace}[width=+\pgfdecoratedremainingdistance,next state=final]
+ {
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathcurveto
+ {\pgfqpoint{.15\pgfdecorationsegmentamplitude}{.3\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ {
+ \pgftransformxshift{+\pgfdecorationsegmentaspect\pgfdecoratedremainingdistance}
+ \pgfpathlineto{\pgfqpoint{-\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ \pgfpathcurveto
+ {\pgfqpoint{-.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{-.15\pgfdecorationsegmentamplitude}{.7\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{0\pgfdecorationsegmentamplitude}{1\pgfdecorationsegmentamplitude}}
+ \pgfpathcurveto
+ {\pgfqpoint{.15\pgfdecorationsegmentamplitude}{.7\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ }
+ {
+ \pgftransformxshift{+\pgfdecoratedremainingdistance}
+ \pgfpathlineto{\pgfqpoint{-\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ \pgfpathcurveto
+ {\pgfqpoint{-.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{-.15\pgfdecorationsegmentamplitude}{.3\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{0pt}{0pt}}
+ }
+ }
+ \state{final}
+ {}
+}
+
+
+
+
+\endinput \ No newline at end of file