jonschz / tikz-nfold

Triple, quadruple, and n-fold paths and arrows with TikZ
LaTeX Project Public License v1.3c
11 stars 1 forks source link

Proper support for `--cycle` / `\pgfpathclose` #9

Closed jonschz closed 1 year ago

jonschz commented 1 year ago

At the moment, closed paths are only rendered correctly when the angle in the first/last join is zero. Support for non-trivial joins would be nice to have. The changes outlined in #7 should make this possible in principle.

The main issue is the following: Suppose we want to draw the path

\begin{tikzpicture}
\draw[double distance=5pt, nfold] (0,0) -- (2,0) -- (0,1) -- cycle;
\end{tikzpicture}

Then we would have to know the angle of the join at (0,0) already at the time we start drawing the first line segment (from (0,0) to (2,0)), so computations must be made in a pre-pass for each connected component of the path.