From 555761b02e9d39a42e9a72dc9f90955c65036740 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 16 Aug 2014 21:45:29 +0000 Subject: hobby (16aug14) git-svn-id: svn://tug.org/texlive/trunk@34953 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/hobby/README | 2 +- Master/texmf-dist/doc/latex/hobby/hobby.pdf | Bin 366952 -> 368666 bytes Master/texmf-dist/doc/latex/hobby/hobby_doc.pdf | Bin 488046 -> 522544 bytes Master/texmf-dist/doc/latex/hobby/hobby_doc.tex | 49 +++++++++- Master/texmf-dist/source/latex/hobby/hobby.dtx | 100 ++++++++++++++++----- Master/texmf-dist/source/latex/hobby/hobby.ins | 8 +- Master/texmf-dist/tex/latex/hobby/hobby.code.tex | 32 +++---- .../tex/latex/hobby/pgflibraryhobby.code.tex | 38 +++++++- Master/texmf-dist/tex/latex/hobby/pml3array.sty | 4 +- .../tex/latex/hobby/tikzlibraryhobby.code.tex | 4 +- 10 files changed, 188 insertions(+), 49 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/hobby/README b/Master/texmf-dist/doc/latex/hobby/README index d48c4b90e17..04af0731d63 100644 --- a/Master/texmf-dist/doc/latex/hobby/README +++ b/Master/texmf-dist/doc/latex/hobby/README @@ -1,7 +1,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 ---------------------------------------------------------------- diff --git a/Master/texmf-dist/doc/latex/hobby/hobby.pdf b/Master/texmf-dist/doc/latex/hobby/hobby.pdf index 4f581c840cf..07ada0caba0 100644 Binary files a/Master/texmf-dist/doc/latex/hobby/hobby.pdf and b/Master/texmf-dist/doc/latex/hobby/hobby.pdf differ diff --git a/Master/texmf-dist/doc/latex/hobby/hobby_doc.pdf b/Master/texmf-dist/doc/latex/hobby/hobby_doc.pdf index c3b008ed70e..b63f4142a6b 100644 Binary files a/Master/texmf-dist/doc/latex/hobby/hobby_doc.pdf and b/Master/texmf-dist/doc/latex/hobby/hobby_doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/hobby/hobby_doc.tex b/Master/texmf-dist/doc/latex/hobby/hobby_doc.tex index a00a4d525a0..ed83ded58ce 100644 --- a/Master/texmf-dist/doc/latex/hobby/hobby_doc.tex +++ b/Master/texmf-dist/doc/latex/hobby/hobby_doc.tex @@ -9,6 +9,7 @@ \usepackage{fancyvrb} \usetikzlibrary{hobby,decorations.pathreplacing} \usepackage{listings} +\usepackage{hyperref} \pgfplotsset{compat=1.9} \lstloadlanguages{[LaTeX]TeX} \lstset{breakatwhitespace=true,breaklines=true,language=TeX} @@ -146,7 +147,14 @@ It can be loaded with \begin{verbatim} \usetikzlibrary{hobby} \end{verbatim} -%% + +\textbf{Warning}: This package makes extensive use of \LaTeX3. +On occasion, updates to \LaTeX3 packages have resulted in this package behaving oddly or not working at all. +The most up to date version of this package can be obtained from the \href{http://bazaar.launchpad.net/~tex-sx/tex-sx/development/files}{TeX-SX Launchpad page} (download \Verb+hobby.dtx+ and run \Verb+tex hobby.dtx+ to generate the files). +Often, such issues are reported on the \href{http://tex.stackexchange.com}{TeX-SX} site and workarounds quickly found so it is worth checking there as well. + +\bigskip + There are a variety of ways of specifying the data to the algorithm to generate the curve. \subsection{As a \textsf{to path}.} @@ -224,6 +232,38 @@ However, the Hobby algorithm is designed to draw a curve in 2D-{}space and does \end{tikzpicture} \end{example} +\subsection{Basic Level PGF Commands} + +(Suggested by the question \href{http://tex.stackexchange.com/q/159896/86}{How to combine Hobby paths with PGF Basic Layer commands?} on TeX-SX.) + +In some circumstances, it is convenient to bypass TikZ and use more basic PGF commands for building a path. +It is possible to add a path built using Hobby's algorithm in this fashion. +The commands are: + +\begin{itemize} +\item \Verb+\pgfpathhobby+ to initialise the path. +If this is followed by a braced group then the contents of that are taken as options to the algorithm. + +\item \Verb+\pgfpathhobbypt{}+ to add a point to the path. +If this is followed by a braced group then the contents of that are taken as options for that point. + +\item \Verb+\pgfpathhobbyend+ finalises the path. +This applies the algorithm to the set of specified points and adds it to the current path. +\end{itemize} + +\begin{example} +\begin{tikzpicture} +\pgfpathmoveto{\pgfpoint{0}{0}} +\pgfpathlineto{\pgfpoint{1cm}{0}} +\pgfpathhobby{closed=true} +\pgfpathhobbypt{\pgfpoint{1cm}{2cm}}{tension in=2} +\pgfpathhobbypt{\pgfpoint{2cm}{1cm}} +\pgfpathhobbypt{\pgfpoint{3cm}{0cm}} +\pgfpathhobbyend +\pgfusepath{stroke} +\end{tikzpicture} +\end{example} + \section{Customisation} There are various ways to customise the path generated by the Hobby algorithms. @@ -865,6 +905,13 @@ The actual curves are then produced from the angles using the same formulae for At the last stage, we render both segments of the generated curve. +\section{Acknowledgements} + +This package began life as an answer to the question \href{http://tex.stackexchange.com/q/54771/86}{Curve through a sequence of points with Metapost and TikZ}. +Once released upon the unsuspecting world, various questions on the \href{http://tex.stackexchange.com}{TeX-SX} site have prompted new features (and bug-fixes). +Most of these can be found by looking at the \href{http://tex.stackexchange.com/questions/tagged/hobby}{list of questions tagged ``hobby''} on that site. + + \begin{thebibliography}{1} \bibitem{MR834054} John~D. Hobby. \newblock Smooth, easy to compute interpolating splines. \newblock {\em Discrete Comput. Geom.}, 1:123--140, 1986. \end{thebibliography} \end{document} diff --git a/Master/texmf-dist/source/latex/hobby/hobby.dtx b/Master/texmf-dist/source/latex/hobby/hobby.dtx index 74ad06c13dd..39f96042d33 100644 --- a/Master/texmf-dist/source/latex/hobby/hobby.dtx +++ b/Master/texmf-dist/source/latex/hobby/hobby.dtx @@ -6,7 +6,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 ---------------------------------------------------------------- @@ -33,7 +33,7 @@ The implementation is in LaTeX3. It can be used as as a TikZ ---------------------------------------------------------------- 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 ---------------------------------------------------------------- @@ -41,7 +41,7 @@ See http://www.latex-project.org/lppl.txt \endpreamble \postamble -Copyright (C) 2012 by Andrew Stacey +Copyright (C) 2012 by Andrew Stacey This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this @@ -110,7 +110,7 @@ and the derived files hobby.code.tex % % \fi % -% \CheckSum{3304} +% \CheckSum{3380} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -134,7 +134,7 @@ and the derived files hobby.code.tex % % \providecommand*{\url}{\texttt} % \title{The \textsf{Hobby} package: code} -% \author{Andrew Stacey \\ \url{stacey@math.ntnu.no}} +% \author{Andrew Stacey \\ \url{loopspace@mathforge.org}} % \date{\hobbyVersion\ from\ \hobbyDate} % \maketitle % @@ -182,8 +182,8 @@ and the derived files hobby.code.tex \tl_new:N \g__hobby_version \tl_new:N \g__hobby_date -\tl_set:Nn \g__hobby_version {1.4} -\tl_set:Nn \g__hobby_date {2014-01-21} +\tl_set:Nn \g__hobby_version {1.6} +\tl_set:Nn \g__hobby_date {2014-08-11} \DeclareDocumentCommand \hobbyVersion {} { \tl_use:N \g__hobby_version @@ -480,20 +480,20 @@ and the derived files hobby.code.tex % \begin{macro}{\l_hobby_in_angle_fp} % \Verb+\l_hobby_in_angle_fp+ is the angle at the end of an open path. % If this is not specified, it will be computed automatically. -% It is set to \Verb+\c_undefined_fp+ to allow easy detection of when it has been specified. +% It is set to \Verb+\c_inf_fp+ to allow easy detection of when it has been specified. % \begin{macrocode} \fp_new:N \l_hobby_in_angle_fp -\fp_set_eq:NN \l_hobby_in_angle_fp \c_undefined_fp +\fp_set_eq:NN \l_hobby_in_angle_fp \c_inf_fp % \end{macrocode} % \end{macro} % % \begin{macro}{\l_hobby_out_angle_fp} % \Verb+\l_hobby_out_angle_fp+ is the angle at the start of an open path. % If this is not specified, it will be computed automatically. -% It is set to \Verb+\c_undefined_fp+ to allow easy detection of when it has been specified. +% It is set to \Verb+\c_inf_fp+ to allow easy detection of when it has been specified. % \begin{macrocode} \fp_new:N \l_hobby_out_angle_fp -\fp_set_eq:NN \l_hobby_out_angle_fp \c_undefined_fp +\fp_set_eq:NN \l_hobby_out_angle_fp \c_inf_fp % \end{macrocode} % \end{macro} % @@ -742,7 +742,7 @@ and the derived files hobby.code.tex % Just need to set the incoming and outgoing angles % \begin{macrocode} \hobby_distangle:n {0} -\fp_if_undefined:NF \l_hobby_out_angle_fp +\fp_compare:nF { \l_hobby_out_angle_fp == \c_inf_fp } { \fp_set:Nn \l_hobby_tempa_fp { \l_hobby_out_angle_fp - \array_get:Nn \l_hobby_angles_array {0}} @@ -763,15 +763,15 @@ and the derived files hobby.code.tex \fp_add:Nn \l_hobby_tempa_fp {2 * \c_pi_fp} } \array_put:Nnx \l_hobby_theta_array {0} {\fp_to_tl:N \l_hobby_tempa_fp} - \fp_if_undefined:NT \l_hobby_in_angle_fp + \fp_compare:nT { \l_hobby_in_angle_fp == \c_inf_fp } { %^^A \fp_mul:Nn \l_hobby_tempa_fp {-1} \array_put:Nnx \l_hobby_phi_array {1}{ \fp_to_tl:N \l_hobby_tempa_fp} } } -\fp_if_undefined:NTF \l_hobby_in_angle_fp +\fp_compare:nTF { \l_hobby_in_angle_fp == \c_inf_fp } { - \fp_if_undefined:NT \l_hobby_out_angle_fp + \fp_compare:nT { \l_hobby_out_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_phi_array {1} {0} \array_put:Nnx \l_hobby_theta_array {0} {0} @@ -791,7 +791,7 @@ and the derived files hobby.code.tex \array_put:Nnx \l_hobby_phi_array {1} {\fp_to_tl:N \l_hobby_tempa_fp} - \fp_if_undefined:NT \l_hobby_out_angle_fp + \fp_compare:nT { \l_hobby_out_angle_fp == \c_inf_fp } { %^^A \fp_mul:Nn \l_hobby_tempa_fp {-1} \array_put:Nnx \l_hobby_theta_array {0}{ \fp_to_tl:N \l_hobby_tempa_fp} @@ -981,7 +981,7 @@ and the derived files hobby.code.tex % Open path. % First, we test to see if \(\theta_0\) has been specified. % \begin{macrocode} -\fp_if_undefined:NTF \l_hobby_out_angle_fp +\fp_compare:nTF { \l_hobby_out_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_matrix_b_array {0} {\fp_to_tl:n { (\array_get:Nn \l_hobby_tension_in_array {1})^3 @@ -1036,7 +1036,7 @@ and the derived files hobby.code.tex % % Next, if \(\phi_n\) has been given. % \begin{macrocode} -\fp_if_undefined:NTF \l_hobby_in_angle_fp +\fp_compare:nTF { \l_hobby_in_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_matrix_b_array {\l_hobby_npoints_int - 1} {\fp_to_tl:n { @@ -1234,7 +1234,7 @@ and the derived files hobby.code.tex % \end{macrocode} % If \(\phi_n\) was not given, we compute it from \(\theta_{n-1}\). % \begin{macrocode} -\fp_if_undefined:NT \l_hobby_in_angle_fp +\fp_compare:nT { \l_hobby_in_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_phi_array {\l_hobby_npoints_int} {\fp_to_tl:n { ((3 * (\array_get:Nn \l_hobby_tension_in_array {\l_hobby_npoints_int}) - 1) @@ -1661,8 +1661,8 @@ sin ( (\array_get:Nn \l_hobby_angles_array {##1}) \int_gset:Nn \l_hobby_npoints_int {-1} \int_gset:Nn \l_hobby_draw_int {1} - \fp_gset_eq:NN \l_hobby_in_angle_fp \c_undefined_fp - \fp_gset_eq:NN \l_hobby_out_angle_fp \c_undefined_fp + \fp_gset_eq:NN \l_hobby_in_angle_fp \c_inf_fp + \fp_gset_eq:NN \l_hobby_out_angle_fp \c_inf_fp \fp_gset_eq:NN \l_hobby_in_curl_fp \c_one_fp \fp_gset_eq:NN \l_hobby_out_curl_fp \c_one_fp } @@ -1751,6 +1751,64 @@ sin ( (\array_get:Nn \l_hobby_angles_array {##1}) % \end{macrocode} % \end{macro} % +% \begin{macro}{\pgfpathhobby} +% Low-level interface to the hobby construction. +% This sets up the commands and starts the iterator. +% \begin{macrocode} +\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}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pgfpathhobbypt} +% Adds a point to the construction +% \begin{macrocode} +\def\pgfpathhobbypt#1{% + #1% + \pgfmathsetmacro\hobby@x{\the\pgf@x/1cm}% + \pgfmathsetmacro\hobby@y{\the\pgf@y/1cm}% + \pgfutil@ifnextchar\bgroup{\pgfpathhobbyptparams}{\pgfpathhobbyptparams{}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pgfpathhobbyptparams} +% \begin{macrocode} +\def\pgfpathhobbyptparams#1{% + \hobbyaddpoint{#1,x = \hobby@x, y = \hobby@y}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pgfpathhobbyend} +% \begin{macrocode} +\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 +} +% \end{macrocode} +% \end{macro} +% +% % Plot handlers % % \begin{macro}{\pgfplothanderhobby} diff --git a/Master/texmf-dist/source/latex/hobby/hobby.ins b/Master/texmf-dist/source/latex/hobby/hobby.ins index fbae6d043d8..74168ef3366 100644 --- a/Master/texmf-dist/source/latex/hobby/hobby.ins +++ b/Master/texmf-dist/source/latex/hobby/hobby.ins @@ -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 %% ---------------------------------------------------------------- @@ -20,7 +20,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 ---------------------------------------------------------------- @@ -28,7 +28,7 @@ See http://www.latex-project.org/lppl.txt \endpreamble \postamble -Copyright (C) 2012 by Andrew Stacey +Copyright (C) 2012 by Andrew Stacey This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this @@ -63,7 +63,7 @@ and the derived files hobby.code.tex {\from{hobby.dtx}{array}}} \endbatchfile %% -%% Copyright (C) 2012 by Andrew Stacey +%% Copyright (C) 2012 by Andrew Stacey %% %% This file may be distributed and/or modified under the conditions %% of the LaTeX Project Public License, either version 1.3 of this diff --git a/Master/texmf-dist/tex/latex/hobby/hobby.code.tex b/Master/texmf-dist/tex/latex/hobby/hobby.code.tex index 0e567fcc528..1d13c52a384 100644 --- a/Master/texmf-dist/tex/latex/hobby/hobby.code.tex +++ b/Master/texmf-dist/tex/latex/hobby/hobby.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 %% ---------------------------------------------------------------- @@ -33,8 +33,8 @@ \tl_new:N \g__hobby_version \tl_new:N \g__hobby_date -\tl_set:Nn \g__hobby_version {1.4} -\tl_set:Nn \g__hobby_date {2014-01-21} +\tl_set:Nn \g__hobby_version {1.6} +\tl_set:Nn \g__hobby_date {2014-08-11} \DeclareDocumentCommand \hobbyVersion {} { \tl_use:N \g__hobby_version @@ -89,9 +89,9 @@ \fp_new:N \l_hobby_out_curl_fp \fp_set:Nn \l_hobby_out_curl_fp {1} \fp_new:N \l_hobby_in_angle_fp -\fp_set_eq:NN \l_hobby_in_angle_fp \c_undefined_fp +\fp_set_eq:NN \l_hobby_in_angle_fp \c_inf_fp \fp_new:N \l_hobby_out_angle_fp -\fp_set_eq:NN \l_hobby_out_angle_fp \c_undefined_fp +\fp_set_eq:NN \l_hobby_out_angle_fp \c_inf_fp \int_new:N \l_hobby_npoints_int \int_new:N \l_hobby_draw_int \keys_define:nn {hobby / read in all} { @@ -233,7 +233,7 @@ { \int_compare:nNnTF {\l_hobby_npoints_int} = {1} { \hobby_distangle:n {0} -\fp_if_undefined:NF \l_hobby_out_angle_fp +\fp_compare:nF { \l_hobby_out_angle_fp == \c_inf_fp } { \fp_set:Nn \l_hobby_tempa_fp { \l_hobby_out_angle_fp - \array_get:Nn \l_hobby_angles_array {0}} @@ -246,14 +246,14 @@ \fp_add:Nn \l_hobby_tempa_fp {2 * \c_pi_fp} } \array_put:Nnx \l_hobby_theta_array {0} {\fp_to_tl:N \l_hobby_tempa_fp} - \fp_if_undefined:NT \l_hobby_in_angle_fp + \fp_compare:nT { \l_hobby_in_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_phi_array {1}{ \fp_to_tl:N \l_hobby_tempa_fp} } } -\fp_if_undefined:NTF \l_hobby_in_angle_fp +\fp_compare:nTF { \l_hobby_in_angle_fp == \c_inf_fp } { - \fp_if_undefined:NT \l_hobby_out_angle_fp + \fp_compare:nT { \l_hobby_out_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_phi_array {1} {0} \array_put:Nnx \l_hobby_theta_array {0} {0} @@ -273,7 +273,7 @@ \array_put:Nnx \l_hobby_phi_array {1} {\fp_to_tl:N \l_hobby_tempa_fp} - \fp_if_undefined:NT \l_hobby_out_angle_fp + \fp_compare:nT { \l_hobby_out_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_theta_array {0}{ \fp_to_tl:N \l_hobby_tempa_fp} } @@ -393,7 +393,7 @@ } } { -\fp_if_undefined:NTF \l_hobby_out_angle_fp +\fp_compare:nTF { \l_hobby_out_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_matrix_b_array {0} {\fp_to_tl:n { (\array_get:Nn \l_hobby_tension_in_array {1})^3 @@ -436,7 +436,7 @@ } \array_put:Nnx \l_hobby_matrix_d_array {0} {\fp_to_tl:N \l_hobby_tempa_fp} } -\fp_if_undefined:NTF \l_hobby_in_angle_fp +\fp_compare:nTF { \l_hobby_in_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_matrix_b_array {\l_hobby_npoints_int - 1} {\fp_to_tl:n { @@ -589,7 +589,7 @@ \bool_if:NTF \l_hobby_closed_bool { \int_gdecr:N \l_hobby_npoints_int }{ -\fp_if_undefined:NT \l_hobby_in_angle_fp +\fp_compare:nT { \l_hobby_in_angle_fp == \c_inf_fp } { \array_put:Nnx \l_hobby_phi_array {\l_hobby_npoints_int} {\fp_to_tl:n { ((3 * (\array_get:Nn \l_hobby_tension_in_array {\l_hobby_npoints_int}) - 1) @@ -897,14 +897,14 @@ sin ( (\array_get:Nn \l_hobby_angles_array {##1}) \int_gset:Nn \l_hobby_npoints_int {-1} \int_gset:Nn \l_hobby_draw_int {1} - \fp_gset_eq:NN \l_hobby_in_angle_fp \c_undefined_fp - \fp_gset_eq:NN \l_hobby_out_angle_fp \c_undefined_fp + \fp_gset_eq:NN \l_hobby_in_angle_fp \c_inf_fp + \fp_gset_eq:NN \l_hobby_out_angle_fp \c_inf_fp \fp_gset_eq:NN \l_hobby_in_curl_fp \c_one_fp \fp_gset_eq:NN \l_hobby_out_curl_fp \c_one_fp } \ExplSyntaxOff %% -%% Copyright (C) 2012 by Andrew Stacey +%% Copyright (C) 2012 by Andrew Stacey %% %% This file may be distributed and/or modified under the conditions %% of the LaTeX Project Public License, either version 1.3 of this 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 +%% Copyright (C) 2012 by Andrew Stacey %% %% This file may be distributed and/or modified under the conditions %% of the LaTeX Project Public License, either version 1.3 of this diff --git a/Master/texmf-dist/tex/latex/hobby/pml3array.sty b/Master/texmf-dist/tex/latex/hobby/pml3array.sty index 3aeb1e6849b..d8722d9f75d 100644 --- a/Master/texmf-dist/tex/latex/hobby/pml3array.sty +++ b/Master/texmf-dist/tex/latex/hobby/pml3array.sty @@ -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 %% ---------------------------------------------------------------- @@ -382,7 +382,7 @@ } \ExplSyntaxOff %% -%% Copyright (C) 2012 by Andrew Stacey +%% Copyright (C) 2012 by Andrew Stacey %% %% This file may be distributed and/or modified under the conditions %% of the LaTeX Project Public License, either version 1.3 of this diff --git a/Master/texmf-dist/tex/latex/hobby/tikzlibraryhobby.code.tex b/Master/texmf-dist/tex/latex/hobby/tikzlibraryhobby.code.tex index ced64271e8b..8fde56abd6e 100644 --- a/Master/texmf-dist/tex/latex/hobby/tikzlibraryhobby.code.tex +++ b/Master/texmf-dist/tex/latex/hobby/tikzlibraryhobby.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 %% ---------------------------------------------------------------- @@ -581,7 +581,7 @@ } %% -%% Copyright (C) 2012 by Andrew Stacey +%% Copyright (C) 2012 by Andrew Stacey %% %% This file may be distributed and/or modified under the conditions %% of the LaTeX Project Public License, either version 1.3 of this -- cgit v1.2.3