Open Mo-Gul opened 4 years ago
Are you using the latest PGF? Maybe related: https://github.com/pgf-tikz/pgf/issues/480
I am using GitHub versions of PGF and PGFPlots ... (But at least regarding the quoted TikZ issue that shouldn't make a difference, because there was the release of v3.1.5b after it was closed, right?)
I might be too naive, but I think you are expecting a bit too much. (It is not my intention to downplay the capabilities of the library!) You need to construct subpaths of Bezier curves. Exact solutions would require solutions of cubic equations. I am not claiming that I did a careful job but it appears to me that approximate solutions are found. Since your Bezier curves are extremely stretched, the errors might add to give the effect you are describing. (While it appears to be possible to, in principle, find analytic solutions I think that in practice this will be hard. The more so since a lot of knowledge that went into the libraries will have to be rediscovered by any potential author unless of course either Mark or Christian write the code. These are masterpieces of data handling which are very advanced and sophisticated, certainly beyond the capability of a marmot who might be able to compute the analytic solutions.)
@marmotghost, I am not 100% sure if I understood everything you wrote, so please forgive me the possibly stupid statement and question.
I also thought that maybe this is because the controls
only consists of 4 points and thus leads to inaccuracies finding the intersection, but no, the intersections are all found properly. So I am wondering why can't the (properly found) intersection not (simply) be used? Shouldn't this be possible because the start and end points are known? So I would have guessed that the error is "between" these two points by guessing the help point(s).
If the previous sentences don't change your answer I'll be happy to accept it. You don't need to explain it (in more detail) again. The important thing is that you (the experts, e.g. Henri and you) are on the same page.
@Mo-Gul I am really just guessing. However, you need to perform two steps.
The first step consists of two substeps: 1a. Find the x and y coordinates of the intersections. This works great, as you say. 1b. Find the "time" (Gauss and the pgfmanual call the curve parameter "time") at which a path hits the intersection.
I think that 1b is tricky. Given the parametrization of the Bezier curve,
you need to solve gamma(t_*)=(x_*,y_*) for the intersection points with coordinates (x_*,y_*). These are cubic equations. Once you have these solutions, you'd need in the second step to construct the subpath. (This is actually just a linear problem.) If you do not solve the equations analytically, then in the steps 1b and potentially also 2 deviations can occur that may be hard to control.
@marmotghost Many thanks for the insight.
@Mo-Gul I'd like to reiterate because the above comment may sound too negative. I am not at all negative. Rather, if you look at section 5.7.7 of the pgfplots manual v1.17, you can see that pgfplots already achieves what some want to achieve for TikZ/pgf, see this issue. I just think that it might be worthwhile to rewrite parts of it to incorporate a more analytic approach. (I think that the bbox library is a proof of principle that the analytic approach works, and if someone writes the analytic routines for the path manipulations one could hope that they choose an editor the maintainers like... ;-) And, of course, it would be good to make it possible to load fillbetween
without loading pgfplots
, which should be possible in principle but is also hard work, I think.
What I want to say is that I think that there is a chance that an analytic approach works. However, carrying this out will most likely require collaborations because it may be that the analytic approach person is not capable to reproduce what Mark and Christian did when they set up the amazing scheme of data handling that underlies the intersections and fillbetween libraries.
This is not the place to ask but kind of related to these issues; can anyone please just summarize the current status of the old maintainer status in terms of active/inactive? I remember somebody telling me Till was not around anymore for TeX stuff (maybe Christian in an email?).
I have seen already too many that things went sour between individuals in all kinds of open source libraries, hence please skip those things. I am just curious about who is around and I do not want to stir the soup. There is also the l3draw stuff that was happening some time ago IIRC from my days where I was still TeXing. Did they move there and/or contributed? Because they would definitely have valuable input.
@ilayn I would be willing to make a $100 donation to the marmot recovery foundation for the information what Don Knuth, Leslie Lamport, Heiko Oberdiek and Till Tantau really think about expl3.
I don't think they care about TeX anymore. I meant TikZ maintainers Mark, Christian, if s/he is still around cjorssen and so on.
@ilayn If true, this would be a pity. I am using what they have created on a daily basis. For work and for recreation. It is remarkable that there are some who create things that last for decades and just give it to the community for free.
That's the basic definition of open-source.
@ilayn Yes, sure. However, it is remarkable that there are people who have the vision and skills to create something that is still state of the art for millions of people decades after it has been created is remarkable. If I were to create an open-source code, it might be used by two people and will be outdated in a month.
On TeX.SX this was first reported (https://tex.stackexchange.com/q/543553/95441).
Although the
intersections
are found properly, when usingsequence
in 3 out of 4 tests the result is odd, so I guess this is a bug. Please find below a modified MWE.