You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the intersection segments option from the fillbetween library, sometimes the path segments are not calculated correctly, especially when applied to curved paths such as circles or arcs.
I was not able to find a rule for it, but sometimes segments are too large and they would overlap the previous segment even, sometimes the curve is not drawn properly at the end of the segment.
Why is this and how can one circumvent this behaviour?
(PGF Version: 2021/05/15 v3.1.9a)
Minimal working example (MWE)
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{fillbetween, spy}
\begin{document}
\begin{tikzpicture}
[spy using outlines={circle, magnification=4, size=1cm, connect spies}]
\path[draw=green, name path=CircleA]
(120:1) circle[radius=0.25];
\path[draw=magenta, name path=ArcA]
(180:1) arc[start angle=180, end angle=0, radius=1];
\draw[cyan, intersection segments={of=CircleA and ArcA, sequence=R3}];
\spy[black!25] on (102.5:1)
in node at (0,0);
\path[draw=green, name path=CircleB]
([yshift=20pt]120:1) circle[radius=0.25];
\path[draw=magenta, name path=ArcB]
([yshift=20pt]180:1) arc[start angle=180, end angle=0, radius=1];
\draw[yellow, intersection segments={of=CircleB and ArcB, sequence=R2}];
\spy[black!25] on ([yshift=20pt]102.5:1)
in node at (0,2.5);
\end{tikzpicture}
\end{document}
I would expect the yellow segment to start at the intersection of the green circle and the magenta arc. Also, I would expect the cyan path to be exactly drawn over the magenta arc.
The text was updated successfully, but these errors were encountered:
Using only tikz library intersection the output looks fine, so I think the problem comes from fillbetween, which is only available if pgfplots is loaded. Hence I'm transferring this issue to https://github.com/pgf-tikz/pgfplots.
An intersection-only example
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\path[draw=green, name path=CircleA]
(120:1) circle[radius=0.25];
\path[draw=magenta, name path=ArcA]
(180:1) arc[start angle=180, end angle=0, radius=1];
\draw[name intersections={of=CircleA and ArcA, name=x, total=\x}]
(x-1) -| (x-2);
\end{tikzpicture}
\end{document}
Brief outline of the bug
When using the
intersection segments
option from thefillbetween
library, sometimes the path segments are not calculated correctly, especially when applied to curved paths such as circles or arcs.I was not able to find a rule for it, but sometimes segments are too large and they would overlap the previous segment even, sometimes the curve is not drawn properly at the end of the segment.
Why is this and how can one circumvent this behaviour?
(PGF Version: 2021/05/15 v3.1.9a)
Minimal working example (MWE)
I would expect the yellow segment to start at the intersection of the green circle and the magenta arc. Also, I would expect the cyan path to be exactly drawn over the magenta arc.
The text was updated successfully, but these errors were encountered: