From c1bfd0a25d81a98bbc0c1c15063221e59947f974 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 23 Jul 2023 20:45:55 +0000 Subject: tikz-nfold (23jul23) git-svn-id: svn://tug.org/texlive/trunk@67711 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/tikz-nfold/README.md | 2 +- .../doc/latex/tikz-nfold/tikz-nfold-doc.pdf | Bin 302816 -> 304060 bytes .../doc/latex/tikz-nfold/tikz-nfold-doc.tex | 38 +++++++++++++++------ 3 files changed, 28 insertions(+), 12 deletions(-) (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/latex/tikz-nfold/README.md b/Master/texmf-dist/doc/latex/tikz-nfold/README.md index c1466687133..4c1d75c2494 100644 --- a/Master/texmf-dist/doc/latex/tikz-nfold/README.md +++ b/Master/texmf-dist/doc/latex/tikz-nfold/README.md @@ -1,5 +1,5 @@ # tikz-nfold -## Version 0.1.3 +## Version 1.0.0 This library adds higher-order paths to [TikZ](https://ctan.org/pkg/pgf) and also fixes some graphical issues with TikZ' `double` paths, used e.g. in wide arrows. It is also compatible with [tikz-cd](https://ctan.org/pkg/tikz-cd), adding support for triple and higher arrows. See the [documentation](tikz-nfold-doc.pdf) for full details. diff --git a/Master/texmf-dist/doc/latex/tikz-nfold/tikz-nfold-doc.pdf b/Master/texmf-dist/doc/latex/tikz-nfold/tikz-nfold-doc.pdf index 9df9c937ac2..8dad39e27f0 100644 Binary files a/Master/texmf-dist/doc/latex/tikz-nfold/tikz-nfold-doc.pdf and b/Master/texmf-dist/doc/latex/tikz-nfold/tikz-nfold-doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/tikz-nfold/tikz-nfold-doc.tex b/Master/texmf-dist/doc/latex/tikz-nfold/tikz-nfold-doc.tex index 46132fb7f5b..094924d2e8b 100644 --- a/Master/texmf-dist/doc/latex/tikz-nfold/tikz-nfold-doc.tex +++ b/Master/texmf-dist/doc/latex/tikz-nfold/tikz-nfold-doc.tex @@ -1,4 +1,4 @@ -%% tikz-nfold.sty +%% tikz-nfold-doc.tex %% Copyright 2023 Jonathan Schulz % % This work may be distributed and/or modified under the @@ -13,8 +13,12 @@ % % The Current Maintainer of this work is Jonathan Schulz. % -% This work consists of the files pgflibrarybezieroffset.code.tex, -% tikzlibrarynfold.code.tex, tikz-nfold-doc.tex, and tikz-nfold-doc.pdf. +% This work consists of the files +% pgflibrarybezieroffset.code.tex, pgflibrarynfold.code.tex, pgflibraryoffsetpath.code.tex, tikz-nfold-doc.tex, tikzlibrarynfold.code.tex, tikz-nfold-doc.tex, and tikz-nfold-doc.pdf. +% +% +% A commented version of this file can be found on https://github.com/jonschz/tikz-nfold . +% \documentclass[12pt,a4paper]{article} @@ -27,7 +31,6 @@ \usepackage{parskip} \usepackage[margin=2.5cm]{geometry} -% recommended order: 1) hyperref 2) amsthm 3) cleveref 4) \newtheorem \usepackage[colorlinks]{hyperref} \usepackage{amsmath} \usepackage{amsthm} @@ -38,7 +41,6 @@ \theoremstyle{definition} \newtheorem{definition}{Definition}[section] -%\newcommand{\todo}[1]{{\color{red}\bfseries#1}} \newcommand{\tikzdouble}{\texttt{/tikz/double}} \newcommand{\nfold}{\texttt{nfold}} \newcommand{\tikznfold}{\texttt{/tikz/nfold}} @@ -52,7 +54,6 @@ \newcommand{\uv}{\vec{u}} \newcommand{\vv}{\vec{v}} -% to be used in pre=... to stop the proparation of warnings outside of tkzexample environments \makeatletter \def\disablewarnings{\def\pgfutil@packagewarning##1##2{}} \makeatother @@ -209,6 +210,19 @@ This package is by no means perfect, and even if it were, there would still be s \subsection{Impossible or very hard to fix} \begin{itemize} + \item Self-intersecting paths do not have the expected intersections: +\begin{tkzexample}[latex=4.5cm] +\begin{tikzpicture} + \draw[double distance=5pt, line width=1pt] + (0,2.5) -- (1,2.5) (1,3) -- (1,2) + (2,2) -- (3,2) rectangle (4,3); + \node[right] at (0,3.5) {double:}; + \draw[double distance=5pt, line width=1pt, nfold] + (0,.5) -- (1,.5) (1,1) -- (1,0) + (2,0) -- (3,0) rectangle (4,1); + \node[right] at (0,1.5) {nfold:}; +\end{tikzpicture} +\end{tkzexample} \item \nfold{} struggles with high curvatures and wide paths: Let $\kappa(t)$ be the curvature of the path in a given point, and let $\texttt{double distance} = \alpha$. If $\kappa(t) > \frac{2}{\alpha}$ (i.e. the radius of the osculating circle is smaller than half the width of the path) for some $0 \leq t \leq 1$, the output of \nfold{} will not be correct: \begin{tkzexample}[latex=4.25cm] \begin{tikzpicture} @@ -268,12 +282,14 @@ This package is by no means perfect, and even if it were, there would still be s \section{The basic layer \texttt{pgf} commands} +This package contains three \emph{pgf} libraries building upon one another: \texttt{bezieroffset}, \texttt{offsetpath}, and \nfold. All of these are contained in the \emph{TikZ} library \nfold. + \subsection{Offsetting curves} -This package provides some basic layer commands for offsetting curves and straight lines. Use +This library provides some basic layer commands for offsetting curves and straight lines. Use \begin{verbatim} \usepgflibrary{bezieroffset} \end{verbatim} -to only import the base layer library. The following commands are provided: +to only import this base layer library. The following commands are provided: \begin{itemize} \item \verb|\pgfoffsetcurve{pt1}{pt2}{pt3}{pt4}{distance}|\\% This macro draws the parallel of a Bézier curve. The first four parameters are the control points of the Bézier curve (e.g.\ in the form of \verb|\pgfpoint{}{}|), the fifth parameter is the distance by which the curve should be offset. A negative value offsets the curve in the opposite direction. This macro begins with a \verb|\pgfpointmoveto| to the offset of \texttt{pt1}. @@ -286,7 +302,7 @@ to only import the base layer library. The following commands are provided: \end{itemize} \subsection{Offsetting paths} -The following macros are part of the TikZ library \nfold{} and offset an entire soft path. +The following macros are part of the pgf library \texttt{offsetpath} and offset the whole softpath. \begin{itemize} \item \verb|\pgfoffsetpath{softpath}{distance}|\\% This macro offsets \texttt{softpath} by \texttt{distance}. The latter may be negative. @@ -295,7 +311,7 @@ The following macros are part of the TikZ library \nfold{} and offset an entire \item \verb|\pgfoffsetpathqfraction{softpath}{hwidth}{fraction}|\\% This macro is a quicker version of the previous macro does not parse the input values using the \texttt{pgfmath}-engine. \item \verb|\pgfoffsetpathindex{softpath}{width}{i}{n}|\\% - In this convenience method, \texttt{i} and \texttt{n} are integers with $1 \leq i \leq n$. It calls the previous macro with \texttt{fraction=-1.0} for \texttt{i=1} and with \texttt{fraction=1.0} for \texttt{i=n} and is thus capable of reproducing the output of \texttt{/tikz/nfold=n} (albeit in a less efficient way). + In this convenience method, \texttt{i} and \texttt{n} are integers with $1 \leq i \leq n$. It calls the previous macro with \texttt{fraction=-1.0} for \texttt{i=1} and with \texttt{fraction=1.0} for \texttt{i=n}, hence it is capable of reproducing the output of \texttt{/tikz/nfold=n} (albeit in a less efficient way). \end{itemize} In the following example we see how \verb|\pgfoffsetpath{..}{0pt}| reproduces the input path (rendered in black) and how \verb|\pgfoffsetpathfraction{..}{8pt}{0}| differs. \begin{tkzexample}[latex=4cm] @@ -329,6 +345,7 @@ Here we see how the commands can be used to customise $n$-fold paths: \section{Version history} \begin{itemize} + \item \textbf{v1.0.0}: Restructure and bug fixes \item \textbf{v0.1.3}: Bug fixes \item \textbf{v0.1.2}: Bug fixes \item \textbf{v0.1.1}: Closing paths and structural changes @@ -497,7 +514,6 @@ Note that $-\tfrac{\pi}{3} \leq \beta \leq \tfrac{\pi}{3}$ (and hence $\cos(\bet \end{equation} and all of these terms can be computed directly from dot and cross products of vectors between the original control points. To summarise, let $\vv_{ij} := \overrightarrow{A_iA_j}$, and let $\vv_0$, $\vv_1$ be the normalised tangents at $t=0$ and $t=1$, respectively (see \cref{subsec:stabilisation} how they are computed). Then \begin{equation} -% for checking \overline{A'_1A'_2} = \overline{A_1A_2} + \frac{d}{\overline{A_1A_4}^2}\cdot\left(\vv_{12} \times \vv_{14} - \vv_{12}\cdot\vv_{14} \frac{\vv_{14}\times\tv_1}{\vv_{14}\cdot\tv_1} \right) \ . \end{equation} Let furthermore $\uv_{ij} := \vv_{ij}/|\vv_{ij}|$ be the normalised vectors. Then we find -- cgit v1.2.3