summaryrefslogtreecommitdiff
path: root/graphics/pgf
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf')
-rw-r--r--graphics/pgf/contrib/tikz-nfold/README.md2
-rw-r--r--graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.pdfbin302791 -> 302816 bytes
-rw-r--r--graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.tex2
-rw-r--r--graphics/pgf/contrib/tikz-nfold/tikzlibrarynfold.code.tex235
4 files changed, 156 insertions, 83 deletions
diff --git a/graphics/pgf/contrib/tikz-nfold/README.md b/graphics/pgf/contrib/tikz-nfold/README.md
index 6cfba546a4..c146668713 100644
--- a/graphics/pgf/contrib/tikz-nfold/README.md
+++ b/graphics/pgf/contrib/tikz-nfold/README.md
@@ -1,5 +1,5 @@
# tikz-nfold
-## Version 0.1.2
+## Version 0.1.3
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/graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.pdf b/graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.pdf
index 9a26adfd67..9df9c937ac 100644
--- a/graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.pdf
+++ b/graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.tex b/graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.tex
index 60b1d03202..46132fb7f5 100644
--- a/graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.tex
+++ b/graphics/pgf/contrib/tikz-nfold/tikz-nfold-doc.tex
@@ -329,6 +329,8 @@ Here we see how the commands can be used to customise $n$-fold paths:
\section{Version history}
\begin{itemize}
+ \item \textbf{v0.1.3}: Bug fixes
+ \item \textbf{v0.1.2}: Bug fixes
\item \textbf{v0.1.1}: Closing paths and structural changes
\begin{itemize}
\item Support for closed paths (\texttt{cycle} and \verb|\pgfpathclose|)
diff --git a/graphics/pgf/contrib/tikz-nfold/tikzlibrarynfold.code.tex b/graphics/pgf/contrib/tikz-nfold/tikzlibrarynfold.code.tex
index da48d7b62b..342191b0ad 100644
--- a/graphics/pgf/contrib/tikz-nfold/tikzlibrarynfold.code.tex
+++ b/graphics/pgf/contrib/tikz-nfold/tikzlibrarynfold.code.tex
@@ -276,30 +276,41 @@
\newif\ifpgf@nfold@angletoosharp
% This stores whether we need the intersections library for an arrow tip but it is not loaded
\newif\ifpgf@nfold@intersectionsnotloaded
+% This stores whether the currently processed connected sub-path is the final one on this path
+\newif\ifpgf@nfold@lastconnsubpath
\def\pgf@nfold@parser@handlesegment{%
- \if\pgf@nfold@cur@visible 0
+ \if\pgf@nfold@cur@visible0
% first, last and moveto are invisible
\if\pgf@nfold@cur@type m
- % We don't need to do anything for a moveto: If a visible segment follows, it will move to
- % its starting location by itself. However, we might need to draw the arrow tip extension
+ % We don't need to do anything for a moveto; if a visible segment follows, it will move to
+ % its starting location by itself. However, we might need to draw the arrow tip extension
% at the start (if present).
+ % Draw a tip extension only if all of the following conditions are met:
+ % 1. There is an Implies tip at the start of this path
+ % 2. We are currently on the last connected sub-path of this path
+ % 3. The next segment is visible
+ % 4. This moveto is the first segment on this path
\if\pgf@nfold@start@arrowcode1
- \if\pgf@nfold@prev@type f
- \if\pgf@nfold@next@visible1
- \edef\pgf@nfold@macrotoadd{%
- \noexpand\pgf@nfold@extendtotip{s}{\pgf@nfold@cur@last}{\pgf@nfold@next@angle@i}
- }%
- \pgf@nfold@addmacro\pgf@parsed@cur@conn@seg%
- % hack: We make the next segment believe that this segment was a lineto
- % so the path does not get interrupted
- \let\pgf@nfold@cur@type l
- \let\pgf@nfold@cur@visible 1
- \let\pgf@nfold@cur@angle@ii\pgf@nfold@next@angle@i
- \let\pgf@nfold@cur@tang@ii\pgf@nfold@next@tang@i
- \fi
- \fi%
+ \ifpgf@nfold@lastconnsubpath
+ \if\pgf@nfold@prev@type f
+ \if\pgf@nfold@next@visible1
+ \edef\pgf@nfold@macrotoadd{%
+ \noexpand\pgf@nfold@extendtotip{s}{\pgf@nfold@cur@last}{\pgf@nfold@next@angle@i}
+ }%
+ \pgf@nfold@addmacro\pgf@parsed@cur@conn@seg%
+ % hack: We make the next segment believe that this segment was a lineto
+ % so the path does not get interrupted
+ \let\pgf@nfold@cur@type l
+ \let\pgf@nfold@cur@visible1
+ \let\pgf@nfold@cur@angle@ii\pgf@nfold@next@angle@i
+ \let\pgf@nfold@cur@tang@ii\pgf@nfold@next@tang@i
+ \def\pgf@nfold@deltaphi@end{0}
+ \pgf@nfold@angletoosharpfalse
+ \fi
+ \fi%
+ \fi
\fi
\fi%
\else%
@@ -311,25 +322,20 @@
\def\pgf@nfold@shortenstartjoin{0}
\def\pgf@nfold@shortenendjoin{0}
\pgf@nfold@closejoinsedgecasefalse
- \pgf@nfold@angletoosharpfalse
% Step 1.1: Make room for the join at the start if needed
- \if\pgf@nfold@prev@visible1
+ \if\pgf@nfold@prev@visible0
+ \pgf@nfold@continuesegmentfalse
+ \else
\pgf@nfold@continuesegmenttrue
- % TODO can we just use deltaphi@end from the previous round?
- % Compute the angle difference at the start (between -180 and +180 degrees)
- % using \pgfmathsubtract@ is more readable and no less efficient than computing this manually
- \pgfmathsubtract@{\pgf@nfold@cur@angle@i}{\pgf@nfold@prev@angle@ii}
- \pgf@nfold@clampangle
- \edef\pgf@nfold@deltaphi@start{\pgfmathresult}
+ % deltaphi@start can be recycled from deltaphi@end;
+ % \ifpgf@nfold@angletoosharp is also still set
+ \let\pgf@nfold@deltaphi@start\pgf@nfold@deltaphi@end
+ % set \pgf@xb := abs(deltaphi@start)
\pgf@xb=\pgf@nfold@deltaphi@start pt\relax
\ifdim\pgf@xb<0pt\relax
\pgf@xb=-\pgf@xb
\fi
- \ifdim\pgf@xb>178pt\relax
- % we go full backwards, don't relocate the start and disable the join to avoid division by zero
- % don't need an error message here, it has already been displayed in the previous segment
- \pgf@nfold@angletoosharptrue
- \else
+ \ifpgf@nfold@angletoosharp\else
\ifdim\pgf@xb>0.5pt\relax
% make room for the start join if the angle is nonzero;
% shortenstartjoin := hwidth*tan(.5*abs(deltaphi@start))
@@ -352,8 +358,7 @@
\pgfmathveclen@{\pgfmathresult}{\pgf@sys@tonumber\pgf@yb}
\pgfextract@process\pgf@nfold@cur@supporta{\pgfpointadd%
{\pgf@nfold@cur@first}%
- % TODO migrate to tangent
- {\pgfqpointpolar{\pgf@nfold@cur@angle@i}{\pgfmathresult pt}}}%
+ {\pgfqpointscale{\pgfmathresult}{\pgf@nfold@cur@tang@i}}}%
\else
% special treatment for singular curves (supporta = first) to avoid rounding error glitches.
% In this special case, a slight corner at the end of the join is unavoidable unless we
@@ -363,15 +368,15 @@
\fi
\fi
\fi
- \else
- \pgf@nfold@continuesegmentfalse
\fi
% Step 1.2: Make room for the join at the end if needed
\if\pgf@nfold@next@visible1
- % Compute the angle difference at the start (between -180 and +180 degrees)
+ % Compute the angle difference at the end (between -180 and +180 degrees)
% using \pgfmathsubtract@ is more readable and no less efficient than computing this manually
\pgfmathsubtract@{\pgf@nfold@next@angle@i}{\pgf@nfold@cur@angle@ii}
\pgf@nfold@clampangle
+ % Edge case handling: If the next segment is a closepath and has length zero, deltaphi is set
+ % to zero to prevent glitches (a zero length segment has no well-defined angle anyway)
\edef\pgf@nfold@deltaphi@end{\pgfmathresult}
\pgf@xb=\pgf@nfold@deltaphi@end pt\relax
\ifdim\pgf@xb<0pt\relax
@@ -381,6 +386,7 @@
\pgfutil@packagewarning{tikz-nfold}{Angle too sharp, expect visual errors}
\pgf@nfold@angletoosharptrue
\else
+ \pgf@nfold@angletoosharpfalse
\ifdim\pgf@xb>0.5pt\relax
% make room for the start join if the angle is nonzero
% shortenendjoin := hwidth*tan(.5*abs(deltaphi@end))
@@ -403,11 +409,10 @@
\pgfmathveclen@{\pgf@sys@tonumber\pgf@x}{\pgf@sys@tonumber\pgf@y}
\ifdim\pgfmathresult pt>0.1pt\relax
\pgfmathveclen@{\pgfmathresult}{\pgf@sys@tonumber\pgf@yb}
- % can use qpoint and minus because \pgfmathresult is guaranteed to be positive
\pgfextract@process\pgf@nfold@cur@supportb{\pgfpointadd%
{\pgf@nfold@cur@last}%
- % TODO migrate to tangent
- {\pgfqpointpolar{\pgf@nfold@cur@angle@ii}{-\pgfmathresult pt}}}%
+ % can use qpointscale and a minus because \pgfmathresult is guaranteed to be positive
+ {\pgfqpointscale{-\pgfmathresult}{\pgf@nfold@cur@tang@ii}}}%
\else
\let\pgf@nfold@cur@supportb\pgf@nfold@cur@movedlast
\fi
@@ -416,7 +421,7 @@
\fi
% Step 1.3: Detect an edge case
% This edge case appears whenever the current segment is such a short line that we would
- % have to reduce its length to less than zero to make space for the joins. In such cases,
+ % have to reduce its length to less than zero to make room for the joins. In such cases,
% the line is not drawn at all, and slight modifications must be made to the joins to ensure
% a correct output (i.e. one join is immediately followed by the next without a segment in between).
%
@@ -441,7 +446,7 @@
% If the previous segment is a moveto and the current segment is a "close joins" edge case,
% nothing needs to be drawn here (the relevant draw call will be made at the join of the subsequent
% segment). We must therefore make sure that we move to the correct end point of this segment.
- % Counterintuitively, this is given by the offset of \pgf@nfold@cur@movedfirst since the start and end
+ % Counterintuitively, this is given by the offset of \pgf@nfold@cur@movedFIRST since the start and end
% are reversed in the edge case.
\edef\pgf@nfold@macrotoadd{%
\noexpand\pgf@nfold@token@edgecase@movetostart{\pgf@nfold@cur@movedfirst}{\pgf@nfold@cur@angle@i}%
@@ -451,18 +456,27 @@
\else
% If we draw the join when the start angle is close to 180 degrees, we get a division by zero
\ifpgf@nfold@angletoosharp\else
- \pgf@nfold@parser@handlejoin
+ \if\pgf@nfold@cur@type z\else
+ \pgf@nfold@parser@handlejoin
+ \fi
\fi
\fi
- % Step 2.2: Store where the current (non-offset) end point was relocated
+ % Step 2.2: Store information that may be needed later
+ % Step 2.2.1: Store where the current (non-offset) end point was relocated
% in order to make space for the end join. This may be used if the next
% segment begins with a join
\let\pgf@nfold@prev@segment@end\pgf@nfold@cur@movedlast
+ % Step 2.2.2: Store the tangent of the first proper segment of closed path.
+ % This is needed in case the \pgfpathclose-segment has length zero,
+ % since in that case its tangent cannot be computed.
+ \if\pgf@nfold@cur@type i
+ \let\pgf@nfold@connsubpath@tang@i\pgf@nfold@next@tang@i%
+ \let\pgf@nfold@connsubpath@angle@i\pgf@nfold@next@angle@i%
+ \fi
%
% Step 3: Draw the new segment.
%
% The value of \ifpgf@nfold@continuesegment decides whether we start with a moveto.
- % curveto
\if\pgf@nfold@cur@type l
% In the edge case, one join is followed immediately by the next. The line segment
% thus has a negative length and will be skipped.
@@ -481,6 +495,11 @@
\def\pgf@nfold@macrotoadd{\pgf@nfold@token@closepath}%
\pgf@nfold@addmacro\pgf@parsed@cur@conn@seg%
\fi
+ \if\pgf@nfold@cur@type z
+ % zero and non-zero closepath's differ in the join handling, but are identical in rendering
+ \def\pgf@nfold@macrotoadd{\pgf@nfold@token@closepath}%
+ \pgf@nfold@addmacro\pgf@parsed@cur@conn@seg%
+ \fi
\if\pgf@nfold@cur@type c
\ifpgf@nfold@continuesegment
\pgf@subdividecurve{\pgf@nfold@cur@movedfirst}{\pgf@nfold@cur@supporta}{\pgf@nfold@cur@supportb}{\pgf@nfold@cur@movedlast}{\pgf@offset@max@recursion}{0}{\pgf@nfold@addcurvesegment@callback@continue}
@@ -779,55 +798,59 @@
%
% In order to correctly implement \pgfpathclose we already need to know about
% the \pgfpathclose (and the penultimate point) at the beginning of this
-% connected segment as these data affect the first/last join.
-% We therefore parse one connected segment of the softpath and store it in a modified
-% form in \pgf@cur@conn@segment. When reaching the end of the connected segment we call
-% the proper parser to turn \pgf@cur@conn@segment into a parsed path. We do this for
-% all connected segments and concatenate all the parsed paths.
+% connected sub-path as these data affect the first/last join.
+% We therefore parse one connected sub-path of the softpath and store it in a modified
+% form in \pgf@cur@conn@subpath. When reaching the end of the connected sub-path we call
+% the proper parser to turn \pgf@cur@conn@subpath into a parsed path. We do this for
+% all connected sub-paths and concatenate all the parsed paths.
%
\def\pgf@nfold@parsesoftpath#1#2{%
- \let\pgf@cur@conn@segment\pgfutil@empty%
- \let\pgf@all@parsed@segments\pgfutil@empty%
+ \let\pgf@cur@conn@subpath\pgfutil@empty%
+ \let\pgf@all@parsed@subpaths\pgfutil@empty%
\edef\pgf@nfold@parser@last@moveto{{\the\pgf@path@lastx}{\the\pgf@path@lasty}}%
\let\pgf@nfold@last@closepath@from\pgfutil@empty%
\pgf@nfold@parse@setupfirst%
\expandafter\pgf@nfold@@parsesoftpath#1\pgf@stop{}{}%
- \let#2\pgf@all@parsed@segments%
+ \let#2\pgf@all@parsed@subpaths%
}%
\def\pgf@nfold@@parsesoftpath#1#2#3{%
\let\pgf@next\pgf@nfold@@parsesoftpath%
\ifx#1\pgf@stop%
\def\pgf@nfold@macrotoadd{\pgf@nfold@parselast}%
- \pgf@nfold@addmacro\pgf@cur@conn@segment%
- \pgf@nfold@process@conn@segment%
+ \pgf@nfold@addmacro\pgf@cur@conn@subpath%
+ \pgf@nfold@lastconnsubpathtrue%
+ \pgf@nfold@process@conn@subpath%
\let\pgf@next\relax%
\else%
\ifx#1\pgfsyssoftpath@movetotoken%
- \ifx\pgf@cur@conn@segment\pgfutil@empty%
+ \ifx\pgf@cur@conn@subpath\pgfutil@empty%
% This case happens for the very first segment or for double movetos.
% We need special treatment here, as otherwise the arrow tip extension
% does not work correctly. The \pgf@nfold@parsemoveto will be called
- % in \pgf@nfold@process@conn@segment.
+ % in \pgf@nfold@process@conn@subpath.
\def\pgf@nfold@parser@last@moveto{{#2}{#3}}%
- % Make sure \pgf@cur@conn@segment is no longer empty so double movetos are not
+ % Make sure \pgf@cur@conn@subpath is no longer empty so double movetos are not
% treated the same as single movetos. This is also relevant to arrow tip extensions
- \def\pgf@cur@conn@segment{\relax}%
+ \def\pgf@cur@conn@subpath{\relax}%
\else%
\def\pgf@nfold@macrotoadd{\pgf@nfold@parsemoveto{#2}{#3}}%
- \pgf@nfold@addmacro\pgf@cur@conn@segment%
- % A moveto marks the beginning/end of one connected segment
- \pgf@nfold@process@conn@segment%
+ \pgf@nfold@addmacro\pgf@cur@conn@subpath%
+ \pgf@nfold@lastconnsubpathfalse%
+ % A moveto marks the beginning/end of one connected sub-path
+ \pgf@nfold@process@conn@subpath%
\let\pgf@nfold@last@closepath@from\pgfutil@empty%
- \let\pgf@cur@conn@segment\pgfutil@empty%
+ \let\pgf@cur@conn@subpath\pgfutil@empty%
+ % set up "first" again which may be needed for the arrow tip extension
+ \pgf@nfold@parse@setupfirst%
\def\pgf@nfold@parser@last@moveto{{#2}{#3}}%
\fi
\else%
\ifx#1\pgfsyssoftpath@linetotoken%
\def\pgf@nfold@macrotoadd{\pgf@nfold@parselineto{#2}{#3}}%
- \pgf@nfold@addmacro\pgf@cur@conn@segment%
+ \pgf@nfold@addmacro\pgf@cur@conn@subpath%
\else%
\ifx#1\pgfsyssoftpath@curvetosupportatoken%
\def\pgf@nfold@parse@supporta{{#2}{#3}}%
@@ -837,19 +860,19 @@
\else%
\ifx#1\pgfsyssoftpath@curvetotoken%
\edef\pgf@nfold@macrotoadd{\noexpand\pgf@nfold@parsecurveto\pgf@nfold@parse@supporta\pgf@nfold@parse@supportb{#2}{#3}}%
- \pgf@nfold@addmacro\pgf@cur@conn@segment%
+ \pgf@nfold@addmacro\pgf@cur@conn@subpath%
\else%
\ifx#1\pgfsyssoftpath@closepathtoken%
\let\pgf@nfold@last@closepath@from\pgf@nfold@parser@previous@pt%
\def\pgf@nfold@macrotoadd{\pgf@nfold@parseclosepath{#2}{#3}}%
- \pgf@nfold@addmacro\pgf@cur@conn@segment%
+ \pgf@nfold@addmacro\pgf@cur@conn@subpath%
\else%
\ifx#1\pgfsyssoftpath@rectcornertoken%
\def\pgf@nfold@parse@rectcorner{{#2}{#3}}%
\else%
\ifx#1\pgfsyssoftpath@rectsizetoken%
\edef\pgf@nfold@macrotoadd{\noexpand\pgf@nfold@parserect\pgf@nfold@parse@rectcorner{#2}{#3}}%
- \pgf@nfold@addmacro\pgf@cur@conn@segment%
+ \pgf@nfold@addmacro\pgf@cur@conn@subpath%
\else%
\pgfutil@packageerror{tikz-nfold}{Unrecognised soft path token `#1'}{}%
\fi%
@@ -862,27 +885,30 @@
\fi%
\fi%
\def\pgf@nfold@parser@previous@pt{{#2}{#3}}%
+ % store the last two segments, as they might be needed for zero-length \pgfpathclose-segments
+ \let\pgf@nfold@sectolast@segment\pgf@nfold@last@segment%
+ \let\pgf@nfold@last@segment\pgf@nfold@macrotoadd%
\pgf@next}%
-\def\pgf@nfold@process@conn@segment{%
+\def\pgf@nfold@process@conn@subpath{%
\let\pgf@parsed@cur@conn@seg\pgfutil@empty%
\ifx\pgf@nfold@last@closepath@from\pgfutil@empty%
\expandafter\pgf@nfold@parsemoveto\pgf@nfold@parser@last@moveto%
\else%
- % This connected segment ends on a closepath. In order to get
- % the join right, we prepend the current segment with an invisible line
- % identical to the line of the \pgfpathclose. This way,
+ % This connected sub-path ends on a closepath. In order to get
+ % the join right, we prepend the current sub-path with an invisible line
+ % identical to the line of the \pgfpathclose.
\expandafter\pgf@nfold@parsemoveto\pgf@nfold@last@closepath@from%
\expandafter\pgf@nfold@parseinvisibleline\pgf@nfold@parser@last@moveto%
\fi%
- \pgf@cur@conn@segment%
+ \pgf@cur@conn@subpath%
\let\pgf@nfold@macrotoadd\pgf@parsed@cur@conn@seg%
- \pgf@nfold@addmacro\pgf@all@parsed@segments%
+ \pgf@nfold@addmacro\pgf@all@parsed@subpaths%
}
%
% Values for \pgf@nfold@next@type:
-% f=first, m=moveto, c=curveto, l=lineto, r=rect, o=closepath, t=last, i=invisibleline
+% f=first, m=moveto, c=curveto, l=lineto, r=rect, o=closepath, z=zero length closepath, t=last, i=invisibleline
%
\def\pgf@nfold@parsemoveto#1#2{%
@@ -939,15 +965,57 @@
\def\pgf@nfold@parseclosepath#1#2{%
\pgf@process{\pgfpointdiff{\pgf@nfold@next@last}{\pgf@x#1\pgf@y#2}}%
% closepath segments should always be processed even if they have zero length
- \pgf@nfold@parse@line@common{#1}{#2}{o}%
+ \pgfpointtaxicabnorm\pgf@xa%
+ \ifdim\pgf@xa<0.1pt\relax%
+ \pgf@nfold@parse@closepath@zerolength{#1}{#2}%
+ \else%
+ \pgf@nfold@parse@line@common{#1}{#2}{o}%
+ \fi%
}%
+\def\pgf@nfold@parse@closepath@zerolength#1#2{%
+ \pgf@nfold@parser@moveup%
+ \let\pgf@nfold@next@type=z%
+ \let\pgf@nfold@next@visible=1%
+ % Set the start and end tangent to the tangent of the first segment
+ \let\pgf@nfold@next@tang@i\pgf@nfold@connsubpath@tang@i
+ \let\pgf@nfold@next@tang@ii\pgf@nfold@connsubpath@tang@i
+ \let\pgf@nfold@next@angle@i\pgf@nfold@connsubpath@angle@i
+ \let\pgf@nfold@next@angle@ii\pgf@nfold@connsubpath@angle@i
+ \let\pgf@nfold@next@first\pgf@nfold@cur@last
+ % If problems arise, we need to put a fake point here (like \pgf@nfold@next@first + \pgf@nfold@next@tang@i)
+ \def\pgf@nfold@next@last{\pgf@x#1\pgf@y#2}%
+ \pgf@nfold@parser@handlesegment%
+}
+
\def\pgf@nfold@parseinvisibleline#1#2{%
\pgf@process{\pgfpointdiff{\pgf@nfold@next@last}{\pgf@x#1\pgf@y#2}}%
- % invisibleline segments should always be processed even if they have zero length.
+ \pgfpointtaxicabnorm\pgf@xa%
+ % In order to correctly render the start/end join in a closed path,
+ % the \pgfpathclose segment is copied to the start of the path as an invisible line.
% Counterintuitively, an "invisibleline" segment has next@visible=1 because
% we want its end join to be rendered.
- \pgf@nfold@parse@line@common{#1}{#2}{i}%
+ % In case the \pgfpathclose segment has non-zero length, we can just use a copy of
+ % this segment for the invisible line. Otherwise, the invisble line segment must will receive
+ % the same angle/tangent as the last finite-sized segment, which is the second-to-last
+ % segment overall (cached in \pgf@nfold@sectolast@segment).
+ \ifdim\pgf@xa>.1pt\relax%
+ \pgf@nfold@parse@line@common{#1}{#2}{i}%
+ \else%
+ \begingroup%
+ % find the tangent of the second-to-last segment
+ \let\pgf@nfold@parser@handlesegment\relax%
+ \pgf@nfold@sectolast@segment%
+ \global\let\pgf@nfold@tmp\pgf@nfold@next@tang@ii%
+ \endgroup%
+ % Construct an invisible line with length 1pt and the correct tangent.
+ % This step might not be needed since the join computations only require the tangent,
+ % but the invisibleline segment would be inconsistent otherwise, so better play it safe.
+ \pgfextract@process\pgf@nfold@next@first{\pgfpointdiff{\pgf@nfold@tmp}{\pgfqpoint{#1}{#2}}}%
+ % write the tangent into (\pgf@x, \pgf@y) where the next macro expects it to be
+ \pgf@nfold@tmp%
+ \pgf@nfold@parse@line@common{#1}{#2}{i}%
+ \fi%
}%
\def\pgf@nfold@parselast{%
@@ -1047,14 +1115,17 @@
\let\pgf@nfold@next@visible=0%
\edef\pgf@nfold@next@last{\pgf@x\the\pgf@path@lastx\pgf@y\the\pgf@path@lasty}%
% the following only need to be set if visible=1
- \let\pgf@nfold@next@tang@i=\pgfpointorigin%
- \let\pgf@nfold@next@tang@ii=\pgfpointorigin%
- \def\pgf@nfold@next@angle@i{0}%
- \def\pgf@nfold@next@angle@ii{0}%
- \let\pgf@nfold@next@first\pgfpointorigin%
+ % TODO these are disabled temporarily; an attempt to read them suggests that there
+ % is a bug, because their content has no meaning at this point. Consider reenabling
+ % if compile errors show up, but if they do, the root of the problem is likely to be elsewhere
+ %\let\pgf@nfold@next@tang@i=\pgfpointorigin%
+ %\let\pgf@nfold@next@tang@ii=\pgfpointorigin%
+ % \def\pgf@nfold@next@angle@i{0}%
+ % \def\pgf@nfold@next@angle@ii{0}%
+ % \let\pgf@nfold@next@first\pgfpointorigin%
% the following only need to be set if type=c
- \let\pgf@nfold@next@supporta\pgfpointorigin%
- \let\pgf@nfold@next@supportb\pgfpointorigin%
+ % \let\pgf@nfold@next@supporta\pgfpointorigin%
+ % \let\pgf@nfold@next@supportb\pgfpointorigin%
}
\def\pgf@nfold@clampangle{