%%
%% This is file `tikzlibraryhobby.code.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% hobby_code.dtx  (with options: `tikzlibrary')
%% ----------------------------------------------------------------
%% hobby --- a TikZ/PGF library for drawing smooth(ish) curves using
%%           Hobby's algorithm (implemented in LaTeX3)
%% E-mail: loopspace@mathforge.org
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%% 
\usepgflibrary{hobby}
\let\hobby@this@opts=\pgfutil@empty
\let\hobby@next@opts=\pgfutil@empty
\let\hobby@action=\pgfutil@empty
\let\hobby@path@name=\pgfutil@empty
\newif\ifhobby@externalise
\def\hobby@point@options{}%
\tikzset{
  curve through/.style={
    to path={
      \pgfextra{
        \expandafter\curvethrough\expandafter[\hobby@next@opts]{%
          (\tikztostart) .. #1 .. (\tikztotarget)%
        }
      }
    }
  },
  tension in/.code = {%
    \expandafter\gdef\expandafter\hobby@point@options\expandafter%
    {\hobby@point@options,tension in=#1}%
  },
  tension out/.code = {%
    \expandafter\gdef\expandafter\hobby@point@options\expandafter%
    {\hobby@point@options,tension out=#1}%
  },
  tension/.append code = {%
    \expandafter\gdef\expandafter\hobby@point@options\expandafter%
    {\hobby@point@options,tension=#1}%
  },
  excess angle/.code = {%
    \expandafter\gdef\expandafter\hobby@point@options\expandafter%
    {\hobby@point@options,excess angle=#1}%
  },
  break/.code = {%
    \expandafter\gdef\expandafter\hobby@point@options\expandafter%
    {\hobby@point@options,break=#1}%
  },
  blank/.code = {%
    \expandafter\gdef\expandafter\hobby@point@options\expandafter%
    {\hobby@point@options,blank=#1}%
  },
  designated Hobby path/.initial={next},
  clear next Hobby path options/.code={%
    \gdef\hobby@next@opts{}%
  },
  clear this Hobby path options/.code={%
    \gdef\hobby@this@opts{}%
  },
  clear Hobby path options/.style={%
    clear \pgfkeysvalueof{/tikz/designated Hobby path} Hobby path options
  },
  add option to this Hobby path/.code={%
    \expandafter\gdef\expandafter\hobby@this@opts\expandafter{\hobby@this@opts#1,}%
  },
  add option to next Hobby path/.code={%
    \expandafter\gdef\expandafter\hobby@next@opts\expandafter{\hobby@next@opts#1,}%
  },
  add option to Hobby path/.style={%
    add option to \pgfkeysvalueof{/tikz/designated Hobby path} Hobby path={#1}%
  },
  closed/.style = {%
    add option to Hobby path={closed=#1,disjoint=#1}%
  },
  invert blank/.style = {%
    add option to Hobby path={invert blank=#1}%
  },
  closed/.default = true,
  blank/.default = true,
  break/.default = true,
  invert blank/.default = true,
  in angle/.code = {%
    \pgfmathparse{(#1)*pi/180}%
    \edef\@temp{in angle=\pgfmathresult,}%
    \pgfkeysalso{add option to Hobby path/.expand once=\@temp}%
  },
  out angle/.code = {%
    \pgfmathparse{(#1)*pi/180}%
    \edef\@temp{out angle=\pgfmathresult,}%
    \pgfkeysalso{add option to Hobby path/.expand once=\@temp}%
  },
  in curl/.style = {%
    add option to Hobby path={in curl=#1}%
  },
  out curl/.style = {%
    add option to Hobby path={out curl=#1}%
  },
  use Hobby shortcut/.code={%
    \let\tikz@curveto@auto=\hobby@curveto@override
    \global\let\hobby@curveto@delegate=\hobby@curveto@auto
  },
  use quick Hobby shortcut/.code={%
    \let\tikz@curveto@auto=\hobby@curveto@override
    \global\let\hobby@curveto@delegate=\hobby@qcurveto@auto
  },
  use previous Hobby path/.code={%
    \hobbyusepath{#1}%
  },
  use previous Hobby path/.default={},%
  save Hobby path/.code={%
    \xdef\hobby@path@name{#1}%
  },
  restore Hobby path/.code={%
    \hobbyinit\hobby@tikz@moveto\hobby@tikz@curveto\hobby@tikz@close
    \global\let\hobby@collected@onpath\pgfutil@empty
    \hobbyrestorepath{#1}%
  },
  restore and use Hobby path/.code 2 args={%
    \hobbyinit\hobby@tikz@moveto\hobby@tikz@curveto\hobby@tikz@close
    \global\let\hobby@collected@onpath\pgfutil@empty
    \hobbyrestorepath{#1}%
    \hobbyusepath{#2}%
  },
  show Hobby path/.code={%
    \hobbyshowpath{#1}%
  },
  Hobby action/.code={%
    \expandafter\gdef\expandafter\hobby@action\expandafter{\hobby@action#1}%
  },
  Hobby finish/.style={%
    Hobby action=\hobby@finish%
  },
  Hobby externalise/.is if=hobby@externalise,
  Hobby externalize/.is if=hobby@externalise
}
\def\hobby@tikz@curveto#1#2#3{%
  \pgfutil@ifundefined{tikz@timer@start}{%
    \expandafter\hobby@topgf\expandafter{\hobby@initial@pt}%
    \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  }{}%
  \hobby@topgf{#1}%
  \edef\tikz@timer@cont@one{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  \hobby@topgf{#2}%
  \edef\tikz@timer@cont@two{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  \hobby@topgf{#3}%
  \let\tikz@timer=\tikz@timer@curve
  \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  \ifx\hobby@collected@onpath\pgfutil@empty
  \else
  \expandafter\hobby@nodes@onpath\hobby@collected@onpath\relax\relax
  \fi
  \pgfpathcurveto{\hobby@topgf{#1}}{\hobby@topgf{#2}}{\hobby@topgf{#3}}%
  \hobby@topgf{#3}%
  \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
}
\def\hobby@tikz@moveto#1#2#3{%
  \pgfutil@ifundefined{tikz@timer@start}{%
    \expandafter\hobby@topgf\expandafter{\hobby@initial@pt}%
    \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  }{}%
  \hobby@topgf{#3}%
  \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  \def\pgf@temp{#1}%
  \ifx\pgf@temp\pgfutil@empty
    \let\tikz@timer=\tikz@timer@line
  \expandafter\def\expandafter\hobby@collected@onpath\expandafter{\expandafter{\expandafter}\hobby@collected@onpath}
  \else
    \hobby@topgf{#1}%
    \edef\tikz@timer@cont@one{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
    \hobby@topgf{#2}%
    \edef\tikz@timer@cont@two{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
    \let\tikz@timer=\tikz@timer@curve
  \fi
  \ifx\hobby@collected@onpath\pgfutil@empty
  \else
  \expandafter\hobby@nodes@onpath\hobby@collected@onpath\relax\relax
  \fi
  \pgfpathmoveto{\hobby@topgf{#3}}%
  \hobby@topgf{#3}%
  \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
}
\def\hobby@tikz@close#1{%
  \hobby@topgf{#1}%
  \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  \let\tikz@timer=\tikz@timer@line
  \ifx\hobby@collected@onpath\pgfutil@empty
  \else
  \expandafter\hobby@nodes@onpath\hobby@collected@onpath\relax\relax
  \fi
  \pgfpathclose
}
\def\hobby@nodes@onpath#1#2\relax{%
  \gdef\hobby@collected@onpath{#2}%
  \def\pgf@temp{#1}%
  \ifx\pgf@temp\pgfutil@empty
  \else
  \def\@gtempa{\relax}
  \ifx\pgf@temp\@gtempa
  \else
  \tikz@node@is@a@labeltrue
  \tikz@scan@next@command#1\pgf@stop
  \tikz@node@is@a@labelfalse
  \fi
  \fi
}
\newcommand\curvethrough[2][]{%
  \hobbyinit\hobby@tikz@moveto\hobby@tikz@curveto\hobby@tikz@close
  \global\let\hobby@collected@onpath\pgfutil@empty
  \let\hobby@initial@pt\pgfutil@empty
  \hobbysetparams{#1}%
  \tikzset{designated Hobby path=this}%
  \global\let\hobby@this@opts=\pgfutil@empty
  \global\let\hobby@next@opts=\pgfutil@empty
  \let\tikz@scan@point@options=\pgfutil@empty
  \def\hobby@point@options{}%
  \tikz@scan@one@point\hobby@processpt #2 \relax%
}
\newcommand\hobby@processpt[1]{%
  #1%
  \pgfmathsetmacro\hobby@x{\the\pgf@x/1cm}%
  \pgfmathsetmacro\hobby@y{\the\pgf@y/1cm}%
  \ifx\hobby@initial@pt\pgfutil@empty
    \xdef\hobby@initial@pt{\hobby@x, \hobby@y}%
  \fi
  \expandafter\hobbyaddpoint\expandafter{\hobby@point@options,%
    point={\hobby@x, \hobby@y}}%
  \def\hobby@point@options{}%
  \let\tikz@scan@point@options=\pgfutil@empty
  \pgfutil@ifnextchar\relax{%
    \expandafter\hobbysetparams\expandafter{\hobby@this@opts}%
  \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
  }{%
    \pgfutil@ifnextchar.{%
      \hobby@swallowdots}{%
      \tikz@scan@one@point\hobby@processpt}}}
\def\hobby@swallowdots.{%
  \pgfutil@ifnextchar.{%
    \hobby@swallowdots}{%
    \tikz@scan@one@point\hobby@processpt}}
\def\hobby@curveto@override{%
  \hobby@curveto@delegate}
\def\hobby@curveto@auto{%
  \hobbyinit\hobby@tikz@moveto\hobby@tikz@curveto\hobby@tikz@close
  \expandafter\gdef\expandafter\hobby@collected@onpath\expandafter{\expandafter{\tikz@collected@onpath}   }%
  \let\tikz@collected@onpath=\pgfutil@empty
  \pgfmathsetmacro\hobby@x{\the\tikz@lastx/1cm}%
  \pgfmathsetmacro\hobby@y{\the\tikz@lasty/1cm}%
  \xdef\hobby@initial@pt{\hobby@x, \hobby@y}%
  \expandafter\hobbysetparams\expandafter{\hobby@next@opts}%
  \expandafter\hobbyaddpoint\expandafter{\hobby@point@options,%
      point={\hobby@x, \hobby@y} }%
  \hobby@init@tikz@commands
  \tikzset{designated Hobby path=this}%
  \let\tikz@scan@point@options=\pgfutil@empty
  \global\let\hobby@action=\pgfutil@empty
  \global\let\hobby@this@opts=\pgfutil@empty
  \global\let\hobby@next@opts=\pgfutil@empty
  \global\let\hobby@point@options=\pgfutil@empty
  \tikz@scan@one@point\hobby@addfromtikz%
}
\def\hobby@addfromtikz#1{%
  #1%
  \tikz@make@last@position{#1}%
  \pgfmathsetmacro\hobby@x{\the\pgf@x/1cm}%
  \pgfmathsetmacro\hobby@y{\the\pgf@y/1cm}%
  \expandafter\hobbysetparams\expandafter{\hobby@this@opts}%
  \expandafter\hobbyaddpoint\expandafter{\hobby@point@options,%
    point={\hobby@x, \hobby@y}}%
  \hobby@action
  \global\let\hobby@this@opts=\pgfutil@empty
  \global\let\hobby@action=\pgfutil@empty
  \global\let\hobby@point@options=\pgfutil@empty
  \tikz@scan@next@command%
}
\def\hobby@init@tikz@commands{%
  \hobby@init@tikz@modcmd\tikz@movetoabs
  \hobby@init@tikz@modcmd\tikz@movetorel
  \hobby@init@tikz@modcmd\tikz@lineto
  \hobby@init@tikz@modcmd\tikz@rect
  \hobby@init@tikz@modcmd\tikz@cchar
  \hobby@init@tikz@modcmd\tikz@finish
  \hobby@init@tikz@modcmd\tikz@arcA
  \hobby@init@tikz@modcmd\tikz@e@char
  \hobby@init@tikz@modcmd\tikz@g@char
  \hobby@init@tikz@modcmd\tikz@schar
  \hobby@init@tikz@modcmd\tikz@vh@lineto
  \hobby@init@tikz@modcmd\tikz@pchar
  \hobby@init@tikz@modcmd\tikz@to
  \hobby@init@tikz@modcmd\pgf@stop
  \hobby@init@tikz@modcmd\tikz@decoration
  \global\let\hobby@curveto@delegate=\hobby@midcurveto@auto
}
\def\hobby@restore@tikz@commands{%
  \hobby@restore@tikz@modcmd\tikz@movetoabs
  \hobby@restore@tikz@modcmd\tikz@movetorel
  \hobby@restore@tikz@modcmd\tikz@lineto
  \hobby@restore@tikz@modcmd\tikz@rect
  \hobby@restore@tikz@modcmd\tikz@cchar
  \hobby@restore@tikz@modcmd\tikz@finish
  \hobby@restore@tikz@modcmd\tikz@arcA
  \hobby@restore@tikz@modcmd\tikz@e@char
  \hobby@restore@tikz@modcmd\tikz@g@char
  \hobby@restore@tikz@modcmd\tikz@schar
  \hobby@restore@tikz@modcmd\tikz@vh@lineto
  \hobby@restore@tikz@modcmd\tikz@pchar
  \hobby@restore@tikz@modcmd\tikz@to
  \hobby@restore@tikz@modcmd\pgf@stop
  \hobby@restore@tikz@modcmd\tikz@decoration
  \global\let\hobby@curveto@delegate=\hobby@curveto@auto
}
\def\hobby@init@tikz@modcmd#1{%
    \expandafter\global\expandafter\let\csname hobby@orig@\string#1\endcsname=#1%
    \gdef#1{\hobby@finish#1}%
}
\def\hobby@restore@tikz@modcmd#1{%
    \expandafter\global\expandafter\let\expandafter#1\csname hobby@orig@\string#1\endcsname%
}
\def\hobby@midcurveto@auto{%
  \expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter\hobby@collected@onpath\expandafter\expandafter\expandafter{\expandafter\hobby@collected@onpath\expandafter{\tikz@collected@onpath}   }%
  \let\tikz@collected@onpath=\pgfutil@empty
  \let\tikz@scan@point@options=\pgfutil@empty
  \global\let\hobby@action=\pgfutil@empty
  \global\let\hobby@this@opts=\pgfutil@empty
  \global\let\hobby@point@options=\pgfutil@empty
  \tikz@scan@one@point\hobby@addfromtikz%
}
\def\hobby@finish{%
  \hobby@restore@tikz@commands
  \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
  \tikzset{designated Hobby path=next}%
}
\tikzset{
  quick curve through/.style={%
    to path={%
      \pgfextra{%
        \let\hobby@next@qbreak=\relax
        \let\hobby@next@qblank=\relax
      \tikz@scan@one@point\pgfutil@firstofone(\tikztostart)%
        \tikz@make@last@position{\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
        \edef\hobby@qpoints{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
        \def\hobby@qpointa{}%
        \def\hobby@quick@path{}%
        \def\hobby@angle{}%
        \let\hobby@quick@curveto=\hobby@quick@makepath
        \tikz@scan@one@point\hobby@quickfirst #1 (\tikztotarget)\relax
      }
      \hobby@quick@path
    }
  },
  quick hobby/blank curve/.is choice,
  quick hobby/blank curve/true/.code={%
    \gdef\hobby@next@qblank{%
      \qhobby@blanktrue
      \global\let\hobby@next@qblank=\relax
    }%
  },
  quick hobby/blank curve/false/.code={%
    \gdef\hobby@next@qblank{%
      \qhobby@blankfalse
      \global\let\hobby@next@qblank=\relax
    }%
  },
  quick hobby/blank curve/once/.code={%
    \gdef\hobby@next@qblank{%
      \qhobby@blanktrue
      \gdef\hobby@next@qblank{%
        \qhobby@blankfalse
        \global\let\hobby@next@qblank=\relax
      }%
    }%
  },
  quick hobby/blank curve/.default=true,
  quick hobby/break curve/.is choice,
  quick hobby/break curve/true/.code={%
    \gdef\hobby@next@qbreak{%
      \qhobby@breaktrue
      \global\let\hobby@next@qbreak=\relax
    }%
  },
  quick hobby/break curve/false/.code={%
    \gdef\hobby@next@qbreak{%
      \qhobby@breakfalse
      \global\let\hobby@next@qbreak=\relax
    }%
  },
  quick hobby/break curve/once/.code={%
    \gdef\hobby@next@qbreak{%
      \qhobby@breaktrue
      \gdef\hobby@next@qbreak{%
        \qhobby@breakfalse
        \global\let\hobby@next@qbreak=\relax
      }%
    }%
  },
  quick hobby/break curve/.default=true,
}
\newif\ifqhobby@break
\newif\ifqhobby@blank
\tikzoption{hobby}[]{\let\tikz@plot@handler=\pgfplothandlerhobby}
\tikzoption{quick hobby}[]{\let\tikz@plot@handler=\pgfplothandlerquickhobby}
\tikzoption{closed hobby}[]{\let\tikz@plot@handler=\pgfplothandlerclosedhobby}
\def\hobby@quickfirst#1{%
  #1%
  \xdef\hobby@qpointa{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  \tikz@make@last@position{\hobby@qpointa}%
  \pgfutil@ifnextchar\relax{%
    \xdef\hobby@quick@path{ -- (\the\pgf@x,\the\pgf@y)}%
  }{%
    \pgfutil@ifnextchar.{%
      \hobby@qswallowdots}{%
    \tikz@scan@one@point\hobby@quick}}}
\def\hobby@qswallowdots.{%
  \pgfutil@ifnextchar.{%
    \hobby@qswallowdots}{%
    \tikz@scan@one@point\hobby@quick}}
\def\hobby@quick#1{%
  \hobby@quick@compute{#1}%
  \tikz@make@last@position{\hobby@qpointa}%
  \pgfutil@ifnextchar\relax{%
    \hobby@quick@computeend%
  }{%
    \pgfutil@ifnextchar.{%
      \hobby@qswallowdots}{%
      \tikz@scan@one@point\hobby@quick}}}
\def\hobby@quick@makepath#1#2#3{%
  #1%
  \pgf@xa=\pgf@x\relax
  \pgf@ya=\pgf@y\relax
  #2%
  \pgf@xb=\pgf@x\relax
  \pgf@yb=\pgf@y\relax
  #3%
  \ifqhobby@blank
  \xdef\hobby@quick@path{\hobby@quick@path (\the\pgf@x,\the\pgf@y)}%
  \else
  \xdef\hobby@quick@path{\hobby@quick@path .. controls%
  (\the\pgf@xa,\the\pgf@ya) and (\the\pgf@xb,\the\pgf@yb) .. (\the\pgf@x,\the\pgf@y) }%
  \fi
  \ifqhobby@break
  \xdef\hobby@quick@path{\hobby@quick@path +(0,0)}%
  \fi
  \hobby@next@qbreak
  \hobby@next@qblank
}
\def\hobby@qcurveto@auto{%
  \global\let\hobby@next@qbreak=\relax
  \global\let\hobby@next@qblank=\relax
  \xdef\hobby@qpoints{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
  \gdef\hobby@qpointa{}%
  \gdef\hobby@quick@path{}%
  \gdef\hobby@angle{}%
  \global\let\hobby@quick@curveto=\hobby@quick@makepathauto
  \hobby@qinit@tikz@commands
  \let\tikz@scan@point@options=\pgfutil@empty
  \global\let\hobby@action=\pgfutil@empty
  \global\let\hobby@point@options=\pgfutil@empty
  \tikz@scan@one@point\hobby@qfirst@auto}
\def\hobby@qmidcurveto@auto{%
  \let\tikz@scan@point@options=\pgfutil@empty
  \global\let\hobby@action=\pgfutil@empty
  \global\let\hobby@point@options=\pgfutil@empty
  \tikz@scan@one@point\hobby@qaddfromtikz}
\def\hobby@qfirst@auto#1{%
  #1%
  \xdef\hobby@qpointa{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  \tikz@make@last@position{\hobby@qpointa}%
  \tikz@scan@next@command%
}
\def\hobby@quick@makepathauto#1#2#3{%
  #1%
  \pgf@xa=\pgf@x\relax
  \pgf@ya=\pgf@y\relax
  #2%
  \pgf@xb=\pgf@x\relax
  \pgf@yb=\pgf@y\relax
  #3%
  \ifqhobby@blank
  \edef\hobby@temp{%
    \noexpand\pgfpathmoveto{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  }%
  \hobby@temp
  \else
  \edef\hobby@temp{%
    \noexpand\pgfpathcurveto{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
    {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}%
    {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  }%
  \hobby@temp
  \fi
  \ifqhobby@break
  #3%
  \edef\hobby@temp{%
    \noexpand\pgfpathmoveto{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
  }%
  \hobby@temp
  \fi
  \hobby@next@qbreak
  \hobby@next@qblank
}
\def\hobby@qaddfromtikz#1{%
  \hobby@quick@compute{#1}%
  \tikz@make@last@position{\hobby@qpointa}%
  \tikz@scan@next@command%
}
\def\hobby@qinit@tikz@commands{%
  \hobby@qinit@tikz@modcmd\tikz@movetoabs
  \hobby@qinit@tikz@modcmd\tikz@movetorel
  \hobby@qinit@tikz@modcmd\tikz@lineto
  \hobby@qinit@tikz@modcmd\tikz@rect
  \hobby@qinit@tikz@modcmd\tikz@cchar
  \hobby@qinit@tikz@modcmd\tikz@finish
  \hobby@qinit@tikz@modcmd\tikz@arcA
  \hobby@qinit@tikz@modcmd\tikz@e@char
  \hobby@qinit@tikz@modcmd\tikz@g@char
  \hobby@qinit@tikz@modcmd\tikz@schar
  \hobby@qinit@tikz@modcmd\tikz@vh@lineto
  \hobby@qinit@tikz@modcmd\tikz@pchar
  \hobby@qinit@tikz@modcmd\tikz@to
  \hobby@qinit@tikz@modcmd\pgf@stop
  \hobby@qinit@tikz@modcmd\tikz@decoration
  \hobby@qinit@tikz@modcmd\tikz@@close
  \global\let\hobby@curveto@delegate=\hobby@qmidcurveto@auto
}
\def\hobby@qrestore@tikz@commands{%
  \hobby@restore@tikz@modcmd\tikz@movetoabs
  \hobby@restore@tikz@modcmd\tikz@movetorel
  \hobby@restore@tikz@modcmd\tikz@lineto
  \hobby@restore@tikz@modcmd\tikz@rect
  \hobby@restore@tikz@modcmd\tikz@cchar
  \hobby@restore@tikz@modcmd\tikz@finish
  \hobby@restore@tikz@modcmd\tikz@arcA
  \hobby@restore@tikz@modcmd\tikz@e@char
  \hobby@restore@tikz@modcmd\tikz@g@char
  \hobby@restore@tikz@modcmd\tikz@schar
  \hobby@restore@tikz@modcmd\tikz@vh@lineto
  \hobby@restore@tikz@modcmd\tikz@pchar
  \hobby@restore@tikz@modcmd\tikz@to
  \hobby@restore@tikz@modcmd\pgf@stop
  \hobby@restore@tikz@modcmd\tikz@decoration
  \hobby@restore@tikz@modcmd\tikz@@close
  \global\let\hobby@curveto@delegate=\hobby@qcurveto@auto
}
\def\hobby@qinit@tikz@modcmd#1{%
    \expandafter\global\expandafter\let\csname hobby@orig@\string#1\endcsname=#1%
    \gdef#1{\hobby@qfinish#1}%
}
\def\hobby@qfinish{%
  \hobby@quick@computeend
  \hobby@qrestore@tikz@commands
}

%% 
%% Copyright (C) 2012-2021 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
%% license or (at your option) any later version.
%% The latest version of this license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%% Andrew Stacey.
%% 
%% This work consists of the files  hobby_code.dtx
%%                                  hobby.tex
%% and the derived files            hobby.code.tex
%%                                  pgflibraryhobby.code.tex
%%                                  tikzlibraryhobby.code.tex
%%                                  pml3array.sty
%%                                  hobby-l3draw.sty
%%                                  hobby.ins
%%                                  hobby.pdf
%%                                  hobby_code.pdf
%%                                  README.txt
%% 
%%
%% End of file `tikzlibraryhobby.code.tex'.
