Open jasperhabicht opened 1 year ago
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.
intersection
-only example```tex \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} ``` ![image](https://user-images.githubusercontent.com/6376638/229128764-c3a38368-f37c-4c19-9125-ea3ca0a760dd.png)
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.