diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex b/Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex index 37d6a70a6ed..8653c635ea2 100644 --- a/Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex +++ b/Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex @@ -8,7 +8,7 @@ %% ---------------------------------------------------------------- %% hobby --- a TikZ/PGF library for drawing smooth(ish) curves using %% Hobby's algorithm (implemented in LaTeX3) -%% E-mail: stacey@math.ntnu.no +%% E-mail: loopspace@mathforge.org %% Released under the LaTeX Project Public License v1.3c or later %% See http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- @@ -43,6 +43,40 @@ \def\hobby@close#1{% \pgfpathclose } +\def\pgfpathhobby{% + \pgfutil@ifnextchar\bgroup{\pgfpath@hobby}{\pgfpath@hobby{}}} +\def\pgfpath@hobby#1{% + \hobbyinit\hobby@moveto\hobby@curveto\hobby@close + \hobbysetparams{#1}% + \pgfmathsetmacro\hobby@x{\the\pgf@path@lastx/1cm}% + \pgfmathsetmacro\hobby@y{\the\pgf@path@lasty/1cm}% + \hobbyaddpoint{x = \hobby@x, y = \hobby@y}% +} +\def\pgfpathhobbypt#1{% + #1% + \pgfmathsetmacro\hobby@x{\the\pgf@x/1cm}% + \pgfmathsetmacro\hobby@y{\the\pgf@y/1cm}% + \pgfutil@ifnextchar\bgroup{\pgfpathhobbyptparams}{\pgfpathhobbyptparams{}}% +} +\def\pgfpathhobbyptparams#1{% + \hobbyaddpoint{#1,x = \hobby@x, y = \hobby@y}% +} +\def\pgfpathhobbyend{% + \ifhobby@externalise + \ifx\hobby@path@name\pgfutil@empty + \hobbygenusepath + \else + \hobbygenuseifnecpath{\hobby@path@name}% + \fi + \else + \hobbygenusepath + \fi + \ifx\hobby@path@name\pgfutil@empty + \else + \hobbysavepath{\hobby@path@name}% + \fi + \global\let\hobby@path@name=\pgfutil@empty +} \def\pgfplothandlerhobby{% \def\pgf@plotstreamstart{% \hobbyinit\hobby@moveto\hobby@curveto\hobby@close @@ -221,7 +255,7 @@ #4% } %% -%% Copyright (C) 2012 by Andrew Stacey <stacey@math.ntnu.no> +%% Copyright (C) 2012 by Andrew Stacey <loopspace@mathforge.org> %% %% This file may be distributed and/or modified under the conditions %% of the LaTeX Project Public License, either version 1.3 of this |